+ Post New Thread
Results 1 to 4 of 4
Scripts Thread, Active Directory User scripting from MIS data without CNs in Coding and Web Development; The new DS* commands in Windows 2003 (DSAdd, DSMod etc) are great by they rely on referring to users by ...
  1. #1

    Join Date
    Feb 2006
    Posts
    1,187
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Active Directory User scripting from MIS data without CNs

    The new DS* commands in Windows 2003 (DSAdd, DSMod etc) are great by they rely on referring to users by common names (CNs). I guess it's because users are just one other AD object type.

    My problem is that I like to operate on users wherever OU they are rather than specifying the full CN. For students I can normally derive the username from MIS data but CNs are suceptible to changes in spelling or movements in teaching/tutor groups.

    Any ideas? Should I DSQuery to get the CNs then match to the username field and then peform the DSMod with CN?

  2. #2
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    4,999
    Thank Post
    120
    Thanked 280 Times in 258 Posts
    Rep Power
    106

    Re: Active Directory User scripting from MIS data without CN

    Using ADSI scripting you can pull an object from AD with two methods using the LDAP provider or the WinNT.

    With the LDAP you have to specify the full CN eg

    Code:
    GetObject("LDAP://cn=blah,cn=blah")
    But with the WinNT you can use a simpler format eg:

    Code:
    Set ObjUser = GetObject("WinNT://yourdomain/username","user")

  3. #3

    Join Date
    Feb 2006
    Posts
    1,187
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Re: Active Directory User scripting from MIS data without CNs

    The WinNT provider seems good.
    Actually I was hoping to do it with just using shell commands but ADSI may be the way to go.

  4. #4
    Wiseman82's Avatar
    Join Date
    Jan 2006
    Location
    North East
    Posts
    48
    Thank Post
    3
    Thanked 14 Times in 11 Posts
    Rep Power
    21

    Re: Active Directory User scripting from MIS data without CN

    Two methods to get the DN from the Pre Windows 2000 Logon Name (sAMAccoutName):

    http://www.wisesoft.co.uk/Scripts/di...pt.aspx?id=118
    http://www.wisesoft.co.uk/Scripts/di...ipt.aspx?id=23

    Hope this helps,

    David

SHARE:
+ Post New Thread

Similar Threads

  1. Active Directory - Single and Bulk User creation and FREE!!
    By siuko in forum How do you do....it?
    Replies: 39
    Last Post: 20th June 2012, 11:29 AM
  2. Active Directory question
    By ClaireL in forum Windows
    Replies: 14
    Last Post: 19th May 2008, 12:38 PM
  3. Update Active Directory with mySQL table data?
    By netadmin in forum Windows
    Replies: 8
    Last Post: 30th October 2007, 10:43 PM
  4. PDA and Active Directory
    By localzuk in forum Windows
    Replies: 4
    Last Post: 10th October 2007, 03:54 PM
  5. Importing data to Active Directory
    By fooby in forum Wireless Networks
    Replies: 3
    Last Post: 16th February 2006, 05:08 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •