Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Exchange 2007 - Powershell command get-mailbox

Posted on 2014-10-27
3
Medium Priority
?
142 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 2000 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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Unified and professional email signatures help maintain a consistent company brand image to the outside world. This article shows how to create an email signature in Exchange Server 2010 using a transport rule and how to overcome native limitations …
This article will help to fix the below error for MS Exchange server 2010 I. Out Of office not working II. Certificate error "name on the security certificate is invalid or does not match the name of the site" III. Make Internal URLs and External…
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…
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …

670 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