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: 165  
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

Report Center Failed Logins Report/Chart
by  Cindy.C   Go to last post Go to first unread
Last post: Today at 11:05:12 AM(UTC)
Lansweeper Microsoft Patch Tuesday Report - May 2019
by  jase  
Go to last post Go to first unread
Last post: Yesterday at 10:17:06 PM(UTC)
Lansweeper Report of Monitors Connected To PC's
by  meddlema   Go to last post Go to first unread
Last post: Yesterday at 10:04:39 PM(UTC)
Lansweeper Windows 7 Assets, their user, and users manager
by  Jeff Hilmo  
Go to last post Go to first unread
Last post: Yesterday at 6:51:55 PM(UTC)
Lansweeper Firefox 67 Critical Security Issue
by  Esben.D   Go to last post Go to first unread
Last post: Yesterday at 11:40:51 AM(UTC)
Report Center BIOS version check
by  Esben.D  
Go to last post Go to first unread
Last post: 5/22/2019 1:22:28 PM(UTC)
Lansweeper report in defined period
by  CHIREC   Go to last post Go to first unread
Last post: 5/22/2019 10:46:34 AM(UTC)