This script will get all list view info from a list in a SharePoint Online site
Source: https://gallery.technet.microsoft.com/office/Get-all-views-from-a-f544f457
I used the script above to accomplish this, although I tweaked the script to output to a text file located at D:\tools
function Get-SPOListView
{
param(
[Parameter(Mandatory=$true,Position=1)]
[string]$Username,
[Parameter(Mandatory=$true,Position=2)]
$AdminPassword,
[Parameter(Mandatory=$true,Position=3)]
[string]$Url,
[Parameter(Mandatory=$true,Position=4)]
[string]$ListTitle
)
$ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url)
$ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $AdminPassword)
$ll=$ctx.Web.Lists.GetByTitle($ListTitle)
$ctx.load($ll)
$ctx.load($ll.Views)
$ctx.ExecuteQuery()
foreach($vv in $ll.Views){
$ctx.Load($vv)
$ctx.Load($vv.ViewFields)
$ctx.ExecuteQuery()
Write-Output $vv >> D:\tools\listviews.txt
}
}
# Paths to SDK. Please verify location on your computer.
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
# Insert the credentials and the name of the admin site
$Username="user@contoso.onmicrosoft.com"
$AdminPassword=Read-Host -Prompt "Password" -AsSecureString
$AdminUrl="https://contoso.sharepoint.com/sites/site"
$ListTitle="ListName"
Get-SPOListView -Username $Username -AdminPassword $AdminPassword -Url $AdminUrl -ListTitle $ListTitle
- Blogger Comment
Subscribe to:
Post Comments
(
Atom
)
Category
- Active Directory ( 8 )
- App Packaging ( 6 )
- BitLocker ( 9 )
- CrashPlan ( 7 )
- DNS ( 1 )
- DocLink ( 2 )
- Excel ( 3 )
- Exchange ( 7 )
- Group Policy ( 2 )
- Javascript ( 1 )
- M365 ( 5 )
- OneDrive ( 1 )
- OneNote ( 1 )
- Power Apps ( 1 )
- Power Automate ( 1 )
- Power BI ( 11 )
- PowerShell ( 54 )
- SCCM ( 28 )
- SCCM Device Collections ( 12 )
- SCCM Reports ( 12 )
- SCCM User Collection ( 2 )
- SCSM ( 4 )
- SharePoint ( 52 )
- SharePoint Design ( 20 )
- Skype for Business ( 1 )
- SQL Server ( 3 )
- SSL Certificates ( 3 )
- Teams ( 6 )
- Windows 10 ( 3 )
- Windows 7 ( 4 )
- Windows Server ( 5 )
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.