This topic contains 2 replies, has 2 voices, and was last updated by
December 18, 2015 at 8:38 pm #33148ParticipantTopics: 5Replies: 12Points: 0Rank: Member
I am trying to export the email ID's from security group with the below command:
Command :dsget.exe group "CN=Test Team,CN=Users,DC=ABC,DC=testbed,DC=com" -members| dsget user -email
The above command works out well but only when the security group contains domain ID's with exchange mailboxes.
Now if I use the same command to export the email ID's of security group which contains mail contact; it gives me the the below error:
dsget failed:CN=Test User,CN=Users,DC=ABC,DC=testbed,DC=com:The object class of the target does not match the one specified on the command line.
dsget user is looking for domain user and not the mail contact hence the above error.
Command : I tried another command get-adgroupmember -identity "Test Team" but since the group contains more than 10,000 objects (domain ID and mail contact) it returned me
the below error message:
Get-ADGroupMember : The size limit for this request was exceeded
To summarize, I just need a command to pull out the email ID's from security group which contains domain users alongwith the contacts.
I am running these commands in test environment before running them on production environment.
Let me know if any more details are needed.
December 19, 2015 at 3:04 am #33151ParticipantTopics: 1Replies: 284Points: 41Rank: Member
From testing here, I don't think get
Get-ADGroupMemberwill work either. That command only returns groups, users and computers, and a contact object is a separate class of object. Try the
Get-ADObjectcommand with an LDAP filter on the group's DN. You can use the
ResultSetSizeparameter to ensure all objects are returned.
Get-ADobject -LDAPFilter '(memberOf=CN=Test Team,CN=Users,DC=Contoso,DC=Com)' -ResultSetSize $null -Property mail | Select-Object mail
December 19, 2015 at 7:47 am #33152ParticipantTopics: 5Replies: 12Points: 0Rank: Member
Perfect Matt !!!!!
Thanks a lot.
The topic ‘Unable to export mail ID's from security group’ is closed to new replies.