Jump to content

Recommended Posts

Posted

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

Posted
"Users" is an OU, not a group - that could be why.

 

If I look in AD Users is a Container, not an Organisational Unit

Posted
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.

Posted

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 ?

Posted

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.

Posted

For some unknown reason, after a reboot and removing the -memberof it seams to be working fine.

 

Thanks to all for the help

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...