:

    SSO für Windows 365 konfigurieren

    Um Single Sign-On (SSO) für Windows 365 zu ermöglichen, reicht es nicht, den zugehörigen Schalter in den Organisationseinstellungen zu setzen. Wie in unserem Video zu Windows 365 Business gezeigt wird, sind zusätzlich einige PowerShell-Befehle nötig, um das einmalige Anmelden zu ermöglichen.





    Benötigst du Unterstützung?

    Melde dich bei uns!



    Configure-W365SSO.ps1

    # Single Sign-On für Windows 365 Business konfigurieren
    
    # Microsoft Graph PowerShell SDK in Version 2.25.0 installieren
    # Neuere Versionen können in der ISE Probleme mit dem Auth-Handler verursachen
    Install-Module Microsoft.Graph -RequiredVersion 2.25.0 -Scope CurrentUser -Force
     
    # Exakt Version 2.25.0 laden, auch wenn eine neuere Version installiert ist
    Import-Module Microsoft.Graph.Authentication -RequiredVersion 2.25.0 -Force
    Import-Module Microsoft.Graph.Applications -RequiredVersion 2.25.0 -Force
    
    # Mit Graph verbinden
    Connect-MgGraph -Scopes "Application.ReadWrite.All","Application-RemoteDesktopConfig.ReadWrite.All"
    
    # Object IDs der Service Principals holen
    $MSRDspId = (Get-MgServicePrincipal -Filter "AppId eq 'a4a365df-50f1-4397-bc59-1a1564b8bb9c'").Id
    $WCLspId = (Get-MgServicePrincipal -Filter "AppId eq '270efc09-cd0d-444b-a71f-39af4910ec45'").Id
    
    # Optional: Falls die Service Principals im Tenant nicht existieren, zuerst anlegen
    # New-MgServicePrincipal -AppId "a4a365df-50f1-4397-bc59-1a1564b8bb9c"  # Microsoft Remote Desktop
    # New-MgServicePrincipal -AppId "270efc09-cd0d-444b-a71f-39af4910ec45"  # Windows Cloud Login
    
    # Entra Authentication für RDP aktivieren
    $params = @{
        "@odata.type" = "#microsoft.graph.remoteDesktopSecurityConfiguration"
        isRemoteDesktopProtocolEnabled = $true
    }
    
    Update-MgServicePrincipalRemoteDesktopSecurityConfiguration -ServicePrincipalId $MSRDspId -BodyParameter $params
    Update-MgServicePrincipalRemoteDesktopSecurityConfiguration -ServicePrincipalId $WCLspId -BodyParameter $params
    
    # Prüfen, ob die Property gesetzt ist
    Get-MgServicePrincipalRemoteDesktopSecurityConfiguration -ServicePrincipalId $MSRDspId
    Get-MgServicePrincipalRemoteDesktopSecurityConfiguration -ServicePrincipalId $WCLspId
    
    
    # Target Device Group konfigurieren (unterdrückt den Consent-Dialog)
    # Voraussetzung: Entra-Gruppe mit euren Cloud PCs anlegen, Object ID notieren
    $tdg = New-Object -TypeName Microsoft.Graph.PowerShell.Models.MicrosoftGraphTargetDeviceGroup
    $tdg.Id = "<Object ID der Gruppe>"
    $tdg.DisplayName = "<Anzeigename der Gruppe>"
    
    New-MgServicePrincipalRemoteDesktopSecurityConfigurationTargetDeviceGroup -ServicePrincipalId $MSRDspId -BodyParameter $tdg
    New-MgServicePrincipalRemoteDesktopSecurityConfigurationTargetDeviceGroup -ServicePrincipalId $WCLspId -BodyParameter $tdg
    
    # Danach in den Organization Settings unter windows.cloud.microsoft den SSO-Haken setzen