cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
User18954
Engaged Sweeper II

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!

2 REPLIES 2
CyberCitizen
Honored Sweeper
Could just be run as a normal command, doesn't need to be called from powershell unless you are doing other fancy stuff.
User18954
Engaged Sweeper II
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!