Announcement

Collapse
No announcement yet.

Scripting some Public Folder Commands

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Scripting some Public Folder Commands

    Hi everyone,
    I need some help with creating a powershell script. I don't know if i should post my request here, or over in the scripting area. Since it is for Exchange, i will start here and see what happens.

    We are in the final stages of migrating from Exchange 2003 to Exchange 2007. Using utilities from Microsoft, we are syncing the data between the two Exchange servers (They are in different AD forests). Now that we have finished the user migrations, we need to setup the public folders to actually accept mail from the outside world so we can change our MX record, and get off this Exchange 2003 server. I have a list of all the existing public folders on the Exchange 2003 server, and their associated email addresses. All of these folders also exist on the Exchange 2007 server. I have also found the commands that i need to run to mail enable the public folders, hide them from the address book, remove the default email address policy, and add the new email address that is needed for each folder.

    My question, how do i get all of these scripts to read the information from a text file or other file so i don't have to create 400 scripts, three times.

    Here are the commands that i would be using. Any assistance would be greatly appreciated.

    Code:
    Enable-MailPublicFolder -Identity "\Legal\Pending" -HiddenFromAddressListsEnabled $True
    Code:
    Set-MailPublicFolder -Identity "\Legal\Pending" -EmailAddressEnabled $False
    Code:
    Set-MailPublicFolder -Identity "\Legal" -PrimarySmtpAddress [email protected]
    app

  • #2
    Re: Scripting some Public Folder Commands

    Originally posted by apperrault View Post
    My question, how do i get all of these scripts to read the information from a text file or other file so i don't have to create 400 scripts, three times.
    For the text file, you can try a comma-separated values file, where the first line is the header row [e.g. PFName, email].
    And use the Import-Csv cmdlet to take values from the list.
    sample:
    Code:
    $data = import-csv c:\ps\mepf.csv
    foreach ($row in $data)
    {
      write-host $row.PFName $row.email
    }
    \Rems

    This posting is provided "AS IS" with no warranties, and confers no rights.

    __________________

    ** Remember to give credit where credit's due **
    and leave Reputation Points for meaningful posts

    Comment


    • #3
      Re: Scripting some Public Folder Commands

      Thanks Rems, along with your recommendations and someone here at the office, that i didnt know knew PowerShell, we got this working.

      Thanks again

      app

      Comment


      • #4
        Re: Scripting some Public Folder Commands

        I can't wait to see it...

        Glad you got it sorted app.

        \Rems
        Last edited by Rems; 7th September 2008, 22:19. Reason: typo

        This posting is provided "AS IS" with no warranties, and confers no rights.

        __________________

        ** Remember to give credit where credit's due **
        and leave Reputation Points for meaningful posts

        Comment

        Working...
        X