Q

Create a group in Active Directory and add members

I want to create a group in the AD and add some members to it using the LDIFDE tool. When I am trying to create the group and add one member, every thing works fine.

dn: CN=Adm,OU=Groups,DC=reskit,DC=com changetype: add objectClass: group samAccountName: Adm description: ADM Group member: CN=Daniel Dvir,OU=Test,DC=reskit,DC=com However, when I try to add several members at once, I get an error message. dn: CN=Adm,OU=Groups,DC=reskit,DC=com changetype: add objectClass: group samAccountName: Adm description: ADM Group member: CN=Daniel Dvir,OU=Test,DC=reskit,DC=com member: CN=Gearshon Israeli,OU=Test,DC=reskit,DC=com What am I doing wrong?

You cannot add multiple members at the same time in the same add block. You must build additional modify blocks following the initial add as follows:

dn: CN=newgroup1,CN=Users,DC=company,DC=com changetype: add cn: newgroup1 distinguishedName: CN=newgroup1,CN=Users,DC=company,DC=com instanceType: 4 name: newgroup1 objectCategory: CN=Group,CN=Schema,CN=Configuration,DC=company,DC=com objectClass: group sAMAccountName: newgroup1

dn: CN=newgroup1,CN=Users,DC=company,DC=com changetype: modify add: member member: CN=newuser3,CN=Users,DC=company,DC=com

dn: CN=newgroup1,CN=Users,DC=company,DC=com changetype: modify add: member member: CN=newuser2,CN=Users,DC=company,DC=com

dn: CN=newgroup1,CN=Users,DC=company,DC=com changetype: modify add: member member: CN=newuser1,CN=Users,DC=company,DC=com

This was first published in July 2001

Dig deeper on Microsoft Active Directory

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchServerVirtualization

SearchCloudComputing

SearchExchange

SearchSQLServer

SearchWinIT

SearchEnterpriseDesktop

SearchVirtualDesktop

Close