Re: Help - need to change an attribute value
- From: "Joe Kaplan \(MVP - ADSI\)" <joseph.e.kaplan@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 10 Jul 2006 22:01:11 -0500
I think so. I haven't done a ton of schema mods in my day and have never
activated a defuncted attribute, but that sounds reasonable.
Joe K.
--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
"Sabo, Eric" <sabo_e@xxxxxxx> wrote in message
news:9CE91812-E6D0-438C-B9EB-1E15D07A4B7F@xxxxxxxxxxxxxxxx
Joe,
Would this work:
1. Activate the defuncted Attribute
2. Rename the attribute
3. Upload the schema changes
4. Defuncted the renamed attribute
5. Create the attribute again
Would this by any chance work?
"Joe Kaplan (MVP - ADSI)" wrote:
I think he's trying to change the schema for an attribute's syntax, not
change the values. His subject on his post is misleading.
I'm pretty sure you can't change the syntax after creation though. The
attribute would need to be defuncted and a new attribute would need to be
created. This is why you always try to practice on an ADAM instance if
possible.
The vendor is probably making a good suggestion though. Case-sensitive
string syntaxes are the devil. They make all your queries case sensitive
and cause many head-scratching moments. They are best avoided unless
absolutely required. If you poke around in the AD schema, very few
attributes use case sensitive syntaxes.
Joe K.
--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services
Programming"
http://www.directoryprogramming.net
--
"Richard Mueller" <rlmueller-NOSPAM@xxxxxxxxxxxxxxxxxxxx> wrote in
message
news:%23DeFfdFpGHA.4408@xxxxxxxxxxxxxxxxxxxxxxx
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: Sabo, Eric
- Re: Help - need to change an attribute value
- References:
- Re: Help - need to change an attribute value
- From: Richard Mueller
- Re: Help - need to change an attribute value
- From: Joe Kaplan \(MVP - ADSI\)
- Re: Help - need to change an attribute value
- From: Sabo, Eric
- Re: Help - need to change an attribute value
- Prev by Date: Re: Help - need to change an attribute value
- Next by Date: Re: Replacing First Domain Controller Computer
- Previous by thread: Re: Help - need to change an attribute value
- Next by thread: Re: Help - need to change an attribute value
- Index(es):
Relevant Pages
|