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!

Active Discussions

Lansweeper Software Deployment packages to Windows 10 machines Fail
by  jblamire  
Go to last post Go to first unread
Last post: Yesterday at 8:01:37 PM(UTC)
Lansweeper Change user who entered time worked
by  sbAYVdQu   Go to last post Go to first unread
Last post: Yesterday at 7:33:01 PM(UTC)
Lansweeper Questions about Emailing Reports
by  Cripple.Zero  
Go to last post Go to first unread
Last post: Yesterday at 7:04:54 PM(UTC)
Lansweeper Installing Lansweeper on Windows Core Server
by  AZHockeyNut   Go to last post Go to first unread
Last post: Yesterday at 6:13:15 PM(UTC)
Lansweeper Lansweeper Asset Screen not showing Purchased & Warranty values
by  JacobH  
Go to last post Go to first unread
Last post: Yesterday at 2:15:09 PM(UTC)
Lansweeper Sonos not detected
by  Vic T.   Go to last post Go to first unread
Last post: Yesterday at 2:03:26 PM(UTC)
Lansweeper Lansweeper Ignoring Exclusions after 6.x to 7.Upgrade
by  Vic T.  
Go to last post Go to first unread
Last post: Yesterday at 1:52:05 PM(UTC)