Set user profile path

If you store profiles on the network then the user needs to know how to find their profile when they login. Setting the user profile path is similar to the other attributes on the profile tab

$ou = "OU=BlogTests,DC=Manticore,DC=org"            
$name = "UserA"            
Get-ADUser -Identity $name |            
Set-ADUser -ProfilePath "\\pserver\allprofiles"            
"`nAD provider"            
$name = "UserB"            
$dn = "cn=$name,$ou"            
Set-ItemProperty -Path AD:\$dn  -Name profilePath -Value "\\pserver\allprofiles" -Force            
$name = "UserC"            
Get-QADUser -Identity $name |            
Set-QADUser -ProfilePath "\\pserver\allprofiles"            
$name = "UserD"            
$dn = "cn=$name,$ou"            
$user = [adsi]"LDAP://$dn"            
$user.profilepath = "\\pserver\allprofiles"            

The cmdlets use a parameter called –ProfilePath while the provider and script access an attribute called profilepath.  The UNC path is supplied as a string.

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>