+ Reply to Thread
Results 1 to 10 of 10
  1. Member
    Join Date
    Jun 2005
    Location
    New Brunswick, Canada
    Posts
    87

    Certifications
    A+, Network+
    #1

    Default Adding users with dsadd batch file

    Can someone shed some light on this issue? I'm trying to add multiple users using a batch file created in exel. I keep getting this error message "directory object not found". This is the following syntax i'm using.

    dsadd user cn=User01,ou=moncton,dc=dahouse,dc=deyoung,dc=com -upn User01@deyoung.com -display User01 -pwd Donald01 -mustchpwd yes -memberof cn=Users,ou=moncton,dc=dahouse,dc=deyoung,dc=com

    I know it has something to do with the memberof section because when I remove it I don't get any errors. I just can't figure it out and it's got me pulling my hair out and it's starting to hurt :P

    Any suggestions would be great..
    TIA
    Reply With Quote Quote  


  2. Login/register to remove this advertisement.
  3. Member
    Join Date
    Jun 2005
    Location
    New Brunswick, Canada
    Posts
    87

    Certifications
    A+, Network+
    #2
    Forgot to mention that it does add the users successfully but all the accounts are disabled. I need to select the account, right click and enable. When I remove the memberof section it adds the user account and it's already enabled.
    Reply With Quote Quote  

  4. Senior Member tonydotigr's Avatar
    Join Date
    Jul 2005
    Location
    IL
    Posts
    128

    Certifications
    B.S. Telecommunication Management, CCNA, MCSA 2003, A+, Network+, Security+
    #3
    A real quick suggestion would be encapsulating w/ quotations.

    "cn=User01,ou=moncton,dc=dahouse,dc=deyoung,dc=com"
    Reply With Quote Quote  

  5. Member
    Join Date
    Jun 2005
    Location
    New Brunswick, Canada
    Posts
    87

    Certifications
    A+, Network+
    #4
    o.k thanks. doesn't seem to fix my problem though
    Reply With Quote Quote  

  6. mikej412's caddy sprkymrk's Avatar
    Join Date
    Feb 2006
    Location
    Charleston, SC
    Posts
    4,976

    Certifications
    MCP (NT4 Server), MCSA 2000, MCSA 2003, CCNA, Security+, Network+
    #5
    Without pulling up a cmd and trying it myself, one suggestion I would have is to split your batch file into 2 parts. First the dsadd user, then a second command using dsmod to add the users to the group:

    dsmod group group_dn -addmbr member_dn
    Reply With Quote Quote  

  7. Senior Member tonydotigr's Avatar
    Join Date
    Jul 2005
    Location
    IL
    Posts
    128

    Certifications
    B.S. Telecommunication Management, CCNA, MCSA 2003, A+, Network+, Security+
    #6
    Opps.

    Try this
    -memberof ou=Users,ou=moncton,dc=dahouse,dc=deyoung,dc=com
    Reply With Quote Quote  

  8. Member
    Join Date
    Jun 2005
    Location
    New Brunswick, Canada
    Posts
    87

    Certifications
    A+, Network+
    #7
    Quote Originally Posted by tonydotigr
    Are you missing a CN=USERS here?

    cn=User01,ou=moncton,dc=dahouse,dc=deyoung,dc=com
    Is it trying to be a memberof an OU it doesn't exist in?
    I'm not sure.. I'm using a speadsheet from cbtnuggets. I just modified it with my info.. Like I said I believe it has something to do with the memberof section. As soon as a remove that it works like a charm.. It's nice in excel because you can use the autofill feature and could add hundreds of users with one batch file.. Here's the syntax from the cbtnuggets

    dsadd user cn=PhxUser01,ou=phoenix,dc=nuggetlab,dc=com -upn PhxUser01@nuggetlab.com -display PhxUser01 -pwd Nu66et$ -mustchpwd yes -memberof cn=phxusers,ou=phoenix,dc=nuggetlab,dc=com
    Reply With Quote Quote  

  9. Senior Member Vogon Poet's Avatar
    Join Date
    Jun 2006
    Location
    upstate NY
    Posts
    293

    Certifications
    A+ Net+ Security+ MCP (70-290)
    #8
    I assume you want the account enabled. You can use the -disable [yes|no] switch.
    As far as the "directory object not found," I would check to make sure my users group was in the correct OU. Also make sure it's "users" and not "user."
    Reply With Quote Quote  

  10. Member
    Join Date
    Jun 2005
    Location
    New Brunswick, Canada
    Posts
    87

    Certifications
    A+, Network+
    #9
    Quote Originally Posted by Vogon Poet
    I assume you want the account enabled. You can use the -disable [yes|no] switch.
    As far as the "directory object not found," I would check to make sure my users group was in the correct OU. Also make sure it's "users" and not "user."
    You got it Vogon Poet!! That was the problem. I didn't have a group in that OU. lol.. I didn't realise that "memberof cn=Users,ou=moncton,dc=dahouse,dc=deyoung,dc=com" was refering to a group.. I'm still new to this and learning all the time.. Thanks for the help.

    BTW: the account is enabled even without the disable [yes|no] switch
    Reply With Quote Quote  

  11. Junior Member
    Join Date
    May 2007
    Location
    London England
    Posts
    8

    Certifications
    70-210, 215,70-290 WIP 70-291
    #10
    OMG

    I had the same problem, phoenix OU. I spent days on this not working
    CBT nuggets are good but that video there so much going on you can miss thing as in the making of an ou at start of video of it was make in the video before the Automating User Account Management
    Reply With Quote Quote  

+ Reply to Thread

Social Networking & Bookmarks