I am trying to create this vbscript so I can change the passwords on our hosted 2kserver machines in a workgroup. I will be running the script from my computer in a domain and I will need to pass different username/password combo with admin rights to the servers to run the script. I wonder if at all possible. Here's my script btw: (Note: this is the test script and once I validate that it works I will add necessary code to create the loop).
I picked up bits and pieces there and I don't understand why there is a need for sAltUser, sAltPass. Please help!
Const ADS_SECURE_AUTHENTICATION = 1
Const ADS_USE_ENCRYPTION = 2
sComp = "fid-etl"
sUser = "kjagpal"
sAltUser = "adminuser"
sAltPass = "adminpass"
Set oDSO = GetObject("WinNT:")
Set oUser = oDSO.OpenDSObject("WinNT://" & sComp & "/" & sUser, sAltUser, sAltPass, ADS_SECURE_AUTHENTICATION AND ADS_USE_ENCRYPTION)
oUser.SetPassword "12345"
Msgbox 'Done'
I picked up bits and pieces there and I don't understand why there is a need for sAltUser, sAltPass. Please help!
Const ADS_SECURE_AUTHENTICATION = 1
Const ADS_USE_ENCRYPTION = 2
sComp = "fid-etl"
sUser = "kjagpal"
sAltUser = "adminuser"
sAltPass = "adminpass"
Set oDSO = GetObject("WinNT:")
Set oUser = oDSO.OpenDSObject("WinNT://" & sComp & "/" & sUser, sAltUser, sAltPass, ADS_SECURE_AUTHENTICATION AND ADS_USE_ENCRYPTION)
oUser.SetPassword "12345"
Msgbox 'Done'