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
Solved

Powershell command get-mailbox

Posted on 2013-12-04
4
3,427 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
  • 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

MS Outlook is a world-class email client application that is mainly used for e-communication globally.  In this article, we will discuss the basic idea about MS Outlook, its advanced features, and types of MS Outlook File formats.
How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

860 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