Código resultante para criar e conectar a unidade inicial ao usuário com
$HomeDir = "<Path>"
$Sam = "<User's Sam Account Name>"
$User = Get-QADUser -SamAccountName "$Sam"
New-Item -Path $HomeDir -Name $Sam -ItemType Directory
$UserDir = "$HomeDir\$Sam"
$Rights = [System.Security.AccessControl.FileSystemRights]::FullControl
$Inherit=[System.Security.AccessControl.InheritanceFlags]::ContainerInherit -bor [System.Security.AccessControl.InheritanceFlags]::ObjectInherit
$Propogation=[System.Security.AccessControl.PropagationFlags]::None
$Access=[System.Security.AccessControl.AccessControlType]::Allow
$AccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule("$Sam",$Rights,$Inherit,$Propogation,$Access)
$ACL = Get-Acl $UserDir
$ACL.AddAccessRule($AccessRule)
Set-Acl $UserDir $ACL
Set-QADUser -Identity $User -HomeDirectory "$UserDir" -HomeDrive "Z:"