Avatar of Mike Walker
Mike Walker
 asked on

Powershell script to list users not on a distribution list

I have an Exchange 2007 server and am needing a powershell script to look at a distribution list with nested distribution lists inside of it and then export a csv of all the mailboxes not in this distribution list.

The DL looks similar to this:
entirecompanydl
  dept 1
    dept1 directors office
    dept1 people
  dept 2
    dept2 directors office
    dept 2 people
PowershellExchange

Avatar of undefined
Last Comment
Mike Walker

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Shaun Vermaak

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Mike Walker

ASKER
Sadly Get-Recipient is not a cmdlet in Exchange 2007
Shaun Vermaak

This person is using it in Exchange 2007. Do you have SP3 CU15+ installed?
Mike Walker

ASKER
I'm running Exchange 2007 SP3 UR17
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Shaun Vermaak

Mike Walker

ASKER
I guess by default I was running it in powershell without the Exchange snapin. When I threw in:

"add-pssnapin Microsoft.Exchange.Management.PowerShell.Admin"

Everything worked.