I tried to create user using New-QADUser cmdlet. I know this cmdlet has -HomeDrive switch. But the problem is that cmdlet is just applying path string to user's account and not creating user's home directory on the fileserver like it happens when you use ADUC console. How can I do it corerctly?
Powershell – How to connect Home Folder using PowerShell
active-directorypowershell
Related Topic
- Powershell – Get user home directories recursively in PowerShell
- Powershell – How to give a user NTFS rights to a folder, via Powershell
- Set owner of new users home folder to user instead of BUILTIN\Administrators when using ADUC (on Windows Server 2008 R2)
- Powershell – Creating active directory users with powershell – the mapped home folder is not mapping until edited
- Creating & mapping user home folders on a network share using GPO
- Windows – using powershell to update system path doesn’t immediately work
- Active Directory – New Custom Home Directory Path Not Recognized
- Powershell – Modify new user home directory permissions with powershell
Best Answer
Does the script that is creating the user account have administrative access to the file server as well?
Why not let the script create the home drive? very simple example:
The only gotcha here is then setting the ACLs on the folder, that could possibly be done with set-acl. A bit more info on ACLS here..
http://chrisfederico.wordpress.com/2008/02/01/setting-acl-on-a-file-or-directory-in-powershell/
The nice thing about scripting it in this way is being able to then output what it is doing to a log file for script auditing purposes. Of course, it doesn't necessarily give you the 1-step nicety the MMC console does.