Mit Powershell auf Exchange Online verbinden
<h3>Konfiguration WinRM</h3>
Für den Remote zugriff auf die 365 Umgebung muss lokal auf dem Client WinRM (Windows Remote Management) konfiguriert werden.
WinRM Aktivieren:
[code lang=PS]
Enable-PSRemoting –force
[/code]
WinRM Basic Auth aktivieren:
[code lang=PS]
set winrm/config/service/auth @{Basic="true"}
[/code]
oder über die Gruppenrichtlinien:
Administrative Vorlagen>Windows-Komponenten>Windows-Remoteverwaltung (Windows Remote Mangagment, WinRM)>WinRM-Client>Basic-Authentifizierung zulassen
Ausgabe der WinRM Einstellungen:
[code lang=PS]
winrm get winrm/config/client/auth
[/code]
Verbindung PowerShell
Verbindung herstellen:
[code lang=PS]
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session
[/code]
Jetzt kann man die 365 Umgebung über PowerShell konfigurieren.
Verbindung löschen:
[code lang=PS]
Remove-PSSession $Session
[/code]