Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Create the home folder
- $HomeFolderMasterDir='\\server\home\'
- new-item -path $HomeFolderMasterDir -name $Account -type directory
- #Puts \\server\home\%username% into a variable
- $FolderName=$HomeFolderMasterDir+$Account
- $DomainUser='contoso\'+$Account
- #Set the NTFS permissions on the home folder
- $ACL=get-acl $FolderName
- $Ar = new-object system.security.accesscontrol.filesystemaccessrule($DomainUser, "FullControl","ContainerInherit, ObjectInherit", "None", "Allow")
- $ACL.AddAccessRule($Ar)
Advertisement
Add Comment
Please, Sign In to add comment