Active Directory Tip: How To Batch Update Remote Desktop Services Profile Path Property

It’s really easy if you need to make changes to the roaming profile path in Active Directory to multiple user accounts. All you need is to highlight them all, right-click and select Properties.

But as you can see, it doesn’t have the Remote Desktop Service Profile tab. So how do you batch update this property to a large number of users when needed?

Here is a quick example of using PowerShell to find all users that belong to a specific OU and update them with the new network path for remote desktop service profiles.

$users = Get-ADuser -Filter * -SearchBase "OU=Test, DC=Test, DC=LOCAL"
$newpath = ''

ForEach ($user in $users){
    $userinfo = [ADSI]"LDAP://$($user.DistinguishedName)"
    $userinfo.psbase.invokeset('TerminalServicesProfilePath', $newpath)
    $userinfo.setinfo()
    $user.name + ' ' + $userinfo.TerminalServicesProfilePath
}

Enjoy.

Leave a Reply

Your email address will not be published. Required fields are marked *