Script to Mass Modify Custom Attribute 5 for users.

Greetings Experts,

I am looking for a script to Mass Modify Custom Attribute 5 for my AD users. It would be nice if the script would prompt for the location of the "awnserfile" that contains the users it needs to modify. Also, I would like it if the script would prompt for the value it needs to change for Custom Attribute 5.

If we can't script it to prompt, then if I can just enter in the location and value within the script, that will suit as well.

Thanks!!!
LVL 9
GWMerrellAsked:
Who is Participating?
 
RobSampsonCommented:
Hi Glenn, I think the first step here is just to make sure we *can* modify CustomAttribute5 for any user, automatically.

So let's just try one user:

Set objUser = GetObject("LDAP://CN=User Name, OU=SubGroup1, OU=Group2, DC=sdomain, DC=domain, DC=com")
objUser.customAttribute5 = "MyValue"

Or, if that doesn't work, try:

Set objUser = GetObject("LDAP://CN=User Name, OU=SubGroup1, OU=Group2, DC=sdomain, DC=domain, DC=com")
objUser.Put "customAttribute5", "MyValue"

Or, if that doesn't work, try:

Const ADS_PROPERTY_UPDATE = 2
Set objUser = GetObject("LDAP://CN=User Name, OU=SubGroup1, OU=Group2, DC=sdomain, DC=domain, DC=com")
objUser.PutEx ADS_PROPERTY_UPDATE, "customAttribute5", Array("MyValue")

Let me know which one works and we'll work on automating that.

Regards,

Rob.
0
 
GWMerrellAuthor Commented:
Sounds Good, things a bit hectic here, but I will get on it.
0
 
RobSampsonCommented:
Hi Glenn, any luck with getting around to this?

Regards,

Rob.
0
 
GWMerrellAuthor Commented:
Morning Rob,
I haven't had a chance to execute this with my new position here. I am doing a little fire control first, then I believe I will have time to follow up.  I will keep you posted....
Thanks for the follow up.
Glenn
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.