Hey guys,
I want to list all the members of a security group, lets say 'Group'. I then want to remove specific servers (in this case, our SCOM Management servers) from the list that gets returned (which I then later want to run a 'foreach' loop on.
I've done something like the following;
$groupMembers = Get-ADGroupMember "Group" -recursive | Select-Object Name
$scomMgmtSvrs = Get-SCOMManagementServer | Select-Object DisplayName
ForEach ($scomServer in $scomMgmtSvrs) { # Remove this entry from $groupMembers }
# So that later I can..
ForEach ($member in $groupMembers) { #Do Things }
How can I achieve this?
Thanks.