Skip to content

Instantly share code, notes, and snippets.

@crossan007
Created August 10, 2019 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crossan007/670dadb3bb0a4913d02b3bedf38f15a1 to your computer and use it in GitHub Desktop.
Save crossan007/670dadb3bb0a4913d02b3bedf38f15a1 to your computer and use it in GitHub Desktop.
'On Error Resume Next
do
Set objHTTP = CreateObject("MSXML2.ServerXMLHTTP")
objHTTP.SetOption 2, objHTTP.GetOption(2) - SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS
objHTTP.Open "POST", "https://webserviceurl/shouldlock", False
objHTTP.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
objHTTP.send ""
wscript.echo objHTTP.responsetext
if objHTTP.responsetext = "1" then
msgbox "locking"
Set objShell = CreateObject("Wscript.Shell")
objShell.Run "%windir%\System32\rundll32.exe user32.dll,LockWorkStation"
end if
sleep 2000
while
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment