Facebook   Twitter    e-mail newsletter    YouTube    RSS Feed    Android App    iPhone and iPad App     BlackBerry App    


Results 1 to 2 of 2

Thread: Powershell Script

  1. #1

    Default Powershell Script

    I'm not getting much feedback in the Software subforum, maybe you guys can help?


    In Exchange 2010 I have 900+ mail contacts. Recently I migrated from Exchange 2003 and all of these contacts now need to have their SMTP address set as their primary reply, and this somehow was lost during the migration. All the required information is in each mail contact and all I have to do it open the contact, accept a prompt, and Set As Reply on the smtp address that is already there..

    This is what I have done in my powershell script which has worked on 1 user:

    Code:
    set-mailcontact -alias 'alias' -emailaddresses 'SMTP:user@company.co.za'
    My question is, how can I apply a similar script to a large amount of users that each have different Aliases and Different SMTP addresses? The aliases do not match the SMTP address, but ALL aliases start with debtors and then a number. eg debtors4921

    I figure I could run

    Code:
    -alias "debtors*" -emailaddresses 'SMTP:
    , but for the SMTP setting, how could I get the command to grab the SMTP information from within the specified alias?

    I really don't want to manually click into each of the 900+ contacts...
    Rise, in honour of Reason.

  2. #2

    Default

    it would be something like this:

    get-mailcontact | set-mailcontact -alias $_.alias -emailaddresses <how ever you build it up>

    You would pipe one command to another with the aboce, it is essentialy saying take the output from the first cmdlet and use it as the input for the second one.
    I don't have direct access to an Exchange box atm, so test it out first. If you don't come right yell again and I will VPN to an Exchange box to check for you.

Similar Threads

  1. Powershell - Need assistance!
    By hungrybeaver in forum Software
    Replies: 4
    Last Post: 01-08-2012, 12:28 PM
  2. Do you think it's worthwhile learning Powershell?
    By TheGuy in forum Network Admins
    Replies: 4
    Last Post: 21-06-2012, 01:14 PM
  3. Windows 7 Powershell
    By ph4t3 in forum Software
    Replies: 16
    Last Post: 11-11-2009, 10:57 AM
  4. PowerShell 1.0
    By theStudent in forum PC Hardware and Gadgets
    Replies: 5
    Last Post: 27-12-2007, 09:20 AM
  5. Windows Powershell released (Formerly known as Monad)
    By Crash in forum PC Hardware and Gadgets
    Replies: 1
    Last Post: 18-05-2006, 09:30 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •