Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Script to Mass Modify Custom Attribute 5 for users.

Posted on 2009-04-15
4
Medium Priority
?
490 Views
Last Modified: 2012-05-06
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!!!
0
Comment
Question by:GWMerrell
  • 2
  • 2
4 Comments
 
LVL 65

Accepted Solution

by:
RobSampson earned 2000 total points
ID: 24153562
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
 
LVL 9

Author Comment

by:GWMerrell
ID: 24172751
Sounds Good, things a bit hectic here, but I will get on it.
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 24392796
Hi Glenn, any luck with getting around to this?

Regards,

Rob.
0
 
LVL 9

Author Comment

by:GWMerrell
ID: 24396937
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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question