<

Creating Office 365 Groups with PowerShell

Published on
3,365 Points
365 Views
Last Modified:
Shaun Hardneck
Passionate and Experienced IT Professional with experience in Microsoft Exchange Messaging and Office 365 solutions.
In this post, I will showcase the steps for how to create groups in Office 365.
Office 365 groups allow for ease of flexibility and collaboration between staff members.

Creating Office 365 Groups with PowerShell


To get started a PowerShell session to Exchange Online needs to be established.


The following script can assist in connecting to Exchange Online quickly: https://gallery.technet.microsoft.com/office/Connect-To-Office-365-9b235018


Now that a session to Exchange Online has been established, now we can go ahead and run the following cmdlet to create the new group.


New-UnifiedGroup –DisplayName “Global-Ex-Support” –Alias GlobalExSupport


As you can see above the group has been created, however we have not specified if it should be a private or public group. By default the group is created as an empty public group with the owner as the admin user who created the group. Let’s go ahead and change the group's AccessType and add additional members to the group.


To set the group to private the following cmdlet can be used.


Set-UnifiedGroup –Identity GlobalExSupport –AccessType Private


So, the group GlobalExSupport has now been changed to private. Let’s go ahead and add some members to the newly created group.


To add members to the group the following cmdlet and be used.


Add-UnifiedGroupLink –Identity GlobalExSupport –LinkType Member –Links Farren@ThatLazyAdmin.com, Renjith@ThatlazyAdmin.com


How do you change the group owner once a group has been created already by another staff member?


To add an additional owner to the group, the following cmdlet can be used.


Add-UnifiedGroupLink –Identity GlobalExSupport –LinkType Owner –Link Farren@ThatLazyAdmin.com


To list the group members the following cmdlet can be used.


Get-UnifiedGroupLinks GlobalExSupport –LinkType Member


To list the group owners the following cmdlet can be used.


Get-UnifiedGroupLinks GlobalExSupport –LinkType Owner


To remove a group owner the following cmdlet can be used.


Remove-UnifiedGroupLinks –Identity GlobalExSupport –LinkType Owner –Links Farren.Prag


Now that we have looked at how to remove a group owner, let’s look at how to remove a group member as well.


To remove a group member the following cmdlet can be used.


Remove-UnifiedGroupLinks –Identity GlobalExSupport –LinkTypeMember –Links Renjith.VC


To wrap it up, we have gone through the creation and modification of an Office 365 group. Hope you got something out of it.



#ThatLazyAdmin


0
Comment
0 Comments

Featured Post

Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

Join & Write a Comment

Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
Check How effective MS Exchange Expert thinks Exchange Mailbox Recovery by SysTools IS. Visit the Official site to get detailed information:- https://www.systoolsgroup.com/exchange-recovery.html (https://www.systoolsgroup.com/exchange-recovery.h…

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month