Skip to content

Instantly share code, notes, and snippets.

@carlosdoliveira
Created January 28, 2022 00:04
Show Gist options
  • Save carlosdoliveira/49c6fcb26cd5332dea647aca0be54f26 to your computer and use it in GitHub Desktop.
Save carlosdoliveira/49c6fcb26cd5332dea647aca0be54f26 to your computer and use it in GitHub Desktop.
Adiciona Múltiplos membros a múltiplas listas de distribuição
# 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
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment