none
Script to create Dynamic Distribution Group based on Excel file RRS feed

  • Question

  • Hello everyone,

    I have an Excel sheet that contains arounds 4000 Dynamic Distribution Groups, I need to have a script that could create those groups, mail-enable them, based on AD attributes.

    Thanks alot for your help on this.

    Saturday, December 21, 2013 1:21 PM

Answers

  • Sorry I forgot a step:

    Import-Csv <file.csv> |
         ForEach-Object{
              $filter=[scriptblock]::Create($_.OpathFilter)
              New-DynamicDistributionGroup -Name $_.Name -RecipientFilter $filter
        }


    ¯\_(ツ)_/¯

    • Marked as answer by MSExchanger Friday, January 17, 2014 1:44 AM
    Saturday, December 21, 2013 2:33 PM

All replies

  • Have you looked in the Gallery for scripts.  There are plenty there that read Excel.


    ¯\_(ツ)_/¯

    Saturday, December 21, 2013 1:57 PM
  • Sorry I forgot a step:

    Import-Csv <file.csv> |
         ForEach-Object{
              $filter=[scriptblock]::Create($_.OpathFilter)
              New-DynamicDistributionGroup -Name $_.Name -RecipientFilter $filter
        }


    ¯\_(ツ)_/¯

    • Marked as answer by MSExchanger Friday, January 17, 2014 1:44 AM
    Saturday, December 21, 2013 2:33 PM
  • Hello

    Thanks alot for your reply.

    But which step exactly you forgot, I see both sets of codes are identical.

    Thanks for your help.

    Friday, January 17, 2014 12:30 AM
  • Now there is only one.

    ¯\_(ツ)_/¯

    • Proposed as answer by jrv Friday, January 17, 2014 1:45 AM
    Friday, January 17, 2014 12:37 AM
  • Thanks a lot for your quick reply , appreciated
    Friday, January 17, 2014 1:44 AM
  • Thanks a lot for your quick reply , appreciated

    Did you try it?


    ¯\_(ツ)_/¯

    Friday, January 17, 2014 1:45 AM