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 %firstname.lastname@example.org -fn %2 -ln ...
16th July 2013, 09:57 AM #1
Hi all, can anybody see anything wrong with the following:
dsadd user "cn=%1,cn=Users,dc=Room45,dc=local" -samid %1 -upn %email@example.com -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.
IDG Tech News
16th July 2013, 10:07 AM #2
EDIT: deleted as info was wrong My bad.
But, is your domain called "Room45.local"?
Last edited by tmcd35; 16th July 2013 at 10:13 AM.
16th July 2013, 10:15 AM #3
"Users" is an OU, not a group - that could be why.
Originally Posted by Grazza
16th July 2013, 10:16 AM #4
yes, thats correct Room45.local
16th July 2013, 10:17 AM #5
If I look in AD Users is a Container, not an Organisational Unit
Originally Posted by Ephelyon
16th July 2013, 10:19 AM #6
Same shizzle :P But either way it's not a group so -memberof would fail.
16th July 2013, 10:19 AM #7
Containers/OU - same difference. I think @Ephelyon is right; -memberof should be referencing a group not a container/ou.
16th July 2013, 10:23 AM #8
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.
Originally Posted by tmcd35
17th July 2013, 12:07 PM #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 ?
17th July 2013, 12:13 PM #10
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.
17th July 2013, 12:14 PM #11
I thought the first part:
should have placed them in the users container.
dsadd user "cn=%1,cn=Users,dc=Room45,dc=local"
17th July 2013, 04:09 PM #12
For some unknown reason, after a reboot and removing the -memberof it seams to be working fine.
Thanks to all for the help
By tosca925 in forum Windows
Last Post: 23rd May 2011, 09:31 PM
By PEO in forum How do you do....it?
Last Post: 26th October 2007, 07:30 PM
By disinfo in forum Windows
Last Post: 3rd January 2007, 05:54 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)