Thursday, September 26, 2013

Powershell Techniques : Lock Your Workstation using Powershell.

 

In my previous post, I created test button on Login Screen changer GUI,  when you clicked on them it lock your workstation.

Capture

I got few queries that which code I used behind the above Test button.  I used the below code to lock the workstation.

 $shell = New-Object -com "Wscript.Shell"

 $shell.Run("%windir%\System32\rundll32.exe user32.dll,LockWorkStation")

Just shoot the above code and when you paste the last line, you computer will be locked.

I found it cool! i hope you may also like it.

Aman Dhally

clip_image001 clip_image002 clip_image003 clip_image005clip_image007

No comments:

Post a Comment