0

I have a scenario in which I have the SharePoint role but am not a site collection admin.

I can use SPOService (Get-SPOSite) but it doesn't contain the web information I'm looking for (web creation date, web author, etc.).

I can use pnp but since I don't have explicit access to the sites, I get a forbidden error when trying to use Get-PnPSite and Get-PnPWeb.

Is there a way to get web data in such a scenario?

Example working code (except we must have access rights):

get-pnpweb -includes created, author.loginname

I suppose it would have to be either some command available in SPOService that I'm missing, something like Get-SPOWeb. Or an alternative way to connect using pnp, one that doesn't use the current user as context, something like Get-PnPTenantWeb.

Unfortunately, these commands don't seem to exist.

Edit

Found a similar thread from 2014. I'm surprised this is still a problem (even through I can count 226 commands now).

Powershell for SharePoint Online is very limited today with only 30 cmdlets available compared to 774 for SharePoint Server.

Powershell to list all sites and subsites in SharePoint Online

Tiago Duarte
  • 5,477
  • 2
  • 21
  • 43
  • Do you also have scenario where you have multiple sub sites under site collections? if not then you can use OOTB Export functionality from SharePoint Admin Center -> Active Sites which gives details which you want – Kalpesh Vaghela Sep 13 '22 at 11:05
  • no subsites. although I would like to generate a report programatically, which is why I'm looking for commands that would allow this. thx – Tiago Duarte Sep 13 '22 at 11:08
  • You can use App Only Authentication using Azure AD App Registration. Let me know if you have rights to create Azure App Registration in your tenant? so that we can share some links PowerShell to export those details – Kalpesh Vaghela Sep 13 '22 at 11:15
  • I can't really create apps and assign access by myself but you're welcome to share any articles on that and I can see if I can get that setup – Tiago Duarte Sep 13 '22 at 12:10
  • Did you try -Detailed flag in Get-SPOSite because it gives all the details which you want. e.g. Get-SPOSite -Detailed | Export-csv -Path D:\test1.csv – Kalpesh Vaghela Sep 13 '22 at 13:23
  • yes, I tried -detailed. it gives the owner and lastcontentmodifieddate but not the web properties "author" and "created" which is what I'm looking for – Tiago Duarte Sep 13 '22 at 13:45

0 Answers0