pzg's blog

将用户添加到两个安全组

将用户 (MyerKen) 添加到两个不同的 Active Directory 安全组:Atl-Users 和 NA-Employees。

有关在这段代码中使用的 PutEx 方法的更多信息,请单击 此处。

支持平台

Windows XP

 
Windows Server 2003

 
Windows 2000

 
Windows NT 4.0
是,需要安装 Active Directory Client Extensions
 
Windows 98
是,需要安装 Active Directory Client Extensions
 

脚本代码

Const ADS_PROPERTY_APPEND = 3

Set objGroup = GetObject _
    (“LDAP://cn=Atl-Users,cn=Users,dc=NA,dc=fabrikam,dc=com”)
objGroup.PutEx ADS_PROPERTY_APPEND, _
    “member”, Array(“cn=MyerKen,ou=Management,dc=NA,dc=fabrikam,dc=com”)
objGroup.SetInfo

Set objGroup = GetObject _
    (“LDAP://cn=NA-Employees,cn=Users,dc=NA,dc=fabrikam,dc=com”)
objGroup.PutEx ADS_PROPERTY_APPEND, _
    “member”, Array(“cn=MyerKen,ou=Management,dc=NA,dc=fabrikam,dc=com”)
objGroup.SetInfo

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注