Solved

powershell exchange 2010 assistance with creating groups

Posted on 2014-01-12
3
335 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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 script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
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…

737 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