How can a set a Security Group's email address using PowerShell?

16,012
Set-ADGroup "SecurityGroupName" -Replace @{mail="[email protected]"}
Share:
16,012

Related videos on Youtube

rtf
Author by

rtf

Updated on September 18, 2022

Comments

  • rtf
    rtf over 1 year

    I need to create many groups with email addresses. I would prefer to use Security Groups to reduce the number of groups we have to maintain, otherwise we'd have an identical Distribution Group for every one of these Security Groups.

    We're using the groups for Google Apps, not Exchange. All I'm finding are Exchange solutions, and I'm not sure installing Exchange related tools and using the Mail-Enable command (etc) is the right way to go.

    I can see via the GUI that input in the E-mail field sets the mail property, but I can't seem to figure out how I can set it using PowerShell. I would've thought this would work:

    $group.mail = $email
    Set-ADGroup $group 
    

    But no luck.

    How can I set the mail property?

  • MDMarra
    MDMarra almost 9 years
    Did you read the question or just the title? It's not for Exchange.