Propagate an Active Directory property to all persons in an OU

I'm looking for a way for me to populate a attribute in Windows 2003 Active directory and have it fill in those same values for all the users in the OU. Current and new.  Even if I move a user or create a new one.

Is that possible?
kblackwelAsked:
Who is Participating?
 
exx1976Connect With a Mentor Commented:
Uhhh.....

Sort of..  You could use a small piece of VBS to accomplish this.  You'd have to either schedule it or re-run it by hand to include the new users though.  Here's an example that sets the phone number for every user in an OU (I just hacked this together quick here to give you an example)


HTH,
exx
Set oOU = GetObject("LDAP://OU=MyUsers,DC=myDomain,DC=local")
For each object in oOU
    If object.class = "user" Then
        object.telephoneNumber = "202-555-1212"
        object.setinfo()
    End If
Next

Open in new window

0
All Courses

From novice to tech pro — start learning today.