Jump to content

Heartbeat program for Windows computer


PhanTomiZ

Recommended Posts

VBS Script:

 
Set WshShell = WScript.CreateObject("WScript.Shell")
'Set http = CreateObject("MSXML2.serverXMLHTTP")
'Set http = CreateObject("MSXML2.XMLHTTP")
Set http = CreateObject("Microsoft.XmlHttp")
 
 
' If auth is required, replace the userName and password values
' with the ones you use on your ISY
userName = "ISY Username"
password = "ISY Password"
 
http.open "GET", url, false, userName, password
http.send 
 
Set userName = Nothing
Set password = Nothing
Set myFSO = Nothing 
set WshShell = nothing
set http = nothing
set objXmlDoc = Nothing 

 

 

...and in Powershell....

$isy_user = "ISY Username"
$isy_password = "ISY Password"
$url = "http://ISYIP:ISYPort/rest/vars/set/2/72/9"
$authVal = "Basic " + [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($isy_user + ":" + $isy_password))
$response = Invoke-WebRequest -Uri $url -Headers @{"AUTHORIZATION"=$authVal}
$response.Content
Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...