Import-Module ActiveDirectory
$users = Get-ADUser -SearchBase "<Path to Organizational Unit" -Filter * -Properties *
ForEach ($user in $users)
{
$sam = $user. SamAccountName
Set-ADuser -Identity $sam -HomeDirectory "\\server\users$\ $sam"
}
No comments:
Post a Comment
Thank you for your comment.