I have the following VBScript which I can execute from my workstation (I am a domain admin), in order to change the local computer's administrator password. However, I am noticing an oddity.
First, the script:
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Set objOU = GetObject("LDAP://OU=test, DC=mycompany, DC=com")
objOU.Filter = Array("Computer")
For Each objItem in objOU
strComputer = objItem.CN
Set objUser = GetObject("WinNT://" & strComputer & "/Administrator")
objUser.SetPassword("InsertPasswordHere")
Next
~~~~~~~~~~~~~~~~~~~~~~~
Now, I created the test OU last week, and I can run this script on it today just fine.
Today, about and hour and a half ago, I created another OU called Test2. I run the same script, with Test2 as the OU.. and the following error comes up:
___________________________
---------------------------
Windows Script Host
---------------------------
Script: D:\Documents and Settings\brianw\Desktop\Copy of Change Local Admin Password.vbs
Line: 6
Char: 5
Error: The network path was not found.
Code: 80070035
Source: (null)
---------------------------
OK
---------------------------
Now, the only difference between these two OUs is that one was created last week, the other less than two hours ago. Is there some replication issue that could be going on here that I'm not aware of? I can't see why this error would occur for one OU but not the one right next to it, when they are named properly in the script.