+ Post New Thread
Results 1 to 12 of 12
Windows Server 2012 Thread, DSADD in Technical; Hi all, can anybody see anything wrong with the following: dsadd user "cn=%1,cn=Users,dc=Room45,dc=local" -samid %1 -upn %1@room45.local -fn %2 -ln ...
  1. #1
    Grazza's Avatar
    Join Date
    Jun 2010
    Location
    Walsall
    Posts
    34
    Thank Post
    2
    Thanked 3 Times in 1 Post
    Rep Power
    9

    DSADD

    Hi all, can anybody see anything wrong with the following:

    dsadd user "cn=%1,cn=Users,dc=Room45,dc=local" -samid %1 -upn %1@room45.local -fn %2 -ln %3 -display "%2 %3" -hmdir "\\ict-svr-001\%1" -hmdrv n: -pwd "Passw0rd" -canchpwd yes -pwdneverexpires no -memberof "cn=users,dc=room45,dc=local"

    I pass it the user name and the first and last name eg ADDUSER.BAT Blogs.F Fred Blogs

    only I keep getting the following error message:

    "An attempt was made to modify an object to include an attribute that is not legal for its class."

    for the life of me I can not see whats wrong.

    Regards
    Graham

  2. #2

    tmcd35's Avatar
    Join Date
    Jul 2005
    Location
    Norfolk
    Posts
    5,620
    Thank Post
    845
    Thanked 882 Times in 731 Posts
    Blog Entries
    9
    Rep Power
    326
    EDIT: deleted as info was wrong My bad.

    But, is your domain called "Room45.local"?
    Last edited by tmcd35; 16th July 2013 at 09:13 AM.

  3. #3

    Ephelyon's Avatar
    Join Date
    Aug 2008
    Location
    Cheshire, England
    Posts
    1,656
    Thank Post
    283
    Thanked 318 Times in 192 Posts
    Rep Power
    141
    Quote Originally Posted by Grazza View Post
    -memberof "cn=users,dc=room45,dc=local"
    "Users" is an OU, not a group - that could be why.

  4. #4
    Grazza's Avatar
    Join Date
    Jun 2010
    Location
    Walsall
    Posts
    34
    Thank Post
    2
    Thanked 3 Times in 1 Post
    Rep Power
    9
    yes, thats correct Room45.local

  5. #5
    Grazza's Avatar
    Join Date
    Jun 2010
    Location
    Walsall
    Posts
    34
    Thank Post
    2
    Thanked 3 Times in 1 Post
    Rep Power
    9
    Quote Originally Posted by Ephelyon View Post
    "Users" is an OU, not a group - that could be why.
    If I look in AD Users is a Container, not an Organisational Unit

  6. #6

    Ephelyon's Avatar
    Join Date
    Aug 2008
    Location
    Cheshire, England
    Posts
    1,656
    Thank Post
    283
    Thanked 318 Times in 192 Posts
    Rep Power
    141
    Same shizzle :P But either way it's not a group so -memberof would fail.

  7. #7

    tmcd35's Avatar
    Join Date
    Jul 2005
    Location
    Norfolk
    Posts
    5,620
    Thank Post
    845
    Thanked 882 Times in 731 Posts
    Blog Entries
    9
    Rep Power
    326
    Containers/OU - same difference. I think @Ephelyon is right; -memberof should be referencing a group not a container/ou.

  8. #8
    Grazza's Avatar
    Join Date
    Jun 2010
    Location
    Walsall
    Posts
    34
    Thank Post
    2
    Thanked 3 Times in 1 Post
    Rep Power
    9
    Quote Originally Posted by tmcd35 View Post
    Containers/OU - same difference. I think @Ephelyon is right; -memberof should be referencing a group not a container/ou.
    Oh yeah, get what you mean now. I took the original script from an example and just modified it. I'll take a look after and get back to you.

  9. #9
    Grazza's Avatar
    Join Date
    Jun 2010
    Location
    Walsall
    Posts
    34
    Thank Post
    2
    Thanked 3 Times in 1 Post
    Rep Power
    9
    Right I have had a look at the server and there is a Security Group called Users and also a Container called Users!

    I have tryed DSADD USER without the member of and it seams to work fine, however the user apears in the root ROOM45.LOCAL and not the Users Container!
    I am confused as to how I would put them in the Users Container using -memberof ?

  10. #10

    Ephelyon's Avatar
    Join Date
    Aug 2008
    Location
    Cheshire, England
    Posts
    1,656
    Thank Post
    283
    Thanked 318 Times in 192 Posts
    Rep Power
    141
    You can't do it with -memberof; the "cn=%1,cn=Users,dc=Room45,dc=local" string ought to be sufficient. Can't imagine why that's not working.

    Maybe try them in an actual OU.

  11. #11

    tmcd35's Avatar
    Join Date
    Jul 2005
    Location
    Norfolk
    Posts
    5,620
    Thank Post
    845
    Thanked 882 Times in 731 Posts
    Blog Entries
    9
    Rep Power
    326
    I thought the first part:

    Code:
    dsadd user "cn=%1,cn=Users,dc=Room45,dc=local"
    should have placed them in the users container.

  12. #12
    Grazza's Avatar
    Join Date
    Jun 2010
    Location
    Walsall
    Posts
    34
    Thank Post
    2
    Thanked 3 Times in 1 Post
    Rep Power
    9
    For some unknown reason, after a reboot and removing the -memberof it seams to be working fine.

    Thanks to all for the help

SHARE:
+ Post New Thread

Similar Threads

  1. No Logon name after addding users by DSADD
    By tosca925 in forum Windows
    Replies: 8
    Last Post: 23rd May 2011, 08:31 PM
  2. quick question DSADD
    By PEO in forum How do you do....it?
    Replies: 3
    Last Post: 26th October 2007, 06:30 PM
  3. DSADD
    By disinfo in forum Windows
    Replies: 11
    Last Post: 3rd January 2007, 04:54 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
  •