New feature update – SharePoint Online Management Shell now supports app-only certificate-based authentication

Hi All,

Greetings for the day!!!

Today I am sharing feature update related to Microsoft SharePoint Online PowerShell.

Feature update:

  • SharePoint Online Management Shell now supports App-Only Certificate-Based Authentication.
  • SharePoint Online Management Shell now supports app-only certificate-based authentication for secure, unattended automation with MFA. 
  • Administrators can register apps in Microsoft Entra ID. They can assign API permissions. Using certificates to run scripts without user credentials enhances security and compliance.
  • This enables seamless execution of unattended scripts, even when MFA is enforced.
Connect-SPOService
    -Url <UrlCmdletPipeBind>
    -ClientId <String>
    -TenantId <String>
    [-ClientTag <String>]
    [-Region <AADCrossTenantAuthenticationLocation>]
    [-AuthenticationUrl <String>]
    [-Certificate <X509Certificate2>]
    [-CertificatePath <String>]
    [-CertificateThumbprint <String>]
    [-CertificatePassword <SecureString>]
    [<CommonParameters>]

Examples:

Connect to the SharePoint Online service using an app identity and a certificate file path, with an optional password.

$password = Read-Host -Prompt "Enter certificate password" -AsSecureString

Connect-SPOService -Url https://knowledgejunction1.sharepoint.com -ClientId 00000000-0000-0000-0000-000000000000 -Tenant 11111111-1111-1111-1111-111111111111 -CertificatePath C:\Certs\KJAppAuth.pfx -CertificatePassword $password

Connect to the SharePoint Online service using an app identity and a certificate thumbprint.

Connect-SPOService -Url https://knowledgejunction1.sharepoint.com -ClientId 00000000-0000-0000-0000-000000000000 -Tenant 11111111-1111-1111-1111-111111111111 -CertificateThumbprint "3FAAAA1111AAAAAAAAAAA2222AAAAAAAAAAAAAAA"

Screenshot of PowerShell commands related to SharePoint Online Management Shell, displaying 'Connect-SPOService' and 'Get-SPOsite' commands with corresponding URLs.
SPO: PowerShell – Executing “Connect-SPOService” CMDLET with ClientId and Certificate

Connect to the SharePoint Online service using an app identity and a certificate object.

$thumbprint = "3F2A5C9D4E7B8A1234567890ABCDEF1234567890"

$cert = Get-ChildItem Cert:\LocalMachine\My\$thumbprint

Connect-SPOService -Url https://knowledgejunction1.sharepoint.com -ClientId 00000000-0000-0000-0000-000000000000 -Tenant 11111111-1111-1111-1111-111111111111 -Certificate $cert

REFERENCES

Prasham Sabadra

LIFE IS VERY BEAUTIFUL. ENJOY THE WHOLE JOURNEY :) Founder of Microsoft 365 Junction, Speaker, Author, Learner, Developer, Passionate Techie. Certified Professional Workshop Facilitator / Public Speaker. Believe in knowledge sharing. Around 20+ years of total IT experience and 17+ years of experience in SharePoint and Microsoft 365 services Please feel free me to contact for any SharePoint / Microsoft 365 queries. I am also very much interested in behavioral (life changing) sessions like motivational speeches, Success, Goal Setting, About Life, How to live Life etc. My book - Microsoft 365 Power Shell hand book for Administrators and Beginners and 100 Power Shell Interview Questions - https://www.amazon.in/Microsoft-Administrators-Beginners-Interview-Questions/dp/9394901639/ref=tmm_pap_swatch_0?_encoding=UTF8&qid=1679029081&sr=8-11

You may also like...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Microsoft 365

Subscribe now to keep reading and get access to the full archive.

Continue reading