function Get-SPOWebs(){param( $Url = $(throw "Please provide a Site Collection Url"), $Credential = $(throw "Please provide a Credentials")) $context = New-Object Microsoft.SharePoint.Client.ClientContext($Url) $context.Credentials = $Credential $web = $context.Web ...
Showing posts with label Powershell. Show all posts
Showing posts with label Powershell. Show all posts
Thursday, March 18, 2021
Saturday, January 23, 2021
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue[System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.Office.Server.Search.Query”) [String]$lastDate = "1/1/2018"foreach($sc in $webapplication | Get-SPSite -Limit All){ Write-Host $sc.Url -ForegroundColor Yellow ...
Thursday, October 6, 2016
Add-PSSnapin Microsoft.SharePoint.PowerShell -EA SilentlyContinue
$SPWeb = Get-SPWeb "http://sharepoint";
$SPList = $SPWeb.GetList("http://sharepoint/Lists/Favorites");
$userName = "i:0#.w|[domain]\[username]";
$user = Get-SPUser -web $SPWeb -Identity $userName;
$SPListItem = $SPList.Items.Add();
$SPListItem["URL"] =...
Thursday, March 17, 2016
17
Mar
Export the subsite
STSADM:
stsadm -o export -url "http://sharepointsite/sites/order/" -filename D:\backup.cmp -includeusersecurity -versions 4
Powershell:
Add-pssnapin microsoft.sharepoint.powershell
Import-SPWeb -identity "http://sharepointsite/sites/order/" -path D:\backup.cmp -includeusersecurity &nb...
Tuesday, March 15, 2016
15
Mar
$FieldName = $list.Fields["NH Department"]
Write-Output $("NH Department - Default Value " + $FieldName.DefaultValu...