none
Mail enabling multiple existing contacts

Answers

  • I forgot you had over a 1000 to sort through.  Here is the modified script:

    Get-Contact -OrganizationalUnit "usdecnmpf.org" -resultsize unlimited | foreach {
    Enable-MailContact $_ -externalEmailAddress $_.windowsEmailAddress.toString()
    start-sleep -s 5
    }

    As for the errors, it seems that there are objects in the OU is not a contact.  What other objects are in that OU?


    JAUCG

    Tuesday, February 28, 2012 7:19 PM

All replies

  • What exactly did the tool do?  Did it create objects in AD that you can manipulate?  Assuming so, are they all in one OU in AD?  If that is the case, you could create a script to read those objects in and mail-enable them that way.  Which tool was used to import these from the other AD?


    JAUCG

    Thursday, February 23, 2012 12:46 PM
  • This is the tool I used and yes objects are created that can be manipulated.

    http://www.activedirectoryexport.com/

    I'm not familiar with creating scripts to mail enable them, please provide information on how to.

    Thanks...

    Thursday, February 23, 2012 1:47 PM
  •  MS article you mentioned looks good, however, of the export tool worked well, there might be an associated email address listed in one of its properties.  Try this command

        get-contact |fl

    and see if any of the fields are populated with an email address.  So you do not get results from 1800 users from this command, you can query a couple objects as a sample using this modified command:

        get-contact <contact name> |fl

    If there is an attribute that has the address in it, post it here and we can make a script that will work.


    JAUCG

    Thursday, February 23, 2012 7:43 PM
  • Thanks for your reply.  All imported Contacts do have an email address on the General tab - 'Email' field.

    When I just run get-contact from the EMS, indeed it lists 1000 Contacts & also stating I need to change parameters to view all 1800.

    But when I run get-contact \fl - I receive various errors.  Please see attached JPG screenshot.

    Thanks...

    Thursday, February 23, 2012 8:27 PM
  • Wrong symbol.  You need to use |fl and not \fl.

    JAUCG

    Friday, February 24, 2012 1:59 AM
  • Hi xmr25

    Any update? Did you use Pipe symbol " | " instead of " \ " as what JAUCG said?

    Cheers

    Zi Feng


    Zi Feng

    TechNet Community Support

    Friday, February 24, 2012 6:08 AM
  • Thanks to both for the clarification.  I think this is the screenshot info needed to create the script to enable all mail Contacts:

    Friday, February 24, 2012 8:16 PM
  • Well it looks like the user does indeed have a WindowsEmailAddress value which we can then use to mail enable the contact with. from this source (http://www.vistax64.com/powershell/182654-exchange-powershell-one-liner-mail-enable-contacts.html) you want to run syntaxt similar to:

    Get-Contact -OrganizationalUnit <org unit where contacts are> | foreach {
    Enable-MailContact $_ -externalEmailAddress $_.windowsEmailAddress.toString()
    }

    See if that works.


    JAUCG

    Friday, February 24, 2012 9:43 PM
  • Thanks and I will post an update within 48 hours...

    Saturday, February 25, 2012 11:39 PM
  • Hello,

    I've tried the following command/syntax but nothing happens.  Please review as I must be missing some characters.  Thank you...

    Monday, February 27, 2012 7:54 PM
  • It's best to save the code to a PS1 file and run the file in Powershell.  In your case, it lookslikeyou are missing a closing '}' possibly.


    JAUCG

    Monday, February 27, 2012 8:52 PM
  • Thanks.  I ran the command again with the closing '}' & it mail enabled only 600 of 1800 Contacts and I also received a screen full of these:

    Monday, February 27, 2012 9:09 PM
  • Interesting.  The only thing else you can do in this case is insert a pause in the script.

    So for our example script, I added this line to it:

    Get-Contact -OrganizationalUnit <org unit where contacts are> | foreach {
    Enable-MailContact $_ -externalEmailAddress $_.windowsEmailAddress.toString()
    start-sleep -s 5
    }

    The 'start-sleep' command will pause the execution for 5 seconds.  Increase this until you get a clean run.


    JAUCG


    • Edited by JAUCGMVP Monday, February 27, 2012 11:24 PM
    Monday, February 27, 2012 11:23 PM
  • These are the variations I've tried but nothing happens.  Could you please review?  Thanks...

    Tuesday, February 28, 2012 1:33 AM
  • Hi

    You missed a closing '}' at first line, and as JAUCG's advice. you should save the script in a PS1 file and run

    Cheers

    Zi Feng


    Zi Feng

    TechNet Community Support

    Tuesday, February 28, 2012 2:32 AM
  • Hi & thanks for your response.  I believe I did insert the closing '}' in the proper place in one of my attempts.  Please see screenshot below:

    Also, how do I properly create a PS1 file and run in EMS?

    Thank you...

    Tuesday, February 28, 2012 2:53 PM
  • Copy the text of of the script into notepad on the server.  Save the notepad as a PS1 file, like ContactScript.ps1.  Then open up the Exchange Management Shell, browse to where you save the file and run it with this command:

        .\ContactScript.ps1

    Hope that helps.

    ** Edit ** As you seem to be on the cusp of learning PowerShell, take a look at this link to get a start on PowerShell - http://www.johndcook.com/PowerShellDay1.pdf.  Also, a good blog to start with is - http://blogs.technet.com/b/heyscriptingguy/.  Enjoy!


    JAUCG



    • Edited by JAUCGMVP Tuesday, February 28, 2012 3:01 PM
    Tuesday, February 28, 2012 2:59 PM
  • Ok will do but before I do could you please confirm if the following syntax is correct?  Also do I still need to add start-sleep -s 5 to the PS1 file?

    Get-Contact -OrganizationalUnit "usdecnmpf.org" | foreach {Enable-MailContact $_ -externalEmailAddress $_.windowsEmailAddress.toString()} start-sleep -s 5

    Tuesday, February 28, 2012 3:09 PM
  • Get-Contact -OrganizationalUnit "usdecnmpf.org" | foreach {
    Enable-MailContact $_ -externalEmailAddress $_.windowsEmailAddress.toString()
    start-sleep -s 5
    }

    You forgot the closing '}'.  I also changed the formatting to make it easier to read.


    JAUCG

    Tuesday, February 28, 2012 3:22 PM
  • I ran the PS1 file and got this warning message again (screenshot below) however after that it started mail enabling contacts.  It's done A thru D so far and still going so I'll post an update shortly when done.

    Tuesday, February 28, 2012 4:13 PM
  • It's still going but I'm getting a bunch of these messages popping up.  Any thoughts?

    Tuesday, February 28, 2012 4:26 PM
  • It just finished with this final screenshot below.  When I check the EMC, it shows 999 mail contacts (1800 total need enabling) & from A to K so far.

    Any thoughts?

    Thanks...

    Tuesday, February 28, 2012 6:11 PM
  • I forgot you had over a 1000 to sort through.  Here is the modified script:

    Get-Contact -OrganizationalUnit "usdecnmpf.org" -resultsize unlimited | foreach {
    Enable-MailContact $_ -externalEmailAddress $_.windowsEmailAddress.toString()
    start-sleep -s 5
    }

    As for the errors, it seems that there are objects in the OU is not a contact.  What other objects are in that OU?


    JAUCG

    Tuesday, February 28, 2012 7:19 PM
  • I am running the revised script now.  I believe those messages are from enabled mail contacts from the original attempt that completed 600.  The only other objects are local domain distribution groups.  It looks like A thru K is complete so I'm waiting to get past those messages now to see if it will continue from K on. I'll update when it's done.

    Thanks...

    Tuesday, February 28, 2012 8:12 PM
  • It picked up where it left off at the K's and it's running.

    Tuesday, February 28, 2012 9:25 PM
  • Hi xmr25

    If there is no problem with the script, please mark JAUCG's Post as Answer and Finish this thread

    cheers


    Zi Feng

    TechNet Community Support

    Wednesday, February 29, 2012 2:00 AM
  • Hello to all,

    It appears the script worked and I now have 1820 mail enabled contacts.  I really appreciate all your help.

    Now on a related note, all my local domain distribution groups were migrated using the same 3rd party tool also, however they're all just empty containers with no members.  Per the 3rd party support, all they've concluded is that Exch2010 is different as if to say that's normal and I will need to manually add members.  I have about 50 dist groups and some contain 100 or more members.

    Is there another way to migrate the dist groups with the members you can recommend?

    Also, how do I mail enable the dist groups?

    Thank you...

    Wednesday, February 29, 2012 2:27 AM
  • Here is a sample way to mail enable a group.

    Enable-DistributionGroup -Identity "Schema Admins" -Alias "SchemaAdmins" -DisplayName "Schema Admins" -PrimarySMTPAddress "schemaadmins@contoso.com"

    http://technet.microsoft.com/en-us/library/aa997448.aspx

    As for how to export these, what is the source AD/Excahnge versions.  If the source is Exchange 2007/10 you can use Powershell to get the membership lists, export it to CSV and then use the CSV to populate the DLs with the members.   If you need to go that far, we should start a new thread after you mark this one answered.  That way we can keep track of the different solutions.


    JAUCG

    Wednesday, February 29, 2012 3:19 AM
  • The source is Windows/Exchange 2003 & target is Windows 2008/Exchange 2010.

    If a new thread is needed, no problem.  Let me know which direction to proceed.

    Thank you

    Wednesday, February 29, 2012 6:23 PM
  • Hi xmr

    Due to JAUCG has provide the solution for your first question, the Thread might be finished.

    Anyway, you can still discuss with JAUCG on this thread with some related questions, but due to this is an old thread, perhaps there is no other people will help you.

    Please open a new thread and get the recommendations 

    Cheers

    Zi Feng


    Zi Feng

    TechNet Community Support

    Thursday, March 01, 2012 2:08 AM
  • Just an update, looks like all 'Contacts' are mail enabled and after they were the distribution groups populated with members as well.

    I still need to mail enable the distribution groups and if I run into problems I will open a new thread.

    Thank you both for all your assistance.

    Thursday, March 01, 2012 1:50 PM