We've been migrating shares on our main file server to a DFS share to give us some flexibility with our storage. Part of these changes involve migrating Profile Paths and Terminal Server Profile Paths to the new DFS share location. After the data was being synchronised by DFS we needed a way to change the Profile Path and TS Profile Path attribute on all accounts in part of our Active Directory. This cannot be done using AD Users and Computers - if you bulk select users in ADUC and bring up the collective properties, you will notice the TS Profile Path is not available for editing. There are a few free tools that can do this, notibly ADModify.NET, but we needed a way to script it so it could be run overnight, and also only make changes to the paths if one existed already.
ChangeProfilePaths.vbs.txt
ChangeTerminalServerPaths.vbs.txt
The scripts are pretty much identical, the only bits you need to change are these lines at the top:
SMTPServer = "mail.ukstokes.ad"
Set domain = GetObject("LDAP://OU=Company Users,DC=ukstokes,DC=ad")
NewTSPath = "\\ukstokes.ad\data\profiles$\users\"
The LDAP string needs to be changed to the starting point in your AD tree. Every OU underneath will be affected.
Also these 2 lines at the bottom:
objEmail.From = "ben@------.ad" objEmail.To = "ben@------.ad"
The script will send an email at the end with a summary of the changes so you will need to change the From and To addresses accordingly.
Before making any mass changes like remember the golden rule to test it in an isolated environment first.

