Notification

Icon
Error

Locking the PC Windows 10

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

User18954

Member Original PosterPosts: 6
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: 6  
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: 187  
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 Facebook user group
by  Esben.D   Go to last post Go to first unread
Last post: Yesterday at 9:10:27 PM(UTC)
Lansweeper TPM Reporting Issue Help
by  Esben.D  
Go to last post Go to first unread
Last post: Yesterday at 9:06:24 PM(UTC)
Lansweeper Mark Asset as 'Retired/Disposed Of' but keep History
by  dshu  
Go to last post Go to first unread
Last post: Yesterday at 3:01:35 PM(UTC)
Lansweeper LSAgent Custom Cloud Relay Destinations
by  n.klug   Go to last post Go to first unread
Last post: Yesterday at 8:46:03 AM(UTC)
Lansweeper Lansweeper Remote Screenshot Folder
by  Matija  
Go to last post Go to first unread
Last post: Yesterday at 7:24:31 AM(UTC)
Lansweeper Office 2016 key scanning
by  CyberCitizen   Go to last post Go to first unread
Last post: Yesterday at 1:15:25 AM(UTC)