Replies: 2 comments
-
Hello fusrohdan, first try the command Register-PnPEntraIDAppForInteractiveLogin to Login with -Interactive. Best regards, |
Beta Was this translation helpful? Give feedback.
-
PnPTenantSite uses SPO API. Either you connect using delegated credentials or you grant application permissions to SPO API. Keep in mind that application SPO API can only be used with a certification. Secret ID wouldn't allow you to connect. |
Beta Was this translation helpful? Give feedback.
-
Hey,
So I have created an app registration which I can connect to successfully. Command used to connect is:
Connect-PnPOnline TENANT-admin.sharepoint.com -ClientId CLIENTID -Tenant TENANT.onmicrosoft.com -CertificatePath C:\it\PowershellPnP.pfx -CertificatePassword $password
This connects fine, however when I run the following command I get a 401 unauthorised error
Get-PnPTenantSite
Get-PnPTenantSite: The remote server returned an error: (401) Unauthorized.
Any other pnp command I use returns the same.
I have granted the app registration the following permissions
What I am currently trying to achieve is to grab a list of all sites, storage used, and get the content of the description of the site.
How can I achieve this using pnp?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions