+ Post New Thread
Results 1 to 2 of 2
Windows Server 2008 R2 Thread, Bulk Change Staff Usernames / Home Folder Names in Technical; Hello all, Over Christmas we plan to change all staff usernames in AD from firstname.lastname to firstinital.lastname - currently we ...
  1. #1

    Join Date
    Feb 2010
    Location
    Hertfordshire, UK
    Posts
    44
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Bulk Change Staff Usernames / Home Folder Names

    Hello all,
    Over Christmas we plan to change all staff usernames in AD from firstname.lastname to firstinital.lastname - currently we have a system in place that automatically creates a homefolder on the fileserver which is names as the same as the username and shared as username$

    If I change all the staff usernames, the connection with their homefolders will all be lost. Does anyone know of a way / script etc that will assist me in not only bulk changing the usernames but also bulk changing the home folder names and also the share names of those homefolders?

    Thank you in advance!

    ---Example User---
    OU= Staff > Science
    Username = j.bloggs
    Homefolder name = j.bloggs
    Sharepath = \\fileserver\j.bloggs$
    Homefolder physical location = fileserver\d$\Users\Staff\Science\j.bloggs
    --------------------------

  2. #2

    dhicks's Avatar
    Join Date
    Aug 2005
    Location
    Knightsbridge
    Posts
    5,656
    Thank Post
    1,260
    Thanked 783 Times in 680 Posts
    Rep Power
    236
    Quote Originally Posted by napsburypark View Post
    Does anyone know of a way / script etc that will assist me in not only bulk changing the usernames but also bulk changing the home folder names and also the share names of those homefolders?
    We did something similar - I cludged together the following VBS script to create a folder for each user, set permissions for it and set it as their home folder:

    Code:
    Option Explicit
    Dim objShell
    
    Set objShell = CreateObject("Wscript.Shell")
    
    Sub listUsers(strOU)
    	Dim oOu, oUser
    
    	set oOU = GetObject(strOU)
    	For Each oUser in oOU
    		' Create folders.
    		objShell.Run "cmd /c mkdir \\server\home\" & LCase(oUser.Get("samAccountName")), 1, true
    
    		' Set permissions on folders.
    		objShell.Run "cacls \\server\home\" & LCase(oUser.Get("samAccountName")) & " /e /t /p " & LCase(oUser.Get("samAccountName")) & ":f", 1, true
    
    		' Set new home folders.
    		oUser.Put "homeDirectory", "\\server\home\" & LCase(oUser.Get("samAccountName"))
    		oUser.Put "homeDrive", "Z:"
    		oUser.SetInfo
    	Next
    End Sub
    
    call listUsers("LDAP://OU=Teachers,OU=SchoolUsers,DC=MyDomain,DC=local")
    call listUsers("LDAP://OU=Admin,OU=SchoolUsers,DC=MyDomain,DC=local")
    Please only treat the above as a starting point for your own script - add or change appropriate commands to move folders sintead of creating, set other attributes, etc.

SHARE:
+ Post New Thread

Similar Threads

  1. staff laptop home folder not synchronizing
    By edutech4schools in forum Windows Server 2000/2003
    Replies: 2
    Last Post: 30th May 2012, 01:09 PM
  2. change ownership of home folders in bulk
    By jdibsdale in forum Windows
    Replies: 9
    Last Post: 31st March 2010, 04:13 PM
  3. Moving Staff Home Folders
    By linkazoid in forum Windows
    Replies: 21
    Last Post: 7th August 2008, 01:49 PM
  4. Replies: 2
    Last Post: 1st August 2007, 10:59 AM
  5. Need to carry out bulk home folder move to another drive
    By projector1 in forum How do you do....it?
    Replies: 4
    Last Post: 22nd January 2007, 07:50 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
  •