Powershell to remove all members from Security group in AD
Budget: $10 – $30 USD
I can use Get-ADGroupMember -Identity "OU=OU, DC=com"
It pulls up all the Computers in that group which is what I need. I also need to remove all "PC*" & "LAP*" from this group
Can someone provide me with this as a powershell command/script?
example of what I see.
distinguishedName: OU=LAP01, blahblah
name:LAP01
objectClass: computer
objectGUID: blahblah
SamAccountName: LAP01$
SID: blahblah
distinguishedName: OU=PC100, blahblah
name:PC100
objectClass: computer
objectGUID: blahblah
SamAccountName: PC100$
SID: blahblah
It pulls up all the Computers in that group which is what I need. I also need to remove all "PC*" & "LAP*" from this group
Can someone provide me with this as a powershell command/script?
example of what I see.
distinguishedName: OU=LAP01, blahblah
name:LAP01
objectClass: computer
objectGUID: blahblah
SamAccountName: LAP01$
SID: blahblah
distinguishedName: OU=PC100, blahblah
name:PC100
objectClass: computer
objectGUID: blahblah
SamAccountName: PC100$
SID: blahblah