문제

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.

도움이 되었습니까?

해결책

$objADSI.Delete($strCLass,$StrName)

다른 팁

Can you use the Powershell ActiveDirectory module?

If you can, then it's as simple as Remove-ADGroup

http://technet.microsoft.com/en-us/library/ee617228.aspx

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top