Incoming Text Example:
Group1@domain.com MgtGroup
Group1@domain.com MgtGroup
Template - Sets Name, SamAccountName, ManagedBy
New-DistributionGroup
-Name '<% $0.split('@')[0] %>'
-SamAccountName '<% $0.split('@')[0] %>'
-ManagedBy '$1'
-OrganizationalUnit 'OU=Distribution Groups DLs),OU=Managed,DC=XXXX,DC=XXX,DC=XXX,DC=au'
-Type 'Security'
Update Email Address (when the target address is in col 2 of input )
Set-DistributionGroup '$2' -EmailAddresses @{Add='$2@XXX.com.au'}
Comments
Post a Comment