Created
January 28, 2022 00:04
-
-
Save carlosdoliveira/49c6fcb26cd5332dea647aca0be54f26 to your computer and use it in GitHub Desktop.
Adiciona 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 | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment