来自 Ola Ekdahl 的简单行脚本对我不起作用,但这样做:
将 $url 替换为您的网站集 url 将脚本保存在 .ps1 文件中 在管理员模式下打开 SharePoint Online 命令行管理程序并执行脚本,如 .\ 将弹出一个提示,询问您的网站集凭据(管理员)
$url = "https://<your site collection url>"
$clientDll = [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client")
$runtimeDll = [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Runtime")
$cred = get-credential
$clientContext = New-Object Microsoft.SharePoint.Client.ClientContext($url)
$credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($cred.username, $cred.password)
$clientContext.Credentials = $credentials
if (!$clientContext.ServerObjectIsNull.Value)
{
Write-Host "Connected to SharePoint site: '$Url'" -ForegroundColor Green
}
$clientContext.Site.Features.Add('e995e28b-9ba8-4668-9933-cf5c146d7a9f',$true,[Microsoft.SharePoint.Client.FeatureDefinitionScope]::None)
$clientContext.ExecuteQuery()
来源: http: //mahedevelopment.blogspot.gr/2016/07/sharepoint-online-mobileexcelwebaccess.html