I'm working with a PowerShell script that loops through various site IDs to retrieve their names. However, I need to use delegated permissions instead of app permissions because my account, while a SharePoint administrator, doesn't have access to every single site. I'm currently trying to utilize the get-mgsite command, but I'm hitting 403 errors for sites that I'm not a member of. Does anyone have any creative solutions to access the site names without relying on this command?
1 Answer
It seems like you're looking for ways to bypass permissions, which isn't really feasible. The API you're trying to access to get all the sites requires app authentication and doesn't work with delegated permissions. You might need to rethink your approach.
I see your point, but I'm actually authorized to view this info through the SharePoint admin site. I just need to pull it via the Graph API instead of the GUI. Are there other commands I can use here?