disturbedone
Vendor
I'm looking at creating Distribution Groups from a CSV. This is for student classes.
The commands:
New-DistributionGroup groupnamegoeshere
Add-DistributionGroupMember -Identity "groupnamegoeshere" -Member usernamegoeshere}
look straight forward but I'd like to tie it all into a nice Powershell script.
The CSV would look something like:
classname,username
AA1234,2012SMITHJ
AA1234,2012DOEJ
ZZ9876,2013JOHNSA
ZZ9876,2013BLAHB
I'd like to create Distribution Groups called eg 'CLASS AA1234' and put the relevant members in.
I've seen a command:
Import-Csv .\StudentClasses.csv | ForEach {Add-DistributionGroupMember -Identity "AA1234" -Member $_.username}
but that doesn't allow the adding of 'CLASS ' in front of the class name.
I'm relatively new to scripting. I've used scripts that ask for a user's input eg 'What is the class name?' and take what was entered eg 'AA1234' and put the 2 variables together into a single variable but am unsure how that could be achieved from a CSV.
Any assistance is greatly appreciated.
The commands:
New-DistributionGroup groupnamegoeshere
Add-DistributionGroupMember -Identity "groupnamegoeshere" -Member usernamegoeshere}
look straight forward but I'd like to tie it all into a nice Powershell script.
The CSV would look something like:
classname,username
AA1234,2012SMITHJ
AA1234,2012DOEJ
ZZ9876,2013JOHNSA
ZZ9876,2013BLAHB
I'd like to create Distribution Groups called eg 'CLASS AA1234' and put the relevant members in.
I've seen a command:
Import-Csv .\StudentClasses.csv | ForEach {Add-DistributionGroupMember -Identity "AA1234" -Member $_.username}
but that doesn't allow the adding of 'CLASS ' in front of the class name.
I'm relatively new to scripting. I've used scripts that ask for a user's input eg 'What is the class name?' and take what was entered eg 'AA1234' and put the 2 variables together into a single variable but am unsure how that could be achieved from a CSV.
Any assistance is greatly appreciated.