pnp / script-samples

A sample gallery of scripts to manage all things Microsoft 365.
https://pnp.github.io/script-samples/
MIT License
220 stars 136 forks source link

Update README.md. Proposed fix for issue #528 #718

Closed reshmee011 closed 3 months ago

reshmee011 commented 3 months ago

Proposed fix for issue #528

pkbullock commented 3 months ago

Hi @reshmee011 - just looking at this, did you ever get any values from the Usage object, i was testing out of curiosity and its not returning values for me, did you get the same?

pkbullock commented 3 months ago

Just looking at this endpoint in the graph, its the closest thing I can see that produces values on a site https://graph.microsoft.com/v1.0/sites/pkbmvp.sharepoint.com/getActivitiesByInterval(startDateTime='2024-07-01',endDateTime='2024-07-29',interval='day')

https://learn.microsoft.com/en-us/graph/api/itemactivitystat-getactivitybyinterval?view=graph-rest-1.0&tabs=http

reshmee011 commented 3 months ago

Thanks @pkbullock for looking into it. I looked into Get-PnPSiteAnalyticsData which calls the endpoint getActivitiesByInterval under the hood, unfortunately it does not return the same type of data: hits and visits.

image

I don't remember ever seeing the usage.hits, usage.bandwidth and usage.visits returning any values. I did the CLI for M365 version and tried to keep the same logic and I did not do much testing or investigating into missing data.