Notification

Icon
Error

Locking the PC Windows 10

Posted: Friday, January 25, 2019 10:53:47 PM(UTC)
User18954

User18954

Member Original PosterPosts: 5
0
Like
Any reason why a Lock Screen would not initiate from a Powershell script with a Lansweeper Deploy?
Anyone have a trick that will work?

I run a command (very similar to other powershell scripts that I run)
powershell.exe -executionpolicy bypass -file "{PackageShare}\Scripts\Lock-Desktop.ps1"

Then the PS1 has a simple script:
rundll32.exe user32.dll,LockWorkStation

It works locally of course, but not remotely through Lansweeper Deploy.

UPDATE: Found problem, run as Logged In User!
User18954
#1User18954 Member Original PosterPosts: 5  
posted: 1/25/2019 10:56:40 PM(UTC)
Fixed it! So quick, for anyone else, this works, just make sure to run it as "Currently Logged On" and not a System Account! D'oh!
CyberCitizen
#2CyberCitizen Member Posts: 124  
posted: 3/20/2019 7:24:48 AM(UTC)
Could just be run as a normal command, doesn't need to be called from powershell unless you are doing other fancy stuff.

Active Discussions

Lansweeper LSAgent has forgotten x64 Windows applications
by  cycleheat   Go to last post Go to first unread
Last post: Yesterday at 7:18:12 PM(UTC)
Lansweeper Performance scanning - incorrect values
by  Richard_Lan  
Go to last post Go to first unread
Last post: Yesterday at 4:26:02 PM(UTC)
Lansweeper Windows firewall rules
by  pryan67   Go to last post Go to first unread
Last post: Yesterday at 2:56:52 PM(UTC)
Lansweeper Run outside of our domain?
by  pryan67  
Go to last post Go to first unread
Last post: Yesterday at 2:53:05 PM(UTC)
Lansweeper Add logic to certain ticket submission
by  Esben.D   Go to last post Go to first unread
Last post: Yesterday at 1:02:46 PM(UTC)
Lansweeper Avast scanning still failing
by  Esben.D  
Go to last post Go to first unread
Last post: Yesterday at 12:59:17 PM(UTC)
Lansweeper History deleting daily
by  Esben.D   Go to last post Go to first unread
Last post: Yesterday at 12:46:08 PM(UTC)
Lansweeper Initial Ticket State Status
by  John M  
Go to last post Go to first unread
Last post: 4/23/2019 5:37:30 PM(UTC)