Solved

powershell exchange 2010 assistance with creating groups

Posted on 2014-01-12
3
331 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
[X]
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
  • 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
Windows 10 came with  a lot of built in applications, Some organisations leave them there, some will control them using GPO's. This Article is useful for those who do not want to have any applications in their image (example:me).
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the adminiā€¦

763 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