Skip to content

Commit 84966c6

Browse files
authored
Enhance Connect-SPOService.md with additional examples
Added examples for connecting to SharePoint Online using app identity and certificates.
1 parent 866ccca commit 84966c6

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Connect-SPOService.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,29 @@ Connect-SPOService -Url https://contoso-admin.sharepoint.com -UseSystemBrowser $
109109
```
110110
Authenticates using the Microsoft Authentication Library (MSAL) and connects to the SharePoint Online Administration Center on successful authentication.
111111

112+
### EXAMPLE 7
113+
114+
```powershell
115+
$password = ConvertTo-SecureString -String "password" -Force -AsPlainText
116+
Connect-SPOService -Url https://contoso-admin.sharepoint.com -ClientId <your_client_id> -Tenant <your_tenant_id> -CertificatePath <C:\certificates\sample-cert.pfx> -CertificatePassword $password
117+
```
118+
Connect to the SharePoint Online service using an app identity and a certificate file path, with an optional password
119+
120+
### EXAMPLE 8
121+
122+
```powershell
123+
Connect-SPOService -Url https://contoso-admin.sharepoint.com -ClientId <your_client_id> -Tenant <your_tenant_id> -CertificateThumbprint "<your_certificate_thumbprint>"
124+
```
125+
Connect to the SharePoint Online service using an app identity and a certificate thumbprint
126+
127+
### EXAMPLE 9
128+
129+
```powershell
130+
$cert = Get-ChildItem Cert:\LocalMachine\My$CertThumbprint
131+
Connect-SPOService -Url https://contoso-admin.sharepoint.com -ClientId <your_client_id> -Tenant <your_tenant_id> -Certificate $cert
132+
```
133+
Connect to the SharePoint Online service using an app identity and a certificate object
134+
112135
## PARAMETERS
113136

114137
### -AuthenticationUrl

0 commit comments

Comments
 (0)