Notification

Icon
Error

Launch PowerShell remote PSSession

Posted: Friday, August 9, 2019 12:07:41 PM(UTC)
Ian

Ian

Member Original PosterPosts: 4
1
Like
This issue has been solved! Click here to view the solution
Hi Folks,

I am trying to launch the below command from the basic actions menu for an asset but the PowerShell window displays and then closes with no output

I have the command working from a normal PowerShell window on the Lansweeper server.

The two commands I have tried are below:
powershell.exe Enter-PSSession -ComputerName {computer}
powershell.exe set-executionpolicy bypass Enter-PSSession -ComputerName {computer}

Any ideas what I am doing wrong?
steveb
#1steveb Member Posts: 11  
posted: 9/5/2019 10:21:40 PM(UTC)
Its not exactly what you want but it does work via psexec.

{actionpath}psexec.exe /accepteula \\{smartname} powershell.exe

I cannot get it to work the same way you were trying it either.
steveb
#2steveb Member Posts: 11  
posted: 9/5/2019 10:36:52 PM(UTC)
I got it to work. Try adding the -noexit parameter.

powershell.exe -noexit Enter-PSSession -ComputerName {smartname}

For anyone else, here is the how to I followed for enabling remote powershell sessions if you don't already have it setup.

remote powershell enable
Ian
#3Ian Member Original PosterPosts: 4  
posted: 9/9/2019 12:10:56 PM(UTC)
Originally Posted by: steveb Go to Quoted Post
I got it to work. Try adding the -noexit parameter.

powershell.exe -noexit Enter-PSSession -ComputerName {smartname}

For anyone else, here is the how to I followed for enabling remote powershell sessions if you don't already have it setup.

remote powershell enable


Thanks for that Steve, it worked perfectly.

Active Discussions

Lansweeper Number Of Application Hang Event ID 1002 Count , Null
by  HRS   Go to last post Go to first unread
Last post: 11/29/2019 9:42:49 PM(UTC)
Action Change Windows domain PC Name
by  DaveDischord  
Go to last post Go to first unread
Last post: 11/27/2019 10:36:02 PM(UTC)
Lansweeper LsRemote.exe Background Image Removal
by  Martin Frey   Go to last post Go to first unread
Last post: 11/27/2019 11:40:23 AM(UTC)
Lansweeper List of Software Publisher´s
by  fuesselorg  
Go to last post Go to first unread
Last post: 11/22/2019 5:11:42 PM(UTC)
Lansweeper Infopath installer help
by  Dave Ward   Go to last post Go to first unread
Last post: 11/12/2019 11:16:51 AM(UTC)
Lansweeper Remote Registry 2019
by  gareauk  
Go to last post Go to first unread
Last post: 10/24/2019 7:33:06 PM(UTC)
Lansweeper Deploy
by  CyberCitizen   Go to last post Go to first unread
Last post: 10/10/2019 2:31:27 AM(UTC)
Action Backup Computer with Disk2VHD to network share
by  pryan67  
Go to last post Go to first unread
Last post: 10/7/2019 3:36:05 PM(UTC)