Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Get-PnPTenantSite : The remote server returned an error: (401) Unauthorized. Using App Registration #4576

Open
pdrive29 opened this issue Nov 23, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@pdrive29
Copy link

Hello, Hope everyone is doing well, I am trying to get the data using the Get-PnPTenant site using app registration,
I have created the certificate and uploaded it to the application
image

I have applied the relevant Graph API App permissions to the App

image

And even gave the application Share-point Admin and Global Admin Role as well.

I am able to successfully connect to the Sharepoint Admin Center. However I do get warning signs to update the PnP Module despite running the Update-Module multiple times as admin

image

When I run the Get-PnPTenantID I do get my Tenant ID as the output however when it comes to the running the Get-PnPTenant I get the 401 error

I am running this on my windows machine

I similar bug was reported #3549 and the fix was to Set-SPOTenant -DisableCustomAppAuthentication $false

However in this case since I have to use it to run on other tenants I may not be able to use the above command-let and need to leverage app registrations to get it to work

If any one case point me in the right direction I would be greatful

@pdrive29 pdrive29 added the bug Something isn't working label Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant