Re: Help - need to change an attribute value
- From: "Richard Mueller" <rlmueller-NOSPAM@xxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 10 Jul 2006 14:30:56 -0500
Sabo, Eric wrote:
Is there any way to change an attribute value?
All I need to change is the syntax - we have it set at "Case Sensitive
String" and the vendor is saying it needs to be "Case Insensitive String".
What tool could I use to accomplish this?
If all users have the same value for the attribute, it can be done in ADUC.
Otherwise, if everyone has a different value, you need to use a script. If
by case insensitive you mean all lower case, you can use the LCase function
in VBScript. If the attribute is a single valued string, a script can modify
the attribute value for all users in the domain (or in an Organizational
Unit) to make it lower case.
What is the attribute?
Does everyone have the same value assigned?
Do you want the existing value made lower case?
Should this be done to all users in the domain, all in an OU?
A quick example for all users in an OU:
========
' Bind to OU.
Set objOU = GetObject("LDAP://ou=Sales,dc=MyDomain,dc=com")
' Filter on user objects.
objOU.Filter = Array("user")
' Enumerate users in the OU.
For Each objUser In objOU
' Retrieve attribute value.
strDeparment = objUser.department
' Make lower case.
strDepartment = LCase(strDepartment)
' Assign new value.
objUser.department = strDepartment
' Save changes.
objUser.SetInfo
Next
==========
To modify users in many OU/Containers throughout, you would use ADO to
retrieve all user distinguishedNames and the value of the attribute. ADO
would return recordset with one row for each usere. You would loop through
the recordset, bind to each user with the distingiushedName, retrieve the
attribute value, modify it, and update the attribute value of the user
object.
--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
.
- Follow-Ups:
- Re: Help - need to change an attribute value
- From: Joe Kaplan \(MVP - ADSI\)
- Re: Help - need to change an attribute value
- Prev by Date: Re: Site links In a meshed network
- Next by Date: Re: Create New User and Home Directory
- Previous by thread: Re: Remote install of applications
- Next by thread: Re: Help - need to change an attribute value
- Index(es):
Relevant Pages
|