From 84966c66f4500456125ca086c6b67194950d3490 Mon Sep 17 00:00:00 2001 From: dangshubham Date: Wed, 5 Nov 2025 12:51:50 +0530 Subject: [PATCH 1/4] Enhance Connect-SPOService.md with additional examples Added examples for connecting to SharePoint Online using app identity and certificates. --- .../Connect-SPOService.md | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Connect-SPOService.md b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Connect-SPOService.md index 2bf819d0e..053223b2c 100644 --- a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Connect-SPOService.md +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Connect-SPOService.md @@ -109,6 +109,29 @@ Connect-SPOService -Url https://contoso-admin.sharepoint.com -UseSystemBrowser $ ``` Authenticates using the Microsoft Authentication Library (MSAL) and connects to the SharePoint Online Administration Center on successful authentication. +### EXAMPLE 7 + +```powershell +$password = ConvertTo-SecureString -String "password" -Force -AsPlainText +Connect-SPOService -Url https://contoso-admin.sharepoint.com -ClientId -Tenant -CertificatePath -CertificatePassword $password +``` +Connect to the SharePoint Online service using an app identity and a certificate file path, with an optional password + +### EXAMPLE 8 + +```powershell +Connect-SPOService -Url https://contoso-admin.sharepoint.com -ClientId -Tenant -CertificateThumbprint "" +``` +Connect to the SharePoint Online service using an app identity and a certificate thumbprint + +### EXAMPLE 9 + +```powershell +$cert = Get-ChildItem Cert:\LocalMachine\My$CertThumbprint +Connect-SPOService -Url https://contoso-admin.sharepoint.com -ClientId -Tenant -Certificate $cert +``` +Connect to the SharePoint Online service using an app identity and a certificate object + ## PARAMETERS ### -AuthenticationUrl From 151f6b418ca6bf251b21b0d3ec47b42d22e72118 Mon Sep 17 00:00:00 2001 From: dangshubham Date: Thu, 6 Nov 2025 14:48:50 +0530 Subject: [PATCH 2/4] Revise examples in Connect-SPOService documentation Updated examples in Connect-SPOService.md with specific client and tenant IDs, and improved clarity in descriptions. --- .../Connect-SPOService.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Connect-SPOService.md b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Connect-SPOService.md index 053223b2c..59a45a0d8 100644 --- a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Connect-SPOService.md +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Connect-SPOService.md @@ -112,25 +112,25 @@ Authenticates using the Microsoft Authentication Library (MSAL) and connects to ### EXAMPLE 7 ```powershell -$password = ConvertTo-SecureString -String "password" -Force -AsPlainText -Connect-SPOService -Url https://contoso-admin.sharepoint.com -ClientId -Tenant -CertificatePath -CertificatePassword $password +$password = Read-Host -Prompt "Enter certificate password" -AsSecureString +Connect-SPOService -Url https://contoso-admin.sharepoint.com -ClientId 00000000-0000-0000-0000-000000000000 -Tenant 11111111-1111-1111-1111-111111111111 -CertificatePath C:\Certs\ContosoAppAuth.pfx -CertificatePassword $password ``` -Connect to the SharePoint Online service using an app identity and a certificate file path, with an optional password +Connect to the SharePoint Online service using an app identity and a certificate file path, with an optional password. ### EXAMPLE 8 ```powershell -Connect-SPOService -Url https://contoso-admin.sharepoint.com -ClientId -Tenant -CertificateThumbprint "" +Connect-SPOService -Url https://contoso-admin.sharepoint.com -ClientId 00000000-0000-0000-0000-000000000000 -Tenant 11111111-1111-1111-1111-111111111111 -CertificateThumbprint "3FAAAA1111AAAAAAAAAAA2222AAAAAAAAAAAAAAA" ``` -Connect to the SharePoint Online service using an app identity and a certificate thumbprint +Connect to the SharePoint Online service using an app identity and a certificate thumbprint. ### EXAMPLE 9 ```powershell -$cert = Get-ChildItem Cert:\LocalMachine\My$CertThumbprint -Connect-SPOService -Url https://contoso-admin.sharepoint.com -ClientId -Tenant -Certificate $cert +$cert = Get-ChildItem Cert:\LocalMachine\My\$CertThumbprint +Connect-SPOService -Url https://contoso-admin.sharepoint.com -ClientId 00000000-0000-0000-0000-000000000000 -Tenant 11111111-1111-1111-1111-111111111111 -Certificate $cert ``` -Connect to the SharePoint Online service using an app identity and a certificate object +Connect to the SharePoint Online service using an app identity and a certificate object. ## PARAMETERS From 626f8cb8fe469a30ed68f1bf3e30494688b43713 Mon Sep 17 00:00:00 2001 From: dangshubham Date: Thu, 13 Nov 2025 16:10:20 +0530 Subject: [PATCH 3/4] Refactor example 9 to use thumbprint variable Updated example 9 to use a variable for the certificate thumbprint. --- .../Connect-SPOService.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Connect-SPOService.md b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Connect-SPOService.md index 59a45a0d8..3e51aabbf 100644 --- a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Connect-SPOService.md +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Connect-SPOService.md @@ -127,7 +127,8 @@ Connect to the SharePoint Online service using an app identity and a certificate ### EXAMPLE 9 ```powershell -$cert = Get-ChildItem Cert:\LocalMachine\My\$CertThumbprint +$thumbprint = "<3F2A5C9D4E7B8A1234567890ABCDEF1234567890>" +$cert = Get-ChildItem Cert:\LocalMachine\My\$thumbprint " Connect-SPOService -Url https://contoso-admin.sharepoint.com -ClientId 00000000-0000-0000-0000-000000000000 -Tenant 11111111-1111-1111-1111-111111111111 -Certificate $cert ``` Connect to the SharePoint Online service using an app identity and a certificate object. From 649d1ef26d659836775ed2ac13d61a1292017376 Mon Sep 17 00:00:00 2001 From: dangshubham Date: Thu, 13 Nov 2025 17:30:39 +0530 Subject: [PATCH 4/4] Fix thumbprint format in Connect-SPOService example Updated the thumbprint format in Example 9 for clarity. --- .../Connect-SPOService.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Connect-SPOService.md b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Connect-SPOService.md index 3e51aabbf..8a5d6dfb5 100644 --- a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Connect-SPOService.md +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Connect-SPOService.md @@ -127,8 +127,8 @@ Connect to the SharePoint Online service using an app identity and a certificate ### EXAMPLE 9 ```powershell -$thumbprint = "<3F2A5C9D4E7B8A1234567890ABCDEF1234567890>" -$cert = Get-ChildItem Cert:\LocalMachine\My\$thumbprint " +$thumbprint = "3F2A5C9D4E7B8A1234567890ABCDEF1234567890" +$cert = Get-ChildItem Cert:\LocalMachine\My\$thumbprint Connect-SPOService -Url https://contoso-admin.sharepoint.com -ClientId 00000000-0000-0000-0000-000000000000 -Tenant 11111111-1111-1111-1111-111111111111 -Certificate $cert ``` Connect to the SharePoint Online service using an app identity and a certificate object.