Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client")
- [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Runtime")
- $siteUrl = "https://mytenant.com"
- $username = Read-Host -Prompt "Enter user login name"
- $SecurePassword = Read-Host -Prompt "Enter user login password" -AsSecureString
- $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl)
- $credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $SecurePassword)
- $ctx.Credentials = $credentials
- $rootWeb = $ctx.Site
- $ctx.Load($rootWeb)
- $ctx.ExecuteQuery()
- $caColl = $rootWeb.get_userCustomActions()
- $ctx.Load($caColl)
- $ctx.ExecuteQuery()
- Write-Host 'Total number of custom actions: '$caColl.Count
Add Comment
Please, Sign In to add comment