如何使用PowerShell获取sitecollection的所有sharepoint用户警报 [英] How to get all sharepoint user alerts for a sitecollection using powershell

查看:81
本文介绍了如何使用PowerShell获取sitecollection的所有sharepoint用户警报的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是PowerShell脚本开发的新手。目前我开发了以下powershell脚本来获取网站集中的所有用户警报。如何在foreach循环中遍历用户警报。



$ siteUrl = Read-Host"Enter url"

#示例 - http:// sharepoint2016:81 / sites / Ramesh



if($ siteUrl -ne $ null -and $ siteUrl -ne'')

{

    #获取客户端上下文并加载根网站和子网站。
    $ context = New-Object Microsoft.SharePoint.Client.ClientContext($ siteUrl)

    $ site = $ context.Web

    $ context.Load($ site)

    $ context.Load($ site.Webs)

    $ context.ExecuteQuery()

    

    #Run用于Root web下的所有网站

    foreach($ site in $ site.Webs){

   

    }


    Write-Host"已完成!"

}

解决方案

您好,

在处理SharePoint的本地版本时,应使用SharePoint Management Shell(PowerShell),而不是csom。


你会在这里找到你的答案:  获取所有用户对SHAREPOINT网站集的警告



I am new to powershell scripts development.Currently i developed following powershell script to get all user alerts in the site collection. how to loop through the user alerts in the foreach loop.

$siteUrl = Read-Host "Enter url"
# Example - http://sharepoint2016:81/sites/Ramesh

if($siteUrl -ne $null -and $siteUrl -ne '')
{
    #Get the client context and load root web and sub webs
    $context = New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl)
    $site = $context.Web
    $context.Load($site)
    $context.Load($site.Webs)
    $context.ExecuteQuery()
    
    #Run for the all webs under Root web
    foreach($web in $site.Webs){
   
    }

    Write-Host "Completed!"
}

解决方案

Hi,

As you work on an on-premises version of SharePoint, you should use the SharePoint Management Shell (PowerShell), rather than csom.

You will find your answerr here: GET ALL USER ALERTS FOR SHAREPOINT SITE COLLECTION


这篇关于如何使用PowerShell获取sitecollection的所有sharepoint用户警报的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆