Created
August 10, 2019 15:48
-
-
Save crossan007/670dadb3bb0a4913d02b3bedf38f15a1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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