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: 196  
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 Moving Assets in Location not Saving
by  brodiemac   Go to last post Go to first unread
Last post: Today at 12:23:04 PM(UTC)
Lansweeper HP Printer not showing correctly
by  Esben.D  
Go to last post Go to first unread
Last post: Today at 10:41:49 AM(UTC)
Lansweeper Scanning includes IOS devices even though I exclude them??
by  steveb   Go to last post Go to first unread
Last post: Yesterday at 11:05:33 PM(UTC)
Lansweeper Deployment condition
by  CyberCitizen  
Go to last post Go to first unread
Last post: Yesterday at 5:36:05 AM(UTC)
Lansweeper lsagent not scanning/sending when using relay
by  Esben.D   Go to last post Go to first unread
Last post: 8/19/2019 12:31:02 PM(UTC)
Lansweeper Check if Netbios is disabled over TCP/IP
by  TaherMD  
Go to last post Go to first unread
Last post: 8/19/2019 6:00:51 AM(UTC)
Lansweeper Email attachments
by  krejar   Go to last post Go to first unread
Last post: 8/15/2019 10:15:07 PM(UTC)
Lansweeper Install LsAgent on Mac
by  Jonnym  
Go to last post Go to first unread
Last post: 8/14/2019 10:14:08 AM(UTC)