最近碰到这样一个需求,用户需要个简单的定时邮件提醒,就是抓取SharePoint某个列表里的值,然后作为邮件地址/邮件主题/邮件内容发送出去。 自己想了想,既然用户要求每天定时发送,那么......
2021-06-25 13 SharePoint,PowerShell,SendEmail,最近,碰到,这样,一个,
SharePoint online 默认是现代视图,我们可以通过Powershell命令切换默认视图。
以下,是完成的Powershell命令:
复制代码
# This file uses CSOM. Replace the paths below with the path to CSOM on this computer.
# If CSOM is in the user's downloads folder, you only have to replace the <username> placeholder.
Add-Type -Path "C:\Users\<username>\downloads\Microsoft.SharePointOnline.CSOM.16.1.5026.1200\lib\net45\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Users\<username>\downloads\Microsoft.SharePointOnline.CSOM.16.1.5026.1200\lib\net45\Microsoft.SharePoint.Client.Runtime.dll"
# All strings in braces < >are placeholders that you must replace with the appropriate strings.
$webUrl = 'https://<domain>.sharepoint.com/<relative-path-to-website>'
$username = '<username>@<domain>.onmicrosoft.com'
$password = Read-Host -Prompt "Password for $username" -AsSecureString
[Microsoft.SharePoint.Client.ClientContext]$clientContext = New-Object Microsoft.SharePoint.Client.ClientContext($webUrl)
$clientContext.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)
$site = $clientContext.Site;
$customActions = $site.UserCustomActions
$clientContext.Load($customActions)
$clientContext.ExecuteQuery()
$first = $true
foreach($customAction in $customActions)
{
if($customAction.Location -eq "scriptlink" -and -Not ([string]::IsNullOrEmpty($customAction.ScriptBlock)))
{
if ($first)
{
Echo " "
Echo ($webUrl + " has the following inline JavaScript custom actions")
$first = $false
}
Echo $customAction.Title
}
}
复制代码
如果保存ps1文件,请注意
Note: You can use a different file name, but you must save the file as an ANSI-encoded text file whose extension is .ps1
标签: SharePoint切换经典视图
相关文章
最近碰到这样一个需求,用户需要个简单的定时邮件提醒,就是抓取SharePoint某个列表里的值,然后作为邮件地址/邮件主题/邮件内容发送出去。 自己想了想,既然用户要求每天定时发送,那么......
2021-06-25 13 SharePoint,PowerShell,SendEmail,最近,碰到,这样,一个,
错误 The SharePoint server was moved to a different location. ( Error from SharePoint site: HttpStatusCode Redirect The request failed with the error message: -- htmlheadtitleObject moved/title/headbody h2Object moved to a href=/_layouts/15/site/au......
2021-06-25 228 SharePoint,Error,The,server,was,moved,different,location.,
本文介绍如何在Office 365中创建资产库库,以及资产库的一些基本设置。 通过登录地址登录到Office 365的SharePoint Online站点中,我们可以在右上角的设置菜单中,选择添加应用程序; 或者,进入......
2021-06-25 290 SharePoint创建资产库
我们在使用SharePoint文档库的时候,经常会遇到文档被别人迁出,自己无法修改的情况。这时候,我们最好的办法就是找到那个迁出的人,怼他!如果,他已经离职了,我们无法找到,那么,就......
2021-06-25 796 SharePoint上传文档提示别人迁出
最近有这么一个需求,就是用到中国的各种行政区,然后还是三级联动,就琢磨写这么一个字段。然后,觉得挺有意义的,写字段的过程也有点心得,就想到拿到博客里分享给大家,一起看看......
2021-06-25 464 SharePoint自定义城市和区域字段