Unable to connect to powershell

Stephen Patterson 0 Reputation points
2026-09-04T19:48:29.5366667+00:00

Error Code: 530035

Request Id: 28c4331c-c4d5-49d1-9cf7-91d0d3bc0300

Correlation Id: d17e98e7-60d5-4d09-b3b1-da37ef2bb2cf

Timestamp: 2026-09-04T18:06:00.807Z

App name: MS Teams Powershell Cmdlets

App id: 12128f48-ec9e-42f0-b203-ea49fb6af367

IP address: 187.13.14.182

Device identifier: 0527c349-c7de-4dfd-8645-13ad1bb74561

Device platform: Windows 10

Device state: Registered

Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments

3 answers

Sort by: Newest
  1. Stephen Patterson 0 Reputation points
    2026-09-08T21:13:34.8133333+00:00

    Hello Jerald

    The reason for connecting to powershell is I am working to migrate to teams. Teams has a feature that allows TeamsPremium users to edit and brand webinar email templates. Even though CoPilot, Claude and the MSFT Teams Support confirmed that the GUI was correctly configured, they asked to confirm AllowEmailEditing was enabled using Powershell.

    The Teams support person directed me to the Azure support team starting this thread.

    I was to confirm that the AllowEmailEditing on my PC was enabled in PowerShell. But the feature is not enabled on Teams web or Teams App. I was unable to run the commands on my MacBook.

    I ran the following successfully on my PC.

    Update-Module MicrosoftTeams 

    Install-Module MicrosoftTeams -Force -AllowClobber

    Connect-MicrosoftTeams 

    I was able to connect and run the following commandlets in PowerShell. Here are the results.

    PS C:\WINDOWS\system32>

    $Policy = (Get-CsOnlineUser -Identity "******@medvr.onmicrosoft.com").TeamsEventsPolicy; if ([string]::IsNullOrEmpty($Policy)) { $Policy = "Global" }; Set-CsTeamsEventsPolicy -Identity $Policy -AllowEmailEditing Enabled

    PS C:\WINDOWS\system32>

    $Policy = (Get-CsOnlineUser -Identity "******@medvr.onmicrosoft.com").TeamsEventsPolicy; if ([string]::IsNullOrEmpty($Policy)) { $Policy = "Global" }; Get-CsTeamsEventsPolicy -Identity $Policy | Select-Object Identity, AllowEmailEditing

    Identity AllowEmailEditing

    So it should be working. But I cannot edit the webinar templates. What are the next steps?

    Was this answer helpful?

    0 comments No comments

  2. Stephen Patterson 0 Reputation points
    2026-09-08T21:09:45.22+00:00

    Hello Jerald

    The reason for connecting to powershell is I am working to migrate to teams. Teams has a feature that allows TeamsPremium users to edit and brand webinar email templates. Even though CoPilot, Claude and the MSFT Teams Support confirmed that the GUI was correctly configured, they asked to confirm AllowEmailEditing was enabled.

    The Teams support person directed me to the Azure support team.

    I was to confirm that the AllowEmailEditing on my PC was enabled in PowerShell. But the feature is not enabled on Teams web or Teams App. I was unable to run the commands on my MacBook.

    I ran the following successfully on my PC.

    Update-Module MicrosoftTeams 

    Install-Module MicrosoftTeams -Force -AllowClobber

    Connect-MicrosoftTeams 

    I was able to connect and run the following commandlets in PowerShell. Here are the results.

    PS C:\WINDOWS\system32> $Policy = (Get-CsOnlineUser -Identity "******@medvr.onmicrosoft.com").TeamsEventsPolicy; if ([string]::IsNullOrEmpty($Policy)) { $Policy = "Global" }; Set-CsTeamsEventsPolicy -Identity $Policy -AllowEmailEditing Enabled

    PS C:\WINDOWS\system32>

    $Policy = (Get-CsOnlineUser -Identity "******@medvr.onmicrosoft.com").TeamsEventsPolicy; if ([string]::IsNullOrEmpty($Policy)) { $Policy = "Global" }; Get-CsTeamsEventsPolicy -Identity $Policy | Select-Object Identity, AllowEmailEditing

    Identity AllowEmailEditing

    So it should be working. What are the next steps?

    Was this answer helpful?


  3. Jerald Felix 18,760 Reputation points Volunteer Moderator
    2026-09-08T04:18:47.58+00:00

    Hello Stephen Patterson,

    Greetings! Thanks for raising this question in the Q&A forum

    Error AADSTS530035 means BlockedBySecurityDefaults. The Microsoft Teams PowerShell authentication flow is being blocked by the tenant’s Microsoft Entra Security Defaults, commonly because an older credential-based or device-code flow is being used.

    Update the Teams PowerShell module

    Close existing PowerShell sessions, open a new elevated session, and run:

    Update-Module MicrosoftTeams
    

    If the module is not installed:

    Install-Module MicrosoftTeams -Force -AllowClobber
    

    Microsoft supports Windows PowerShell 5.1 and PowerShell 7.2 or later. See Install Microsoft Teams PowerShell.

    Use interactive modern authentication

    Connect without supplying credentials or requesting device authentication:

    Connect-MicrosoftTeams
    

    Complete the interactive sign-in and MFA prompt. Avoid -Credential with an older module and avoid -UseDeviceAuthentication. Security Defaults currently blocks device-code flow as well as legacy authentication. See Microsoft Entra Security Defaults.

    Locate the exact blocked sign-in

    In the Microsoft Entra admin center, navigate to Entra ID > Monitoring & health > Sign-in logs and search using:

    Correlation ID: d17e98e7-60d5-4d09-b3b1-da37ef2bb2cf

      Request ID: `28c4331c-c4d5-49d1-9cf7-91d0d3bc0300`
      
         Timestamp: `2026-09-04T18:06:00.807Z`
         
            Application ID: `12128f48-ec9e-42f0-b203-ea49fb6af367`
            
            Open the event and inspect **Authentication Details** and the authentication protocol. The failure reason should show `BlockedBySecurityDefaults`. Microsoft documents this investigation process in [Troubleshoot sign-in problems](https://learn.microsoft.com/en-us/entra/identity/conditional-access/troubleshoot-conditional-access).
            
            **Use certificate authentication for unattended scripts**
            
            Interactive user authentication is appropriate for administration from a console. For scheduled or unattended automation, register an application, grant only the required permissions with administrator consent, upload a certificate, and connect using:
            
            ```powershell
            Connect-MicrosoftTeams `
    -CertificateThumbprint "<certificate-thumbprint>" `
    -ApplicationId "<application-id>" `
    -TenantId "<tenant-id>"
            ```
            
            Confirm that the commands used by the script support application authentication. See [Application-based authentication in Teams PowerShell](https://learn.microsoft.com/en-us/microsoftteams/teams-powershell-application-authentication).
            
            **Keep Security Defaults enabled**
            
            Security Defaults does not support per-user or per-application exclusions. Do not disable it merely to run Teams PowerShell. If the organization has Microsoft Entra ID P1 or P2 and requires customized authentication policies, first design equivalent Conditional Access protections for MFA, administrator access, legacy authentication, and device-code flow before replacing Security Defaults.
            
            **Escalate if interactive authentication is also blocked**
            
            If the current module still returns `530035` when using plain `Connect-MicrosoftTeams`, open a Microsoft Entra support request and include the request ID, correlation ID, UTC timestamp, application ID, module version from `Get-Module MicrosoftTeams -ListAvailable`, and the sign-in-log authentication details. Do not include the user’s IP address or device identifier in the public thread.
            
    

    If this answer helps you kindly accept the answer which will help others who have similar questions.

    Best Regards,

    Jerald Felix.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.