To read the Excel spreadsheet, use the ImportExcel PowerShell module. Installing it should be as easy as Install-Module ImportExcel
.
Here's an example of grouping the users by their managers and sending just on mail to each manager:
Import-Excel C:\junk\group.xlsx | # this usage expects one worksheetm but you have multiple sheets, You just have to name the sheet.
Group-Object -Property 'Manager E-mail' |
ForEach-Object {
$to = $_.Name # manager email address
$MyPeeps = @()
$_.Group|
ForEach-Object {
$MyPeeps += $_ | Select-Object Name,E-Mail,Info
}
$emailbody = "Below are the following blah blah blah`n`n"
# format the users in $mypeeps in the way you want them to appear
# you can use HTML if you like.
#
# add whatever other properties you need to the Send-MailMessage
Send-MailMessage -To $to -Body $emailbody .... # send the message
}