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.

This entry was posted in PowerShell and Active Directory. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s