Solved

Exchange 2007 - Powershell command get-mailbox

Posted on 2014-10-27
3
109 Views
Last Modified: 2014-10-27
I use this command :
Get-Mailbox -ResultSize "unlimited" | Where {$_.CustomAttribute3 -Like "Aménagement durable des forêts"} | Get-MailboxStatistics | ft DisplayName,@{ expression={$_.TotalItemSize.Value.ToKB()}},ItemCount | Out-File c:\DGADF.txt

But I want to add $_.CustomAttribute1 in the command,
$_.CustomAttribute1 -like "Forêt" and $_.CustomAttribute3 -Like "Aménagement durable des forêts"

What is the synthax?
0
Comment
Question by:dgswin
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
SreRaj earned 500 total points
Comment Utility
Hi,

Please try the following.

$_.CustomAttribute1 -like "Forêt" -and $_.CustomAttribute3 -Like "Aménagement durable des forêts"
0
 

Author Comment

by:dgswin
Comment Utility
I try this :
Get-Mailbox -ResultSize "unlimited" | Where {$_.CustomAttribute10 -Like "Forêts, de la Faune et des Parcs" and $_.CustomAttribute1 -Like "Bureau sous-ministre"} | Get-MailboxStatistics | ft DisplayName,@{ expression={$_.TotalItemSize.Value.ToKB()}},ItemCount | Out-File c:\MFFP_BSM.txt

But the result is :
Unexpected token 'and' in expression or statement.
At line:1 char:111
+ Get-Mailbox -ResultSize "unlimited" | Where {$_.CustomAttribute10 -Like "Forêts, de la Faune et des Parcs" and  <<<< $_.CustomAttribute1 -Like "Bur
eau sous-ministre"} | Get-MailboxStatistics | ft DisplayName,@{ expression={$_.TotalItemSize.Value.ToKB()}},ItemCount | Out-File c:\MFFP_BSM.txt
0
 

Author Comment

by:dgswin
Comment Utility
Sorry, its'works!

Thank you!
0

Featured Post

Want to promote your upcoming event?

Are you going to an event? Are you going to be exhibiting at a tradeshow? Talking at a conference? Using a promotional banner in your email signature ensures that your organization’s most important contacts stay in the know and can potentially spread the word about the event.

Join & Write a Comment

Suggested Solutions

Easy CSR creation in Exchange 2007,2010 and 2013
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this video we show how to create a Contact in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Contact ta…
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now