Solved

Powershell command get-mailbox

Posted on 2013-12-04
4
3,553 Views
Last Modified: 2013-12-05
I use this command :

Get-Mailbox -ResultSize "unlimited" -Filter 'customattribute2 -eq "00" -and customattribute1 -eq "Test"' | Set-Mailbox -CustomAttribute2 "01"

And it'work well. But, I want to add "City" in my request:

Get-Mailbox -ResultSize "unlimited" -Filter 'customattribute2 -eq "01" -and customattribute1 -eq "Test" -and city -eq "Quebec"' | Set-Mailbox -CustomAttribute2 "00"

But I have a error:
Get-Mailbox : Cannot bind parameter 'Filter' to the target. Exception setting "Filter": ""city" is not a recognized filterable property.

What is the command powershell if I want add th city?
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
4 Comments
 
LVL 5

Expert Comment

by:jboddy
ID: 39696906
I do not think "City" is a mailbox attribute, is it part of the ADUSER.
Unless it has been set as a custom attribute?
0
 
LVL 1

Accepted Solution

by:
atuldolasj earned 500 total points
ID: 39696907
Hi dgswin,

The cmdlet "Get-Mailbox" does not accept the property "City" for the -Filter parameter. The following cmdlets accepts the property "City"

Get-Contact
Get-Recipient
Get-User

Please check the article:
http://technet.microsoft.com/en-us/library/bb738155(v=exchg.150).aspx

Regards,
Atul
0
 
LVL 5

Expert Comment

by:jboddy
ID: 39696913
A sample script that can be edited to do this is here:
http://social.technet.microsoft.com/Forums/exchange/en-US/af39f4c3-a0c4-40d5-835a-0bcb856ff0a6/powershell-assistance-to-include-getmailbox-and-getmailboxstatics

It gets the size of mailboxes and certain attributes from the AD, just edit out the ones you do not want.
0
 

Author Closing Comment

by:dgswin
ID: 39699101
My command works with Get-Recipient.

Thank you.
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
A list of top three free exchange EDB viewers that helps the user to extract a mailbox from an unmounted .edb file and get a clear preview of all emails & other items with just a single click on mailboxes.
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 …
To show how to create a transport rule 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 >> Rules tab.:  To cr…

739 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