No problem :)

From: KevinM [mailto:kev...@wlkmmas.org]
Sent: Friday, April 02, 2010 2:47 PM
To: MS-Exchange Admin Issues
Subject: RE: All users in all DL's in an OU

That is pretty much perfect!!!! Thanks Rob...

From: Campbell, Rob [mailto:rob_campb...@centraltechnology.net]
Sent: Friday, April 02, 2010 11:55 AM
To: MS-Exchange Admin Issues
Subject: RE: All users in all DL's in an OU

Try this:

$dl_recs = @()
$groups = get-distributiongroup -organizationalunit "<ou>"
foreach ($group in $groups){
get-distributiongroupmember $group |% {
$_ | Add-Member -MemberType NoteProperty -Name "DL" -Value $group.name
$dl_recs += $_
}
}
$dl_recs | select DL,Name,RecipientType | Export-Csv dl.csv -notype

From: KevinM [mailto:kev...@wlkmmas.org]
Sent: Friday, April 02, 2010 1:42 PM
To: MS-Exchange Admin Issues
Subject: RE: All users in all DL's in an OU

Sure.., I 'm not super picky on output.. I tried export-csv bob.csv, but that 
just returned all of the attributes of all of the users like I ran get-user

From: Campbell, Rob [mailto:rob_campb...@centraltechnology.net]
Sent: Friday, April 02, 2010 11:41 AM
To: MS-Exchange Admin Issues
Subject: RE: All users in all DL's in an OU

Csv?

From: KevinM [mailto:kev...@wlkmmas.org]                                        
              CS
Sent: Friday, April 02, 2010 1:38 PM
To: MS-Exchange Admin Issues
Subject: RE: All users in all DL's in an OU

DLNAME   | User NAME |RecpientType.

From: Campbell, Rob [mailto:rob_campb...@centraltechnology.net]
Sent: Friday, April 02, 2010 11:37 AM
To: MS-Exchange Admin Issues
Subject: RE: All users in all DL's in an OU

How do you want the output to look?


From: KevinM [mailto:kev...@wlkmmas.org]
Sent: Friday, April 02, 2010 1:10 PM
To: MS-Exchange Admin Issues
Subject: All users in all DL's in an OU


I've been asked to provide a customer with a list of all of the users in all of 
their DL's. I figured this would be a simple one-liner. Get all of the DL's in 
an OU, and spit out the members. I was wrong.... Has anyone out there, who 
would be willing to share, written this script all ready?



My Guess at a one-liner
======================
Get-DistributionGroup -OrganizationalUnit"rebob/bob" | 
Get-DistributionGroupMember | out-file dl.txt


The output - missing the DL - a list of users is not helpful to me
==============================================
Name                                                                            
  RecipientType
----                                                                            
               -------------
f919e368-1878-4aa0-adf8-a83635cc3031                  MailContact
ee2ea8f6-5306-4d75-866d-33431d915d27               MailContact



**************************************************************************************************

Note:

The information contained in this message may be privileged and confidential and

protected from disclosure.  If the reader of this message is not the intended

recipient, or an employee or agent responsible for delivering this message to

the intended recipient, you are hereby notified that any dissemination,

distribution or copying of this communication is strictly prohibited. If you

have received this communication in error, please notify us immediately by

replying to the message and deleting it from your computer.

**************************************************************************************************

**************************************************************************************************

Note:

The information contained in this message may be privileged and confidential and

protected from disclosure.  If the reader of this message is not the intended

recipient, or an employee or agent responsible for delivering this message to

the intended recipient, you are hereby notified that any dissemination,

distribution or copying of this communication is strictly prohibited. If you

have received this communication in error, please notify us immediately by

replying to the message and deleting it from your computer.

**************************************************************************************************

**************************************************************************************************

Note:

The information contained in this message may be privileged and confidential and

protected from disclosure.  If the reader of this message is not the intended

recipient, or an employee or agent responsible for delivering this message to

the intended recipient, you are hereby notified that any dissemination,

distribution or copying of this communication is strictly prohibited. If you

have received this communication in error, please notify us immediately by

replying to the message and deleting it from your computer.

**************************************************************************************************
**************************************************************************************************
Note: 
The information contained in this message may be privileged and confidential 
and 
protected from disclosure.  If the reader of this message is not the intended  
recipient, or an employee or agent responsible for delivering this message to  
the intended recipient, you are hereby notified that any dissemination,   
distribution or copying of this communication is strictly prohibited. If you  
have received this communication in error, please notify us immediately by  
replying to the message and deleting it from your computer. 
**************************************************************************************************

Reply via email to