We help IT Professionals succeed at work.

Update a field in AD for members of a group

danorme
danorme asked
on
393 Views
Last Modified: 2010-05-18
I need to update the web address field in AD for users that are part of a specific group.  The updated field will have the same data in it.  I do have a query that pulls the users, but now I need to know how to update each users Web Address Field....
Option Explicit
Dim strMember, strDNSDomain, strContainer
Dim objGroup, objRootDSE
Dim arrMemberOf
 
'  Bind to Active Directory' 
strContainer = "cn=NoInternetMail,cn=Users, "
Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("DefaultNamingContext")
 
'  Get the Builtin Administrators group
Set objGroup = GetObject ("LDAP://"& strContainer & strDNSDomain)
objGroup.getInfo
 
arrMemberOf = objGroup.GetEx("member")
 
' Loop = For Each .... Next 
' WScript.Echo "Members of Group " & strContainer
For Each strMember In arrMemberOf
   WScript.echo strMember
Next
 
WScript.Quit

Open in new window

Comment
Watch Question

Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Awsome.  First Try!!!!!
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.