Register
: :
Login
Home
News
Forums
Scripts
User Groups
Resources
About
Forums
Search
Members
Unanswered
Active Topics
Forums
>
PowerShell Development
>
Cmdlet Development
How to remove smtp address in mailcontact
Last Post 19 May 2010 10:41 PM by
ismail aksu
. 1 Replies.
Sort:
Oldest First
Most Recent First
Prev
Next
You are not authorized to post a reply.
Author
Messages
ismail aksu
New Member
Posts:8
18 May 2010 02:08 AM
Hi
How to remove smtp address in mailcontact on powershell with OU
Thanks already
ismail aksu
New Member
Posts:8
19 May 2010 10:41 PM
Get-MailContact -Filter {EmailAddresses -like "*@contoso.com" -and name -notlike "ExchangeUM*"} -ResultSize unlimited -IgnoreDefaultScope | foreach {$contact = $_; $email = $contact.emailaddresses; $email | foreach {if ($_.smtpaddress -like "*@contoso.com") {$address = $_.smtpaddress; write-host "Removing address" $address "from Contact" $contact.name; $contact.emailaddresses -= $address; $contact | set-mailcontact -emailaddresspolicyenabled $false} }}
You are not authorized to post a reply.
Using PowerShell
--General PowerShell
--Books, Tools, and Videos
--Exchange Server
--Active Directory
--System Center Family
--Non-Microsoft Products
--SharePoint
--SQL Server
--Working with .NET
--Peer Review
--Testing, Testing...
PowerShell Development
--Cmdlet Development
--PSDrive Provider Development
--Hosting the Shell
Looking Ahead
--Using PowerShell v2.0
--Developing for PowerShell v2.0
PowerShellCommunity.org
--Community Announcements and Assistance
--Completely Unrelated
--User Groups
--Community Business
----Suggestion Box
Forums
>
PowerShell Development
>
Cmdlet Development
Active Forums 4.3
Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2