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

x
?
Solved

Powershell command get-mailbox

Posted on 2013-12-04
4
Medium Priority
?
3,878 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 2000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

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…
If you troubleshoot Outlook for clients, you may want to know a bit more about the OST file before doing your next job. IMAP can cause a lot of drama if removed in the accounts without backing up.
In this video we show how to create a Shared Mailbox 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 >> Sha…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

688 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