-
Notifications
You must be signed in to change notification settings - Fork 15
/
Arbeiten_mit_Microsoft_365_Gruppen.ps1
46 lines (32 loc) · 1.6 KB
/
Arbeiten_mit_Microsoft_365_Gruppen.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Set-Location c:\
Clear-Host
#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 -AllowClobber
#Did it work?
Get-UnifiedGroup
#Create new Microsoft 365 Group
New-UnifiedGroup -DisplayName "Study Group" -Alias "0365-Study-Group" `
-EmailAddresses "0365-Study-Group@tomwechsler.xyz" -AccessType Private
#An other Microsoft 365 Group
New-UnifiedGroup –DisplayName "ITBros Admins" -Alias "ITBrosAdmins" -AccessType Public
#Add a member
Add-UnifiedGroupLinks -Identity "ITBros Admins" –LinkType Members –Links Tina.Jackson
#To list the Group Members
Get-UnifiedGroupLinks "ITBros Admins" –LinkType Member
#To list the Group Owners
Get-UnifiedGroupLinks "ITBros Admins" –LinkType Owner
#To add an additional Owner to the Group (this will not work!)
Add-UnifiedGroupLinks –Identity "ITBros Admins" –LinkType Owner –Links tim.godin@tomwechsler.xyz
#First, we have to add Tim Godin as a member to the group
Add-UnifiedGroupLinks -Identity "ITBros Admins" –LinkType Members –Links Tim.Godin
#Now we can add Tim Godin as an additional Owner to the Group
Add-UnifiedGroupLinks –Identity "ITBros Admins" –LinkType Owner –Links tim.godin@tomwechsler.xyz
#To list the Group Owners
Get-UnifiedGroupLinks "ITBros Admins" –LinkType Owner
#Remove the session
Remove-PSSession $Session