Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

powershell exchange 2010 assistance with creating groups

Posted on 2014-01-12
3
330 Views
Last Modified: 2014-04-24
Good evening I have this script and it actually create the groups. The problem I am having is I would like for it to enable the requiresenderauthenticationenabled and also if I have multiple email addresses for the distro list to pick this up from the spreadsheet.

Here is the command I use to add additional addresses for a distro list. I am not sure how to incorporate this into the script


Set-DistributionGroup "group1" -EmailAddresses SMTP:group1@domain.com,group1a@domain.com, bdf@yahoo.com

This is the script which is functional except for the portion of requiresenderauthenticationenabled.


 $CSV = Import-CSV C:\temp\ImportDL.csv

 foreach ($distrolist in $Csv} {
 New-distributiongroup -Name $distrolist.DisplayName -DisplayName  $distrolist.DisplayName -samaccountname $distrolist.samaccountname -alias  $distrolist.alias -OrganizationalUnit $distrolist.OrganizationalUnit

 | % set-distributiongroup  $distrolist.alias -requiresenderauthenticationenabled -confirm:$false
 }
0
Comment
Question by:techdrive
  • 2
3 Comments
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 39775387
Add email address with header EmailAddresses in csv file and try with following code...
$CSV = Import-CSV C:\temp\ImportDL.csv
foreach ($distrolist in $Csv) {
	$EmailAddresses = @()
	$distrolist.EmailAddresses -split "," | % {
	$EmailAddresses += "SMTP:$($_)"
	}
New-distributiongroup -Name $distrolist.DisplayName -DisplayName $distrolist.DisplayName -samaccountname $distrolist.samaccountname -alias $distrolist.alias -OrganizationalUnit $distrolist.OrganizationalUnit |
Set-Distributiongroup -EmailAddresses $EmailAddresses -RequireSenderAuthenticationEnabled $False -EmailAddressPolicyEnabled $false -confirm:$false
}

Open in new window

0
 

Author Comment

by:techdrive
ID: 39785241
thanks you are the man
0
 
LVL 40

Expert Comment

by:Subsun
ID: 39821887
Don't forget to close this question, If you don't have any further question regarding this script.. :)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
In this previous article (https://oddytee.wordpress.com/2016/05/05/provision-new-office-365-user-and-mailbox-from-exchange-hybrid-via-powershell/), we made basic license assignments to users in O365. When I say basic, the method is the simplest way …

766 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question