$objADSI.Delete($strCLass,$StrName)
Delete/Remove group from AD
-
18-03-2022 - |
Vra
I am using this script to add/create a new group:
$strCLass = "Group"
$StrName = "CN=$naam"
$intGroupType = $type
$objADSI = [ADSI]"LDAP://ou=$OU,dc=myADserver,dc=local"
$objGroup = $objADSI.create($strCLass, $StrName)
$ObjGroup.put("GroupType",$intGroupType)
$objGroup.setInfo()
I can't find a way to reverse this so that i can delete group from the OU.
Oplossing
Ander wenke
Can you use the Powershell ActiveDirectory module?
If you can, then it's as simple as Remove-ADGroup
Gelisensieer onder: CC-BY-SA met toeskrywing
Nie verbonde aan StackOverflow