MilesLogan
asked on
Powershell - How to remove confirmation window from script
Hi EE
I have the script below that removes the users from the listed groups .. but it is prompting me to confirm for each user .. how can I remove that ? or any way to make this better ?
I basically need to remove a set of users from the groups in groups.tst
Foreach ($User in GC e:\Projects\Groups\Users2. txt){
GC e:\Projects\groups\groups2 .txt | % {
Remove-ADGroupmember -identity $_ -member $User
}
}
I have the script below that removes the users from the listed groups .. but it is prompting me to confirm for each user .. how can I remove that ? or any way to make this better ?
I basically need to remove a set of users from the groups in groups.tst
Foreach ($User in GC e:\Projects\Groups\Users2.
GC e:\Projects\groups\groups2
Remove-ADGroupmember -identity $_ -member $User
}
}
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER