Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Re-Creating User Home Directories

Status
Not open for further replies.

baldhead

Technical User
Apr 27, 2004
111
US
We are planning on upgrading a server and demoting (windows 2003 AD) the existing server to move it to another site. When we promote the new server @ the same site where we had just demoted the old one, I want to make sure all the existing Active Directory users get their user drives correctly created within the file system of the new server(the new server will have all the same naming as the old).

Is there an easy way to script this so that it will re-apply the users's profile settings to create the directory? I know that I can manually go through each user, click the profile tab, hit a space where the home directory entry is, hit backspace, and finally hit apply. This is just a hassle.

thanks
baldhead
 
Use windows backup on the file systems so they retain the ACL's.

Reference script_center.exe available from Microsoft (contains 100's of scripts):

To modify a user profile path:

Set objUser = GetObject _
("LDAP://cn=MyerKen,ou=Management,dc=NA,dc=fabrikam,dc=com")

strCurrentProfilePath = objUser.Get("profilePath")
intStringLen = Len(strCurrentProfilePath)
intStringRemains = intStringLen - 11
strRemains = Mid(strCurrentProfilePath, 12, intStringRemains)
strNewProfilePath = "\\fabrikam" & strRemains
objUser.Put "profilePath", strNewProfilePath
objUser.SetInfo




A+/MCP/MCSE/MCDBA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top