hello,
i found and modified the script below and was wondering if i can add more groups that i want to exlude from copying from the source user to destination user. Can you assist? Also, what editor can i use to show me the output of each line as it's executing?
Thanks
write-output "This script helps to add user to all the Groups which other user is memberof.It is can be normally used when new user needs to have all the group membership of the existing users"
write-output " "
write-output " "
$SName = Read-Host "Please Enter the alias name of the source user "
$DName = Read-Host "Please Enter the alias name of the Destination user "
$EXName = Read-Host "Please Enter the name of the group you want to exclude "
$K = Get-QADUser $SName |Select-Object -ExpandProperty MemberOf | Get-ADGroup -Properties name | Where SamAccountName -ne $EXName | Select-Object SamAccountName
foreach($user in $K.SamAccountName)
{
Add-QADGroupMember -Identity $user -Member $DName
}
i found and modified the script below and was wondering if i can add more groups that i want to exlude from copying from the source user to destination user. Can you assist? Also, what editor can i use to show me the output of each line as it's executing?
Thanks
write-output "This script helps to add user to all the Groups which other user is memberof.It is can be normally used when new user needs to have all the group membership of the existing users"
write-output " "
write-output " "
$SName = Read-Host "Please Enter the alias name of the source user "
$DName = Read-Host "Please Enter the alias name of the Destination user "
$EXName = Read-Host "Please Enter the name of the group you want to exclude "
$K = Get-QADUser $SName |Select-Object -ExpandProperty MemberOf | Get-ADGroup -Properties name | Where SamAccountName -ne $EXName | Select-Object SamAccountName
foreach($user in $K.SamAccountName)
{
Add-QADGroupMember -Identity $user -Member $DName
}