July 2017
Intermediate to advanced
648 pages
31h 9m
English
When importing data from a plain text file, we use the Get-Content cmdlet, which will read the content of the file into the shell one line at a time. In this example, we pipe the content of the file to the ForEach-Object cmdlet, and, as each line is processed, we execute the Add-DistributionGroupMember cmdlet.
Inside the ForEach-Object script block we use the Add-DistributionGroupMember cmdlet and assign the $_ object, which is the current recipient item in the pipeline, to the -Member parameter.
Keep in mind that this text file does not have to contain the SMTP address of the recipient. You can also use the Active Directory ...
Read now
Unlock full access