作成 2010.01.07
更新 2010.01.07
更新 2010.01.07
VBScript で Active Directory グループの削除
このサンプルでは ADSI を使用してグループを削除します。指定したOUがなければ実行エラーになります。
参考
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | 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