Add user to DNS Admins (VBScript)

This code can be found in Chapter 12 of Windows Server 2003 Security Cookbook

Purchase XP Cookbook or Networking Recipes for only $25 plus shipping! While supplies last.

Find out how to download all of the VBScript code from this site.

Const ADS_PROPERTY_APPEND = 3  
Set objGroup = GetObject("LDAP://cn=DNSAdmins,cn=Users,dc=test,dc=local,dc=com") 
objGroup.PutEx ADS_PROPERTY_APPEND, "member", _ 
    Array("cn=Bob Smith,cn=Users,dc=test,dc=local,dc=com") 
objGroup.SetInfo
WScript.Echo "User added to DNS Admins group"

This code has been viewed 1065 times.

New from the creators of TechTasks.com: StatSheet.com