Solved

Exchange 2007 - Powershell command get-mailbox

Posted on 2014-10-27
3
131 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

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

This article explains how to install and use the NTBackup utility that comes with Windows Server.
Check out this step-by-step guide for using the newly updated Experts Exchange mobile app—released on May 30.
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

734 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