RE: Change of set display name
- From: Umesh Thakur <UmeshThakur@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 2 Sep 2005 10:46:01 -0700
add following line:
objUser.setInfo
after this line:
objUser.Put "displayName", givenName + " " + sn
Just missed it in the script...
--
When you are unable to keep your eyes open, do go and sleep for few hours!!!
"Umesh Thakur" wrote:
> Use the following code to change displayName of ALL USERS in given OU:
> (specially modified for you) :)
>
> Const ADS_PROPERTY_UPDATE = 2
> objOU="ou=Staff,dc=fabrikam,dc=com"
>
> set objOU = GetObject("LDAP://" & objOU) 'get a reference to the OU
> for each objUser in objOU 'Loop through all OBJECTS in referenced OU
> If objUser.Class="user" Then 'If object in OU is User,
> Set objUser = GetObject("LDAP://" & objUser.distinguishedName)
> 'Set displayName...
> objUser.Put "displayName", givenName + " " + sn
> End if
> next
>
> Regards,
> Umesh
>
> --
> When you are unable to keep your eyes open, do go and sleep for few hours!!!
>
>
> "MooNBeaR" wrote:
>
> >
> > I have a whole bunch of users that were created from this script:
> > [url]http://www.rlmueller.net/CreateUsers.htm[/url]
> >
> > Problem is, it put the First Name and Last Name attribute in for all
> > the users, but the Display Name is left blank.
> >
> > I need something that will go to a specific OU and set the Display Name
> > to:
> >
> > First Name + " " + Last Name
> >
> > for each user in that OU.
> >
> > How would I do this... I'm just learning, and here's what I have so far
> > - I am trying...
> >
> > ========= CODE START =========
> >
> > Const ADS_PROPERTY_UPDATE = 2
> > Set objUser = GetObject _
> > ("LDAP://ou=Staff,dc=fabrikam,dc=com")
> >
> > objUser.Put "displayName", givenName + " " + sn
> >
> > ========== CODE END ==========
> >
> > I know, it's probably not even close, and it still has to loop through
> > all the users in the OU. Can someone please help? TIA.
> >
> >
> >
> > --
> > MooNBeaR
> > ------------------------------------------------------------------------
> > Posted via http://www.codecomments.com
> > ------------------------------------------------------------------------
> >
> >
.
- References:
- Change of set display name
- From: MooNBeaR
- RE: Change of set display name
- From: Umesh Thakur
- Change of set display name
- Prev by Date: RE: Change of set display name
- Next by Date: RE: Script to set password properties
- Previous by thread: RE: Change of set display name
- Next by thread: Last Logon Date
- Index(es):
Relevant Pages
|