Home folders using local path

On the profile tab there are two options for setting the home folder.  We have already seen the “Connect” option where we supply a drive letter and UNC path.


The alternative is to use the Local path option where we supply a full path including drive letter


$ou = "OU=BlogTests,DC=Manticore,DC=org"            
$name = "UserA1"            
Get-ADUser -Identity $name |            
Set-ADUser -HomeDirectory "C:\home\$name"             
"`nAD provider"            
$name = "UserB1"            
$dn = "cn=$name,ou=OUP,$ou"            
Set-ItemProperty -Path AD:\$dn  -Name homeDirectory -Value "C:\home\$name"   -Force            
$name = "UserC1"            
Get-QADUser -Identity $name |            
Set-QADUser -HomeDirectory "C:\home\$name"             
$name = "UserD1"            
$dn = "cn=$name,ou=OUS,$ou"            
$user = [adsi]"LDAP://$dn"            
$user.homeDirectory = "C:\home\$name"             


In this case we just set the home directory as shown and ignore the homedrive attribute. As before the folder and permissions need to be assigned separately

Even if we use the local path option we can use


to discover the home drive locations

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:

WordPress.com Logo

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s