October 21, 2016
Hot Topics:

ADSI for Beginners

  • November 19, 2002
  • By Sam Huggill
  • Send Email »
  • More Articles »

Below are a few simple scripts written in VB Script, which allow an administrator to create users, add users to groups, change passwords and reset passwords. The code is pretty self explanatory, but if you have any queries please use the Post Feedback Now link at the bottom of the page.

'Add a new user using ADSI and the WinNT namespaceSet adsDomain = GetObject("WinNT://MyDomain")Set adsUser = adsDomain.Create("user","shuggill")adsUser.SetInfo'Now add the user to a groupSet adsGroup = GetObject("WinNT://MyDomain/MyGroup")adsGroup.Add "WinNT://MyDomain/shuggill"'Change the user's passwordSet adsUser = GetObject("WinNT://MyDomain/shuggill")adsUser.ChangePassword "oldpassword", "newpassword"adsUser.SetInfo'Reset the user's passwordSet adsUser = GetObject("WinNT://MyDomain/shuggill")AdsUser.SetPassword "newpassword" 

Now that we have looked at the way ADSI fits together with a variety of providers and some simple scripts, lets look at the best way to store the code.

Page 3 of 5

Comment and Contribute


(Maximum characters: 1200). You have characters left.



Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

Sitemap | Contact Us

Thanks for your registration, follow us on our social networks to keep up-to-date
Rocket Fuel