Question
January 25, 2008 at 07:17 AM
halvonike

Script to change local admin

by halvonike . Updated 18 years, 9 months ago

Hi,

I’m very new to scripting. I have this vb script to change the local admin password on machines and it works great. However, I have to specify which OU the workstations are in. I have workstations in multiple OU’s though. How can specify the multiple OU’s? Here’s the script:

Set objOU = GetObject(“LDAP://OU=test this, OU=Workstations, DC=domain, DC=com”)
objOU.Filter = Array(“Computer”)

For Each objItem in objOU
strComputer = objItem.CN
Set objUser = GetObject(“WinNT://” & strComputer & “/Administrator”)
objUser.SetPassword(“password”)
Next

Thanks very much for any help.

This discussion is locked

All Comments