作成 2010.01.07
更新 2010.01.07
更新 2010.01.07
VBScript で Active Directory グループの削除
このサンプルでは ADSI を使用してグループを削除します。指定したOUがなければ実行エラーになります。
strContainer = ""
strName = "EzAdGroup"
'***********************************************
'* Connect to a container *
'***********************************************
Set objRootDSE = GetObject("LDAP://rootDSE")
If strContainer = "" Then
Set objContainer = GetObject("LDAP://" & _
objRootDSE.Get("defaultNamingContext"))
Else
Set objContainer = GetObject("LDAP://" & strContainer & "," & _
objRootDSE.Get("defaultNamingContext"))
End If
'***********************************************
'* End connect to a container *
'***********************************************
objContainer.Delete "group", "cn=" & strName
参考
VBScript で Active Directory グループの作成 | VBScript で Active Directory グループにメンバーを追加 | VBScript で Active Directory グループからメンバーを削除 | ADSI/IADsContainer