Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Bulk updating tsprofile AD user attrib and adding variable+string to dir path?

$
0
0

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”) }


Viewing all articles
Browse latest Browse all 6937

Trending Articles