Solved

powershell exchange 2010 assistance with creating groups

Posted on 2014-01-12
3
316 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
Comment Utility
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
Comment Utility
thanks you are the man
0
 
LVL 40

Expert Comment

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

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Utilizing an array to gracefully append to a list of EmailAddresses
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 …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

762 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now