Forum Discussion
How to query View Definition
I have hundreds of sites each having a specific document library with custom views.
I would like to query the sites, identify the ones where the view is not correctly configured and fix.
e.g. View is sorted on the wrong field.
Any hints on how to achieve this via script? pnp?
Gilbert Okello I have not done this myself but you might try https://docs.microsoft.com/en-us/powershell/module/sharepoint-online/get-sposite?view=sharepoint-ps to get all the sites and then run this https://gallery.technet.microsoft.com/office/Get-all-views-from-a-f544f457 to get all these views and their properties.
Regards, Magnus
2 Replies
- MagnusGoksoyrOLDProfileBronze Contributor
Gilbert Okello I have not done this myself but you might try https://docs.microsoft.com/en-us/powershell/module/sharepoint-online/get-sposite?view=sharepoint-ps to get all the sites and then run this https://gallery.technet.microsoft.com/office/Get-all-views-from-a-f544f457 to get all these views and their properties.
Regards, Magnus- Gilbert OkelloIron Contributor