Exchange 2007 Get-Recipient does not return all results

mcdonamw79
mcdonamw79 used Ask the Experts™
on
I just ran into a strange issue with the Get-Recipient commandlet from Exchange 2007 SP3.  I am no PowerShell guru, but it is my understanding that by just running the command, I would get a list of all recipients in the system:

     Get-Recipient (with no parameters)

I ran Get-Recipient | Sort-Object Name | Select-Object Name,RecipientType

When I look at the resulting list, I noticed some users were not on that list.

If I add some parameters to the Get-Recipient command to specifically look for that user, they show up.  For example:

     Get-Recipient "lastname*" | Sort-Object Name | Select-Object Name,RecipientType

or even

     Get-Recipient * | Sort-Object Name | Select-Object Name,RecipientType

The question I have is, why aren't the users showing up by just running Get-Recipient?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Solutions Architect, Project Lead
Top Expert 2013
Commented:
Get-Recipient -ResultSize unlimited | Sort-Object Name | Select-Object Name,RecipientType

You have to use the _resultSize to unlimited as by default its for 1000

- Rancy

Author

Commented:
Thanks Rancy.  That seems to have resolved my issue.

I admit though I'm still baffled by one thing.  It would appear that when MS made the Get-Recipient commandlet, they made it perform differently when using a wildcard vs. without.

For example:

Get-Recipient -ResultSize Unlimited | Select-Object -First 10
    vs.
Get-Recipient * -ResultSize Unlimited | Select-Object -First 10

I get a completely different list of items with both of these queries!  Any idea why that is?  Of course that's out of scope for my original question, but just curious.
Manpreet SIngh KhatraSolutions Architect, Project Lead
Top Expert 2013

Commented:
Sir sorry i dont have a Lab or server access over weekend .... but leave me a message and will try to check and share my feedback if i can get why :)

- Rancy

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial