Powershell script to find all users who is not set to default storage quota. Query all users in an OU and below them.

bsharath
bsharath used Ask the Experts™
on
Hi,

Powershell script to find all users who is not set to default storage quota. Query all users in an OU and below them.
all Ou's below the root and get just user names to a file who have a different size set with Storage name and size set.

Regards
Sharath
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
PowerShell Developer
Top Expert 2010
Commented:

Exchange Management Shell, then the snippet below will work.

You need it dumping to a file? This version does.

Chris
Get-Mailbox -ResultSize Unlimited -Filter { UseDatabaseQuotaDefaults -eq $False } `
    -OrganizationalUnit "OU=somewhere,DC=domain,DC=com" |
  Select-Object Name, Database, UseDatabaseQuotaDefaults, IssueWarningQuota, `
    ProhibitSendQuota, ProhibitSendReceiveQuota |
  Export-CSV "SomeFile.csv"

Open in new window

Author

Commented:
Hi Chris

I get this

Get-Mailbox : Cannot bind parameter 'Filter' to the target. Exception setting "Filter": "Unable to cast object of type
'System.Boolean' to type 'System.String'."
At line:1 char:42
+ Get-Mailbox -ResultSize Unlimited -Filter <<<<  { UseDatabaseQuotaDefaults -eq $False } `
    + CategoryInfo          : WriteError: (:) [Get-Mailbox], ParameterBindingException
    + FullyQualifiedErrorId : ParameterBindingFailed,Microsoft.Exchange.Management.RecipientTasks.GetMailbox
Chris DentPowerShell Developer
Top Expert 2010

Commented:

I can't reproduce that error message. Which service pack do you have installed? Testing is based on PowerShell 1 and 2 with Exchange 2007 Service Pack 1 and 2 tools.

Chris

Author

Commented:
Thanks Chris i was running it on the Quest prompt
Now it works on exchange

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