Hi @Rising Flight ,
You can refer sharatha's suggestion, but if the CSV file in your side have only users column and the group is a fixed value, then modify a bit like this:
#Get Credentials to connect
$Credential = Get-Credential
#Create the session
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ `
-Credential $Credential -Authentication Basic -AllowRedirection
#Import the session
Import-PSSession $Session -DisableNameChecking
#PowerShell to Import Members to office 365 group from CSV
Import-CSV "C:\temp\GroupMembers.csv" | ForEach-Object {
Add-UnifiedGroupLinks –Identity "jerrygroup@zheguo.onmicrosoft.com" –LinkType Members –Links $_.users
Write-host -f Green "Added Member '$($_.users)' to Office 365 Group 'jerrygroup@zheguo.onmicrosoft.com'"
}
#Remove the session
Remove-PSSession $Session
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.