Jump to content

Recommended Posts

Posted

Hi is it possible to add users to a office365 unified group using powershell?

I need to add 250 students to a group but don't want to have to add them manually through the gui?

I can view the group using Get-UnifiedGroup -Identity after importing a ps session, but am finding it difficult to find the right command.

Posted (edited)

@jslate1980

 

Where did you get the Add-UnifiedGroupLinks cmdlet from? It's not in the MSOnlone module.

 

I'm trying to bulk add members to an Office 365 group. All I can find on the web is how to add members to distribution or security groups.

 

*edit*

 

I've fixed it. It was the way I'd opened the session. I'm new to managing Office 365 with Powershell.

 

 

$UserCredential = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

Import-PSSession $Session

Edited by OverWorked
  • 1 month later...
Posted
Has anyone found a way of exporting classes from Sims and importing them into O365 groups via PowerShell?

 

Are students at your school email accounts added to sims? And does their upn match there email?

Posted
I believe so (but I may be wrong and there is far more clever people on here than me). I am currently making usernames and email addresses the same to try and simplify the process. But trying to make students email addresses random enough so keeping students protected for safe guarding.
  • Thanks 1
Posted

Safe guarding is a very good point. Maybe best changing to UPN for that reason. At the moment my script I've been testing is:

 

New-UnifiedGroup -DisplayName Engineering Department10 -Alias engineering10 -AccessType Private -AutoSubscribeNewMembers -HiddenGroupMembershipEnabled -Language en-GB -Owner [email protected] -Members [email protected], [email protected]

 

This does what I need it to do but I have to make a separate script for every class. Copying and pasting it from an excel spreadsheet. Very time consuming :(

Posted
There are a few examples of adding users to a distribution list from csv in office 365. I don't think it would be that hard to change for unified groups. Will have a play about tomorrow to see what I can come up with.
Posted (edited)

Creating groups from .csv:-

 

Import-CSV “C:\unifiedgroup.csv” | foreach {New-UnifiedGroup -DisplayName $_.name -Alias $_.Alias -AccessType $_.Type}

 

CSV file looks like:-

 

Name, Alias, Type,

*test1, test1, Private

*test2, test2, Private

 

Adding users from a separate csv:-

Import-Csv “C:\list.csv” | foreach {Add-UnifiedGroupLinks -Identity “*test1” -Links $_.Links -LinkType $_.LinkType}

 

CSV file looks like:-

 

Links, LinkType,

[email protected], Members,

[email protected], Owners,

Edited by jslate1980
  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...