bgcpc
asked on
Export Members of all Query Based Distribution Groups
Our environment:
Active Directory 2003
Exchange 2003
I am needing to export a list of all QBDG and their members. I have been looking all over and haven't found a good way to do this.
It seems to be much easier if we were running Exchange 2007 or higher.
Any suggestions? Command line tools, powershell, etc.?
Active Directory 2003
Exchange 2003
I am needing to export a list of all QBDG and their members. I have been looking all over and haven't found a good way to do this.
It seems to be much easier if we were running Exchange 2007 or higher.
Any suggestions? Command line tools, powershell, etc.?
Another option is is using ADUC custom query,
Active Directory Users and computers > Right-Click the folder Saved Queries and select New query > Give a name >Click Define Query > From the drop down list select Custom Search> Click Advanced tab > Create a custom query by copy pasting the LDAP filter from QBDG to query the users..Right-click on your query and use Export List to save the result to .csv file..
Active Directory Users and computers > Right-Click the folder Saved Queries and select New query > Give a name >Click Define Query > From the drop down list select Custom Search> Click Advanced tab > Create a custom query by copy pasting the LDAP filter from QBDG to query the users..Right-click on your query and use Export List to save the result to .csv file..
If above comments help good if you want you can check this article as well
http://social.technet.microsoft.com/Forums/en-GB/exchangesvrgenerallegacy/thread/19c6758d-0783-4a2c-bac0-2fb2b22d68c2
https://www.experts-exchange.com/questions/22916619/Query-Based-Distribution-Group-get-all-the-members-of-the-specific-Group-to-a-file.html
- Rancy
http://social.technet.microsoft.com/Forums/en-GB/exchangesvrgenerallegacy/thread/19c6758d-0783-4a2c-bac0-2fb2b22d68c2
https://www.experts-exchange.com/questions/22916619/Query-Based-Distribution-Group-get-all-the-members-of-the-specific-Group-to-a-file.html
- Rancy
ASKER
Thanks for the info everyone. These are good suggestions for getting the members of one group.
We have hundreds and I was hoping for a scripted solution to pull all query based groups and members and dump them to a csv.
I found similiar solutions for regular groups, but not query based.
We have hundreds and I was hoping for a scripted solution to pull all query based groups and members and dump them to a csv.
I found similiar solutions for regular groups, but not query based.
If you have Quest PowerShell for Active Directory then try the following script..I have not tested the code, but I think it should work..
$Groups = Get-QADObject -LdapFilter '(objectClass=msExchDynamicDistributionList)' -IncludedProperties msExchDynamicDLFilter -SizeLimit 0
Foreach ($Group in $Groups){
$Users = Get-QADObject -LdapFilter '$($Group.msExchDynamicDLFilter)' -SizeLimit 0
Foreach ($User in $Users){
New-object PSObject -Property @{Group=$Group.Name;Member=$User.Name}
}
}
ASKER
It looks like the script is looping through and finding the groups, but outputs the following error.
Get-QADObject : Invalid filter format: '$($Group.msExchDynamicDLF ilter)'
At C:\apps\powershell\questge tdlgroups. ps1:3 char:24
+ $Users = Get-QADObject <<<< -LdapFilter '$($Group.msExchDynamicDLF ilter)' -SizeLimit 0
+ CategoryInfo : NotSpecified: (:) [Get-QADObject], LdapFilterException
+ FullyQualifiedErrorId : Quest.ActiveRoles.ArsPower ShellSnapI n.Business Logic.Ldap FilterExce ption,Ques t.ActiveRo le
s.ArsPowerShellSnapIn.Powe rshell.Cmd lets.GetGe nericObjec tCmdlet
Get-QADObject : Invalid filter format: '$($Group.msExchDynamicDLF
At C:\apps\powershell\questge
+ $Users = Get-QADObject <<<< -LdapFilter '$($Group.msExchDynamicDLF
+ CategoryInfo : NotSpecified: (:) [Get-QADObject], LdapFilterException
+ FullyQualifiedErrorId : Quest.ActiveRoles.ArsPower
s.ArsPowerShellSnapIn.Powe
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This is exactly what I needed. IT did run for about 6 hours. It might be helpful to be able to specify an OU to cut down on the run time.
But, it got me what I needed. Thanks.
But, it got me what I needed. Thanks.
You can do that by adding a SearchRoot
$Groups = Get-QADObject -SearchRoot 'company.com/TestOU' -LdapFilter '(objectClass=msExchDynamicDistributionList)' -IncludedProperties msExchDynamicDLFilter -SizeLimit 0
ASKER
OK, cool.
Thanks.
Thanks.
http://apps.fmc.com/Blog.nsf/dx/query-based-distribution-groups.htm