[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Need a script for adding Proxy email address @domain.onmicrosoft.com for group of users

Posted on 2013-11-20
2
Medium Priority
?
802 Views
Last Modified: 2013-11-21
Need a script for adding Proxy email address @domain.onmicrosoft.com for group of users.
Please help. Would be great if it can read excel file and then make sure that if the address domain.onmicroft.com is not there, then add it.

THank you very much.
0
Comment
Question by:claudiamcse
[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 Comments
 
LVL 19

Accepted Solution

by:
suriyaehnop earned 2000 total points
ID: 39663937
Try this:

$Users = Import-Csv C:\PS\Users.csv

Foreach ($User in $Users){

   $ProxyAddresses = (Get-Mailbox $user.alias).emailaddresses
   Foreach ($address in $ProxyAddresses) {
        If (($Address.PrefixString -eq "smtp") -and ($address.AddressString.split("@")[1] `
        -eq "contoso.com")) {
              $ProxyAddresses += $Address
        }
   }
   Set-Mailbox $user.alias -EmailAddresses $ProxyAddresses -EmailAddressPolicyEnabled:$false
   Set-Mailbox $user.alias -EmailAddressPolicyEnabled:$false
}
}

Open in new window

0
 

Author Closing Comment

by:claudiamcse
ID: 39666775
Great! Thank you
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

As much as Microsoft wants to kill off PST file support, just as they tried to do with public folders, there are still times when it is useful or downright necessary to export Exchange mailboxes to PST files. Thankfully, it is still possible to e…
With so many activities to perform, Exchange administrators are always busy in organizations. If everything, including Exchange Servers, Outlook clients, and Office 365 accounts work without any issues, they can sit and relax. But unfortunately, it…
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 demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…
Suggested Courses

656 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