Created
January 28, 2022 00:05
-
-
Save carlosdoliveira/0ee971b09be39ca3db3a08664c7a8fc6 to your computer and use it in GitHub Desktop.
Avalia se consegue adicionar múltiplos membros a múltiplas listas de distribuição
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Seu arquivo CSV deve conter as colunas Lista, Membros (emails separados por ';') | |
$Objects=Import-Csv C:\temp\objects.csv | |
$Objects | ForEach-Object { | |
$Lista= $_.Lista | |
$Membros = $_.Membros -split ";" | |
IF ($Membros) { | |
ForEach ($Membro in $Membros) { | |
Add-DistributionGroupMember -Identity $Lista -Member $Membro -WhatIf | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment