I am in the process of implementing a new file server into the customers environment and updating the Remote Desktop Services profiles to point to the new file server. My customer has the remote desktop services profile specified on each user account and there are inconsistencies as to how the profile is named, it does not always match username! As a result we are not able to simply move to Group Policy roaming profile mapping moving forward.
I need a way of performing a find and replace to update the Remote Desktop Services User Profile path to match the new file server. I achieved this by writing a PowerShell script to perform this task which I would like to share with you - here is a copy of my code:
To utilise this code you want to modify the following values:
$pDirValueOld = "\\oldfileserver\share"
$pDirValueNew = \\newfileserver\share
$searcher.SearchRoot = "LDAP://OU=Users,OU=Avantgarde Technologies,OU=Companies,OU=Active Directory,DC=at,DC=local
- pDirValueOld is the value you want to search for to be replaced.
- pDirValueNew is the value you wish to set the profile to.
- $searcher.SearchRoot is the LDAP path in Active Directory you wish to run this query recursively against.
Hope you have found this post helpful!