I need to bulk update the “terminalservicesprofilepath” attribute for several ad user objects and append a variable + string at the end of the path. So far this is what I have, which fails miserably. Any guidance will be greatly appreciated. Happy Friday!
$users = (gc C:\Scripts\users.txt |%{get-aduser $_ })
FOREACH ($user in $users){
$profiledir = $user + ".DOMAIN.V2"
$x = [ADSI]”LDAP://$($user.DistinguishedName)”
$x.psbase.invokeset(“terminalservicesprofilepath”,”\\Fileserver\tsprofile\$profiledir”) }