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.

http://msmvps.com/blogs/richardsiddaway/archive/2012/02/29/setting-a-users-home-directory.aspx

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"            
            
"`nMicrosoft"            
$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            
            
"`nQuest"            
$name = "UserC1"            
Get-QADUser -Identity $name |            
Set-QADUser -HomeDirectory "C:\home\$name"             
            
"`nScript"            
$name = "UserD1"            
$dn = "cn=$name,ou=OUS,$ou"            
$user = [adsi]"LDAP://$dn"            
$user.homeDirectory = "C:\home\$name"             
$user.SetInfo()

 

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

http://msmvps.com/blogs/richardsiddaway/archive/2012/02/29/finding-the-users-home-drives.aspx

to discover the home drive locations

Published Fri, Mar 2 2012 19:44 by RichardSiddaway

Comments

# re: Home folders using local path

Hello,

thank you sharing this.

Can you please tell me how to unset the HomeDirectory Attribute to Local Path?

Thanks in advance

Tuesday, July 31, 2012 8:32 AM by Andreas

Leave a Comment

(required) 
(required) 
(optional)
(required) 
If you can't read this number refresh your screen
Enter the numbers above: