Dismiss Notice

Register now to be one of the first members of this SharePoint Community! Click here it just takes seconds!

Dismiss Notice
Welcome Guest from Country Flag

SPO : PowerShell to get Custom Actions in a Site Collection

Discussion in 'Official Microsoft News' started by ChandrasekarN, Aug 28, 2016.

Thread Status:
Not open for further replies.
  1. ChandrasekarN

    ChandrasekarN Guest

    Blog Posts:
    0
    [System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SharePoint.Client”)
    [System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SharePoint.Client.Runtime”)

    $siteUrl = Read-Host -Prompt “Enter sitecollection url”
    $username = Read-Host -Prompt “Enter user login name”
    $password = Read-Host -Prompt “Enter user login password” -AsSecureString
    $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl)

    # SharePoint Online
    $credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)
    $ctx.Credentials = $credentials

    $rootWeb = $ctx.Site
    $ctx.Load($rootWeb)
    $ctx.ExecuteQuery()
    $caColl = $rootWeb.get_userCustomActions()
    $ctx.Load($caColl)
    $ctx.ExecuteQuery()

    Write-Host
    Write-Host ‘Total number of custom actions: ‘$caColl.Count
    $count = 1
    $caColl | ForEach-Object {
    Write-Host $count’)’ $_.Name
    $count++
    }

    Continue reading...
     
Thread Status:
Not open for further replies.

Share This Page

LiveZilla Live Chat Software