PC Review


Reply
Thread Tools Rate Thread

Change in Description

 
 
WooYing
Guest
Posts: n/a
 
      20th Nov 2006
Hey AD Experts


I was wondering what would be the best way to add a
change to everyone AD description field. Currently I have users who has
their Last Name, First Name ( Division Name). I want to change the Divison
Name to another name (Corp Name). I was wondering what is the best way to
actually do this, any help is appreciated. TIA.



 
Reply With Quote
 
 
 
 
Richard Mueller
Guest
Posts: n/a
 
      20th Nov 2006
WooYing wrote:

> I was wondering what would be the best way to add a
> change to everyone AD description field. Currently I have users who has
> their Last Name, First Name ( Division Name). I want to change the
> Divison Name to another name (Corp Name). I was wondering what is the
> best way to actually do this, any help is appreciated. TIA.
>


A VBScript program can do this, but you need a source for the values (first
name, last name, etc.) If the sn and givenName attributes are populated in
AD, you can use that. Otherwise you will need to code a program to read
these values from a text file, csv, or spreadsheet. Or perhaps you can parse
the values from the Common name, or even the old description.

You can either enumerate and modify the users in a container, as I do in the
example below, or use ADO to retrieve info on all users in the domain. If
all users are in one OU/container, and the sn and givenName attributes are
populated for all, you can use code similar to:
==========
Option Explicit
Dim objOU, objUser, strFirst, strLast, strDescr

' Bind to OU/container, using Distinguished Name.
Set objOU = GetObject("LDAP://ou=Sales,dc=MyDomain,dc=com")

' Filter on user objects.
objOU.Filter = Array("user")

' Enumerate user objects.
For Each objUser In objOU
' Retrieve attribute values.
strFirst = objUser.givenName
strLast = objUser.sn
' Construct new value for description.
strDescr = strLast & ", " & strFirst & " (Corp Name)"
' Assign value to description attribute.
objUser.description = strDescr
' Save changes.
objUser.SetInfo
Next
============
Otherwise, you can use ADO to retrieve the values of attributes for all
users in the domain. You would also retrieve the distinguishedName of each
user, so you can bind to the user object and modify the description
attribute. For information on using ADO, see this link:

http://www.rlmueller.net/ADOSearchTips.htm

--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net


 
Reply With Quote
 
Joe Richards [MVP]
Guest
Posts: n/a
 
      21st Nov 2006
You may want to look at AdFind/AdMod if you don't want to write a script
to do this.

Specifically check out the AdMod CSV usage via admod /csv? specifically
you want to look at the replace modifier (r) functionality of the
expansion capability.

joe



--
Joe Richards Microsoft MVP Windows Server Directory Services
Author of O'Reilly Active Directory Third Edition
www.joeware.net


---O'Reilly Active Directory Third Edition now available---

http://www.joeware.net/win/ad3e.htm


WooYing wrote:
> Hey AD Experts
>
>
> I was wondering what would be the best way to add a
> change to everyone AD description field. Currently I have users who has
> their Last Name, First Name ( Division Name). I want to change the Divison
> Name to another name (Corp Name). I was wondering what is the best way to
> actually do this, any help is appreciated. TIA.
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How Do I Change File Name Description? =?Utf-8?B?QnJldHQgV2Vpc3M=?= Windows Vista General Discussion 8 29th Aug 2007 12:16 AM
How do I change my computer description Terry Windows XP General 4 14th Jan 2007 03:49 AM
change description with accessobject thread Microsoft Access 1 28th Jul 2006 04:59 PM
Can't change user description Mike Microsoft Windows 2000 Active Directory 1 21st Jul 2004 06:19 PM
How to change map drive description? Mesak Windows XP General 0 18th Mar 2004 10:15 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:16 PM.