Created
November 24, 2016 02:54
-
-
Save at0dd/b80ea6678e44854d4fb6fff347aef8eb to your computer and use it in GitHub Desktop.
Creates and sets the Active Directory home folder for a list of users.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Creates a folder on a network drive named for the user, then sets the users AD Home Directory to that folder. | |
Import-Module ActiveDirectory | |
$Users = "John.Doe", "Jane.Doe" | |
ForEach ($User in $Users){ | |
New-Item -ItemType directory -Path "\\fileshare\Users$\$User" | |
Set-ADUser $User -HomeDrive "U:" -HomeDirectory "\\fileshare\Users$\$User" | |
} | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment