Solved

Exchange 2007 - Powershell command get-mailbox

Posted on 2014-10-27
3
137 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Lotus Notes – formerly IBM Notes – is an email client application, while IBM Domino (earlier Lotus Domino) is an email server. The client possesses a set of features that are even more advanced as compared to that of Outlook. Likewise, IBM Domino is…
Check out this step-by-step guide for using the newly updated Experts Exchange mobile app—released on May 30.
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Suggested Courses

630 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