Grazza Posted July 16, 2013 Posted July 16, 2013 Hi all, can anybody see anything wrong with the following: dsadd user "cn=%1,cn=Users,dc=Room45,dc=local" -samid %1 -upn %[email protected] -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
tmcd35 Posted July 16, 2013 Posted July 16, 2013 (edited) EDIT: deleted as info was wrong My bad. But, is your domain called "Room45.local"? Edited July 16, 2013 by tmcd35
Ephelyon Posted July 16, 2013 Posted July 16, 2013 -memberof "cn=users,dc=room45,dc=local" "Users" is an OU, not a group - that could be why.
Grazza Posted July 16, 2013 Author Posted July 16, 2013 "Users" is an OU, not a group - that could be why. If I look in AD Users is a Container, not an Organisational Unit
Ephelyon Posted July 16, 2013 Posted July 16, 2013 Same shizzle But either way it's not a group so -memberof would fail.
tmcd35 Posted July 16, 2013 Posted July 16, 2013 Containers/OU - same difference. I think @Ephelyon is right; -memberof should be referencing a group not a container/ou.
Grazza Posted July 16, 2013 Author Posted July 16, 2013 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.
Grazza Posted July 17, 2013 Author Posted July 17, 2013 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 ?
Ephelyon Posted July 17, 2013 Posted July 17, 2013 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.
tmcd35 Posted July 17, 2013 Posted July 17, 2013 I thought the first part: dsadd user "cn=%1,cn=Users,dc=Room45,dc=local" should have placed them in the users container.
Grazza Posted July 17, 2013 Author Posted July 17, 2013 For some unknown reason, after a reboot and removing the -memberof it seams to be working fine. Thanks to all for the help
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now