Solved

Powershell command get-mailbox

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Local Continuous Replication is a cost effective and quick way of backing up Exchange server data. The following article describes the steps required to configure Local Continuous Replication. Also, the article tells you how to restore from a backup…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this video we show how to create an email address policy 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…
In this video we show how to create a mailbox database 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 Servers >> Data…

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now