I have the following script, to reset the Administrator password based on membership of an OU.
However, I would like to report a success or failure when the script connects to the computer.
I added the 'On Error Resume Next' line to avoid the errors, but I can't see the progress of the script.
What would I have to add to this script to achieve this?
Simple reporting would be fine, a TXT file etc.
Set objOU = GetObject("LDAP://OU=TestOU, DC=Fabrikam, DC=com")
objOU.Filter = Array("Computer")
On Error Resume Next
For Each objItem in objOU
strComputer = objItem.CN
Set objUser = GetObject("WinNT://" & strComputer & "/Administrator")
objUser.SetPassword("********")
Next
MsgBox "The script has finished"
Many thanks
DEC
If it helps, let me know, if it doesn't, let me know. It's the only way I'll learn.
However, I would like to report a success or failure when the script connects to the computer.
I added the 'On Error Resume Next' line to avoid the errors, but I can't see the progress of the script.
What would I have to add to this script to achieve this?
Simple reporting would be fine, a TXT file etc.
Set objOU = GetObject("LDAP://OU=TestOU, DC=Fabrikam, DC=com")
objOU.Filter = Array("Computer")
On Error Resume Next
For Each objItem in objOU
strComputer = objItem.CN
Set objUser = GetObject("WinNT://" & strComputer & "/Administrator")
objUser.SetPassword("********")
Next
MsgBox "The script has finished"
Many thanks
DEC
If it helps, let me know, if it doesn't, let me know. It's the only way I'll learn.