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...
Wednesday, March 2, 2016
02
Mar
Declare variable for template:
$template = Get-SPWebTemplate "STS#0"
New-SPSite -Name "VSPServer Intranet" -Url "http://peakfinders" –HostHeaderWebApplication $hnscWebApp -Template $template -OwnerAlias "Peakfinder\admi...
Thursday, February 18, 2016
18
Feb
Server Object Model:
string command = String.Format("<Method><SetList Scope=\"Request\">{0}</SetList><SetVar Name=\"ID\">{{0}}</SetVar><SetVar Name=\"Cmd\">Delete</SetVar><SetVar Name=\"owsfileref\">{{1}}</SetVar></Method>", list.ID);
SPQuery...
Friday, February 12, 2016
12
Feb
$web = Get-SPWeb http://peakfinders
$list = $web.Lists["Employee"]
$list.fields | select Title, InternalName, Hidden, CanBeDeleted | sort title | ft -AutoSize
As you will most often be interested in the non-hidden fields, you can add a Where to filter them:
$list.fields | select Title, InternalName, Hidden, Sealed,...
Friday, January 29, 2016
29
Jan
Get sites and content DB details using following power shell command
$rootSite=New-Object Microsoft.SharePoint.SPSite("http://weburl")$spWebApp = $rootSite.WebApplication foreach($site in $spWebApp.Sites) { write-output "$($site.RootWeb.Url) - $($site.ContentDatabase)" ...
Wednesday, December 9, 2015
09
Dec
Programmatically Create TopLink Bar in SharePoint site collection:
SPNavigationNodeCollection topnav = oweb.Navigation.TopNavigationBar;
SPNavigationNode node = new SPNavigationNode("Title", "URL");
node = topnav.AddAsLast(node);
node.Update();
Similarly, To create Quicklaunch bar
SPNavigationNodeCollection topnav...
Wednesday, August 5, 2015
05
Aug
Add-PSSnapin Microsoft.SharePoint.PowerShell
Export-SPWeb "http://raghu/sites/test/test1" –Path "C:\rm.cmp" -includeusersecurity
Import-SPWeb "http://raghu/sites/test/test1" -path "C:\rm.cmp" -IncludeUserSecuri...
Tuesday, August 4, 2015
Add-PSSnapin Microsoft.SharePoint.PowerShell -ea silentlycontinue | Out-Null
Get-SPWebTemplate | ft ID, name, Title, Description -autosize -wrap
...
Monday, August 3, 2015
03
Aug
SQL Server databases have three types of files:Primary data filesThe primary data file is the starting point of the database and points to the other files in the database. Every database has one primary data file. The recommended file name extension for primary data files is .mdf.Secondary data filesSecondary data files...
Labels:
Powershell,
sharepoint 2013,
SharePoint som,
SQL
Search :
Level 1.web application 2.site level
1.webapplication
when user creates using search center we need to config central admin 1.incremental crawl -last updated items (we can set time every half/one hour user defined)
2.full crawl -all items in web application (weekly once or day-wise...
Labels:
Powershell,
sharepoint 2013,
SharePoint som
Wednesday, July 29, 2015
29
Jul
Add-PSSnapin Microsoft.SharePoint.PowerShell
Get-SPUser -web "http://raghu:2015/"
Remove-SPUser "c:0(.s|true" -web "http://raghu:2015...
Tuesday, July 21, 2015
21
Jul
<script type="text/javascript">
$(document).ready(function() {
var managerName;
var userName = $().SPServices.SPGetCurrentUser();
$().SPServices({
operation: "GetUserProfileByName",
...
Labels:
Powershell,
sharepoint 2013,
SharePoint som
Friday, July 17, 2015
Code:
Replace user list id{B7EDD228-FDD2-46D2-A47E-E33D1D27E612}-{80AB3567-18AE-4ACE-A8E5-C86E5285E9C9}
<script type="text/javascript">
$(document).ready(function(){
var SummaryName ="Employee";
$("table").each(function(){
var curTable = $(this).attr('id');
if (curTable == "{B7EDD228-FDD2-46D2-A47E-E33D1D27E612}-{80AB3567-18AE-4ACE-A8E5-C86E5285E9C9}"){
var...
Thursday, July 16, 2015
16
Jul
move-spsite "http://raghuspsserver/" -DestinationDatabase "raghu_contentdbne...
Labels:
Powershell,
sharepoint 2013,
SharePoint som
Saturday, July 4, 2015
04
Jul
When creating new columns, name them without any special characters or spaces. After the column is created, rename it with the special characters or spaces. This way the internal name is "clean".
When you are working with DataViews, some third party controls, and custom Webparts - you must use the internal...
Saturday, June 27, 2015
To determine your disk space usage: 1. Click on "Site Settings". 2. Click on "Go to site admin". 3. Click on "View Site Collection Usage Summary" - note that the maximum amounts listed may not agree with those outlined for your hosting plan. The amounts listed for your hosting plan are the correct limits. 4....
Labels:
Powershell,
sharepoint 2013,
SharePoint som