在PowerShell中操作SharePoint物件
1.用PowerShell建立一個SharePoint內容物件建立一個自定義列表:
$SPSite = New-ObjectMicrosoft.SharePoint.SPSite("");
$OpenWeb = $SpSite.OpenWeb();
$TemplateType = $OpenWeb.ListTemplates["自定義列表"];
$OpenWeb.Lists.Add("My Custom List2","Description Of My Custom List",$TemplateType);
$OpenWeb.Dispose(); $SPSite.Dispose()
2.用PowerShell列出站點所有Content模板
$SPSite = New-ObjectMicrosoft.SharePoint.SPSite("");
$OpenWeb = $SpSite.OpenWeb();
$OpenWeb.ListTemplates | Select Name, Description;
$OpenWeb.Dispose();
$SPSite.Dispose()
3. 如何用PowerShell匯出/備份SharePoint站點You need something like this:
Get-SPWeb -site | ForEach-Object { $filename = $_.Url.replace("","-") + ".export" ;
Write-Host export-spweb $_ -path $filename}That will walk through all the webs under sp2010,
remove the "http://" at the beginning, replace all the dashes with doubledashes,
and the slashes with dashes. Then exports them.
That way something like be savesd as sites-test-foo--bar.export.Oh,
and you'll have to remove the "write-host" for it to actually work. I put that in as a safety measure. :)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22392018/viewspace-772294/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 使用管道符在PowerShell中進行各種資料操作
- How to Operate SharePoint User Alerts with PowerShell
- 如何通過PowerShell在Visual Studio的Post-build中預熱SharePoint站點UI
- SharePoint 2007 Full Text Searching PowerShell and CS file content with SharePoint Search
- SharePoint 2013 PowerShell命令備份還原報錯
- SharePoint 常用操作雜談
- 在CentOS上安裝PowerShellCentOS
- PowerShell 操作 Azure SQL Active Geo-ReplicationSQL
- SharePoint REST API - 基本操作(二)RESTAPI
- SharePoint REST API - 基本操作(一)RESTAPI
- 在JavaScript中操作CookieJavaScriptCookie
- 在 JavaScript 中如何克隆物件?JavaScript物件
- 在PowerShell中,可以透過多種方式實現多執行緒操作。以下是一些常用的方法執行緒
- SharePoint REST API - OData查詢操作RESTAPI
- 使用PowerShell更新已存在的組設定物件物件
- PowerShell中的陣列使用陣列
- 在C#中操作XML .C#XML
- 在.NET中操作XmlDocument (轉)XML
- 在DWR中呼叫Http Servlet 物件HTTPServlet物件
- 在JavaScript中建立新物件(轉)JavaScript物件
- Alert Log中回收站物件操作告警物件
- 關於在SharePoint 2013(2010)中Javascript如何實現批量批准的自定義操作功能?JavaScript
- PowerShell 指令碼中的密碼指令碼密碼
- .Net 在容器中操作宿主機
- Java物件在JVM中長啥樣Java物件JVM
- 在session中儲存JSON物件SessionJSON物件
- Powershell tricks::Powershell RemotingREM
- SharePoint REST API - 一個請求批量操作RESTAPI
- SharePoint 2013 CSOM 物件模型屬性包物件模型
- powershell遠端重啟win10怎麼操作_win10如何使用powershell遠端重啟Win10
- 重疊IO操作在進行中
- Immutable 操作在 React 中的實踐React
- 在Oracle中實現定時操作Oracle
- 在Delphi中操作快捷方式 (轉)
- JavaScript中的物件學習筆記(屬性操作)JavaScript物件筆記
- 【sunmoonfire 】在SharePoint中編寫呼叫Excel Services的Filter Consumer WebPartExcelFilterWeb
- 在 JavaScript 中如何檢查物件為空JavaScript物件
- Swift在擴充套件中關聯物件Swift套件物件