Solved

Exchange 2007 - Powershell command get-mailbox

Posted on 2014-10-27
3
115 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
ID: 40406713
Hi,

Please try the following.

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

Author Comment

by:dgswin
ID: 40406777
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
ID: 40406809
Sorry, its'works!

Thank you!
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
Read this checklist to learn more about the 15 things you should never include in an email signature.
In this video we show how to create an Accepted Domain 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 Mail Flow >> Ac…
This video discusses moving either the default database or any database to a new volume.

776 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