Setting Unified Groups EmailAddresses Parameter in script

Welcome Forums General PowerShell Q&A Setting Unified Groups EmailAddresses Parameter in script

  • This topic has 2 replies, 2 voices, and was last updated 1 month ago by
    Participant
    .
Viewing 2 reply threads
  • Author
    Posts
    • #193721
      Participant
      Topics: 28
      Replies: 44
      Points: 165
      Rank: Participant

      I have a script that is creating unified groups.   We use these as 'forwarders' after an employee leaves.   I have to modify the script to use the -emailaddresses parameter for setting the email addresses.

      Here is the scenario:

      • CSV Input
      • Up to 2 email addresses in addition to the primary.  Unknown when the csv is input
      • Script is iterating through the ProxyAddresses property in AD to determine if the additional address(es) exist and capture them.
      • Populate PrimarySmtpAddress and either or both of the additional addresses into the EmailAddresses parameter.

      I see 2 possibilities here

      1.  Create the group with the primary address and then iterate through and add the others as they are found.
      2.  Capture all addresses (Primary and additional) into an object and add the object.    Not sure this would work though as the object would have empty values if the additional email addresses do not exist and this could error?

       

      Looking for suggestions and recommendations for the best way to do this.

       

    • #193745
      Moderator
      Topics: 3
      Replies: 167
      Points: 878
      Helping Hand
      Rank: Major Contributor
    • #193754
      Participant
      Topics: 28
      Replies: 44
      Points: 165
      Rank: Participant

      I am a bit confused as to what you think is not following etiquette.

      I am not asking anyone to write a script for me.   I am asking for suggestions on the best way to accomplish one thing in my working PS Module.

      I haven't posted any script so nothing needs to be in Pre tags.  I have indicated what the script is already doing and what I need to do and even shown the 2 possibilities that I see.

      Can you be more clear as to what you think is a breach of etiquette

Viewing 2 reply threads
  • You must be logged in to reply to this topic.