kuzum
asked on
permissions on user home folders
Dear expert,
Could you please amend this script to add full ntfs permissions for home folder owner? it is a very helpful script but during home profile path change process, on the target location, it does not add the person who owns the folder with full control over his/her own folder. ( home folder owner is exist on the source location with full access)
if you do this process manually in AD, if the folder already exist on the destination, it asks you if you want to grant the person with full rights to his/her home folder and you need to confirm the warning. however, with this script, it does not do that. So, I need to add owner with permissions to their home folders please.
$HomeRoot = "\\server\share\home"
$UserList = Import-Csv -Path H:\RBG\export\users.csv -Header DisplayName
ForEach ($User in $UserList) {
If ($Account = Get-ADUser -LDAPFilter "(displayname=$($User.Disp layName))" ) {
$HomeDirectory = Join-Path -Path $HomeRoot -ChildPath $Account.SamAccountName
"Processing $($User.DisplayName) ($($Account.SamAccountName )): new home '$($HomeDirectory)'"
Set-ADuser -Identity $Account.SamAccountName -HomeDirectory $HomeDirectory -HomeDrive h
}
}
Could you please amend this script to add full ntfs permissions for home folder owner? it is a very helpful script but during home profile path change process, on the target location, it does not add the person who owns the folder with full control over his/her own folder. ( home folder owner is exist on the source location with full access)
if you do this process manually in AD, if the folder already exist on the destination, it asks you if you want to grant the person with full rights to his/her home folder and you need to confirm the warning. however, with this script, it does not do that. So, I need to add owner with permissions to their home folders please.
$HomeRoot = "\\server\share\home"
$UserList = Import-Csv -Path H:\RBG\export\users.csv -Header DisplayName
ForEach ($User in $UserList) {
If ($Account = Get-ADUser -LDAPFilter "(displayname=$($User.Disp
$HomeDirectory = Join-Path -Path $HomeRoot -ChildPath $Account.SamAccountName
"Processing $($User.DisplayName) ($($Account.SamAccountName
Set-ADuser -Identity $Account.SamAccountName -HomeDirectory $HomeDirectory -HomeDrive h
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ASKER
Hi David
do you have any idea what that is please? thanks
do you have any idea what that is please? thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi David, I tried to understand this but I am new to powershell and could not find where in script I should make this change:(
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Seemed the most fair to me
ASKER
I have the home folders restored to destination location with backup software and permissions were retained. What exactly happens is this; as the folder now already exist on the destination, script should have grant the owner with full rights or retain the permissions as it is in the destination during profile path change. If you perform this action manually it is clear to see what it misses. ( warning message)
I will check your script and come back. Thanks