+ Post New Thread
Results 1 to 3 of 3
Windows Server 2008 Thread, Changing display name to userlogon name in Technical; Hi, before all our mail accounts are created I want to change our old students in an OU 'display name' ...
  1. #1

    Theblacksheep's Avatar
    Join Date
    Feb 2008
    Location
    In a house.
    Posts
    1,964
    Thank Post
    139
    Thanked 291 Times in 211 Posts
    Rep Power
    193

    Changing display name to userlogon name

    Hi,

    before all our mail accounts are created I want to change our old students in an OU 'display name' to their 'logon name' (numbers), currently their display name is their first and second names. Is there an easy way to do automate this change?

  2. #2

    Join Date
    Oct 2006
    Location
    Guildford, Surrey
    Posts
    25
    Thank Post
    0
    Thanked 8 Times in 4 Posts
    Rep Power
    18
    A VBscript targetted at all user accounts in the OU would accomplish this quite easily:

    'Bind to the relevant OU
    Set objOU = GetObject("LDAP://ou=OUNAME,dc=DOMAINNAME")

    'Filter the OU contents into an array of users
    objOU.Filter = Array("user")

    'Read the logon name
    For Each objUser In objOU
    strDisplayName = objUser.Get("sAMAccountName")
    'Set the display name to be the same as the logon name
    objUser.Put "displayName", strDisplayName
    objUser.SetInfo
    Next

    This was written in haste - please excuse any errors. I suggest testing it on an OU with a single account first.
    No warranty is implied or given, etc, etc, etc...

  3. Thanks to taff from:

    Theblacksheep (14th September 2010)

  4. #3

    Theblacksheep's Avatar
    Join Date
    Feb 2008
    Location
    In a house.
    Posts
    1,964
    Thank Post
    139
    Thanked 291 Times in 211 Posts
    Rep Power
    193
    Thanks for that taff, I don't know much VBscript so its a very handy, thankyou.



SHARE:
+ Post New Thread

Similar Threads

  1. Why does Joomla display different in
    By pooley in forum EduGeek Joomla 1.5 Package
    Replies: 4
    Last Post: 24th March 2010, 02:35 PM
  2. Display driver?
    By leco in forum Hardware
    Replies: 0
    Last Post: 25th February 2010, 10:10 AM
  3. rokSlideshow will not display!
    By Avalon in forum EduGeek Joomla 1.5 Package
    Replies: 8
    Last Post: 19th November 2009, 07:06 PM
  4. [ASP.net] display <%=Date%> as UK not US
    By RabbieBurns in forum Web Development
    Replies: 4
    Last Post: 5th March 2009, 04:51 PM
  5. Display a message
    By FN-GM in forum Scripts
    Replies: 13
    Last Post: 15th February 2008, 11:35 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •