How to Add Members to Office 365 Group using PowerShell?
Requirement: Add members to office 365 group using PowerShell
How to Add user to Office 365 Group using Admin Center?
As an admin, you can add members to any Office 365 group through Microsoft 365 admin center. Here is how:
How to Add Users to Office 365 Group using PowerShell?
Let's add "[email protected]" to "[email protected]" Office 365 group using PowerShell.
Bulk Add Members to Office 365 Group using PowerShell
Likewise, you can add multiple users comma separated. E.g.
Here is how to add a group member to the associated group of a given SharePoint Online site.
PowerShell to Add Users to Office 365 Group from CSV
Here is how to bulk add members to Office 365 group from a CSV file using PowerShell:
Import Office 365 Group members from CSV File:
To Add owner to Office 365 group, use: How to Add Owner to Office 365 Group using PowerShell?
How to Add user to Office 365 Group using Admin Center?
As an admin, you can add members to any Office 365 group through Microsoft 365 admin center. Here is how:
- Login to the Microsoft 365 Admin Center site: https://admin.microsoft.com
- Expand Groups and Click on Groups link in the left navigation.
- Select the Office 365 group you wish to add members
- Click on Edit link next to Members column in the details pane.
- On the Group page, Click on Add Members button >> Search and select users you wish to add to the group. You can find and add multiple users in a single stretch.
- Click on "Save" once you are done! You'll see "Group membership was updated and will take effect immediately." message.
How to Add Users to Office 365 Group using PowerShell?
Let's add "[email protected]" to "[email protected]" Office 365 group using PowerShell.
#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 add a user to office 365 group Add-UnifiedGroupLinks –Identity "[email protected]" –LinkType "Members" –Links "[email protected]" #Remove the session Remove-PSSession $Session
Bulk Add Members to Office 365 Group using PowerShell
Likewise, you can add multiple users comma separated. E.g.
Add-UnifiedGroupLinks –Identity "[email protected]" –LinkType "Members" –Links "[email protected]","[email protected]"Add Group Member to SharePoint Online Site:
Here is how to add a group member to the associated group of a given SharePoint Online site.
#Parameters $SiteURL = "https://crescent.sharepoint.com/sites/Legal" $UserID = "[email protected]" #Establish Exchange Session $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ ` -Credential (Get-Credential) -Authentication Basic -AllowRedirection Import-PSSession $Session #Get the Office 365 group of the SharePoint site $Group = Get-UnifiedGroup -ResultSize Unlimited | Where { $_.SharePointSiteUrl -eq $SiteURL} #Add Group Member Add-UnifiedGroupLinks -Identity $Group.DistinguishedName -LinkType Members -Links $UserID
PowerShell to Add Users to Office 365 Group from CSV
Here is how to bulk add members to Office 365 group from a CSV file using PowerShell:
Import Office 365 Group members from CSV File:
#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 $_.GroupID –LinkType Members –Links $_.Member Write-host -f Green "Added Member '$($_.Member)' to Office 365 Group '$($_.GroupID)'" } #Remove the session Remove-PSSession $Session
To Add owner to Office 365 group, use: How to Add Owner to Office 365 Group using PowerShell?
No comments:
Please Login and comment to get your questions answered!