Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: Lock NT Server
You might consider writing a little script that calls the LockWorkstation() API and then have the script executed on a remote system.
I wrote this when trying to wade through the Platform SDK to see if there was a way to determine whether the workstation was locked:
;Lock workstation. NT-based OS's only. LockWS=DllCall(StrCat(DirWindows(1),"User32.dll"),long:"LockWorkStation") If LockWS==0 LockMsg="Failed to lock workstation" Else LockMsg="Workstation lock successful" EndIf Message ("Lock Workstation",LockMsg) Exit
Another option would be to do the following:
run("rundll32.exe", "user32.dll,LockWorkStation") TimeDelay(3) LockDetectionTile = strcat(random(99999),"LockDetectionWindow",random(99999)) BoxesUp("450,450,550,525",@normal) BoxCaption(1,LockDetectionTile) BoxButtonDraw(1,1,"Click Here","0,0,1000,1000") BoxDataTag(1,"clickme") while !BoxButtonStat(1,1) TimeDelay(.1) SendKeysTO(LockDetectionTile,"~") endwhile boxdataclear(1,"clickme") boxdestroy(1) TimeDelay(2) message("Attention","Looks like the workstation is unlocked now.") exit
Article ID: W15518
File Created: 2003:05:13:11:28:28
Last Updated: 2003:05:13:11:28:28