Wednesday, 16 November 2016
Friday, 11 November 2016
How to add Desktop Experience feature on Windows Server 2012 “Server
https://blogs.technet.microsoft.com/meamcs/2012/05/01/how-to-add-desktop-experience-feature-on-windows-server-2012-server-8-beta/
Thanks Tamer
Tuesday, 25 October 2016
Using Script
http://blog.qumsieh.ca/2010/02/16/hide-columns-in-sharepoint-new-edit-and-disp-forms/
Using Designer
http://promx.net/en/2016/09/how-to-hide-columns-from-sharepoint-forms/ -
Using Power Shell
First load SharePoint Core Assembly
[System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SharePoint”)
$url = "http://ulabtechnologies.sharepoint.com";
$list = "Employee";
$fieldname = "NewColumn";
#Setting up context
$contextSite = New-Object Microsoft.SharePoint.SPSite($url);
$contextWeb = $contextSite.OpenWeb();
$list = $contextWeb.Lists.TryGetList($list);
$field = $list.Fields[$fieldname];
# Controls Field in Edit Form
$field.ShowInEditForm = 1;
# Controls Field in New Form
$field.ShowInNewForm = 0;
# Controls Field in New Form
$field.ShowInDisplayForm = 1;
# Hides fields from list settings
$field.ShowInListSettings = 1;
# Hides fields from version history
$field.ShowInVersionHistory = 1;
# Hides fields form selection in views
$field.ShowInViewForms = 1;
# Don't forget to update this field
$field.Update();
# And finally dispose everything.
$contextWeb.Dispose();
$contextSite.Dispose();
Wednesday, 12 October 2016
Set Privileges for Using PowerShell to Manage SharePoint
To execute a command in the SharePoint 2013 Management Shell, open the Management Shell on a SharePoint 2010 server. To execute commands, the user must have the necessary privileges to the SharePoint object model and to the SharePoint databases. When you are working with SharePoint objects, connections to the database are generally created with the permissions of the current user.
You can use SPShellAdmin for configuring a user’s privileges and security. Here’s how.
To list Shell administrators:
Get-SPShellAdmin
To add a user as a Shell administrator:
Add-SPShellAdmin -UserName -Database
For example, to allow user Jeff Hay to execute commands against the PartnerNet site, use the following command:
Add-SPShellAdmin -UserName Contoso\Jeff Hay
-Database (Get-SPContentDatabase -Identity PartnerNet_ContentDatabase)
Note that the Get-SPContentDatabase cmdlet and the PartnerNet content database name are used to retrieve the SPContentDatabase object.
To remove a user from Shell Admin:
Remove-SPShellAdmin -UserName -Database
You can use SPShellAdmin for configuring a user’s privileges and security. Here’s how.
To list Shell administrators:
Get-SPShellAdmin
To add a user as a Shell administrator:
Add-SPShellAdmin -UserName
For example, to allow user Jeff Hay to execute commands against the PartnerNet site, use the following command:
Add-SPShellAdmin -UserName Contoso\Jeff Hay
-Database (Get-SPContentDatabase -Identity PartnerNet_ContentDatabase)
Note that the Get-SPContentDatabase cmdlet and the PartnerNet content database name are used to retrieve the SPContentDatabase object.
To remove a user from Shell Admin:
Remove-SPShellAdmin -UserName
Thursday, 15 September 2016
SharePoint 2010 and 2013 Subsite backup and restore using Powershell
export-spweb -identity "http://ulabtechnologies/legal" -path "D:\subslitebacku\legasubsite.cmp"
Restore
import-spweb -identity "http://ulabtechnologies/lcs" -path "D:\subslitebacku\legasubsite.cmp"
Note:
Master page template should be same as backup site in restore site
Wednesday, 24 August 2016
Creating subsite using PowerShell
Add-PsSnapin Microsoft.SharePoint.PowerShell
## SharePoint DLL
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
#Creating Sub Sites in top site collection.
Write-Output " "
Write-Output "Creating Sub Sites"
$SiteCollectionURL = "http://legal.ulab.com/LCS/TrainSiteLgl/TrainSiteDOCRep"
$SiteCollectionTemplate = "CMSPUBLISHING#0"
$SiteCollectionLanguage = 1033
$SubSites = @("Insur","Insurrance","LegalMatters","TradeMarks")
for($i=0 ; $i -lt $SubSites.count ; $i++)
{
$SiteUrl = ""
$SiteUrl = $SiteCollectionURL + "/"
$SiteUrl = $SiteUrl += $SubSites[$i]
Write-Output " "
#Write-Output "Creating Site for " += $SubSites[$i]
Write-Output " "
New-SPWeb $SiteUrl -Template $SiteCollectionTemplate -Name $SubSites[$i] -UseParentTopNav -Language $SiteCollectionLanguage
Write-Output " "
#Write-Output "Site Created for " += $SubSites[$i]
Write-Output " "
}
## SharePoint DLL
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
#Creating Sub Sites in top site collection.
Write-Output " "
Write-Output "Creating Sub Sites"
$SiteCollectionURL = "http://legal.ulab.com/LCS/TrainSiteLgl/TrainSiteDOCRep"
$SiteCollectionTemplate = "CMSPUBLISHING#0"
$SiteCollectionLanguage = 1033
$SubSites = @("Insur","Insurrance","LegalMatters","TradeMarks")
for($i=0 ; $i -lt $SubSites.count ; $i++)
{
$SiteUrl = ""
$SiteUrl = $SiteCollectionURL + "/"
$SiteUrl = $SiteUrl += $SubSites[$i]
Write-Output " "
#Write-Output "Creating Site for " += $SubSites[$i]
Write-Output " "
New-SPWeb $SiteUrl -Template $SiteCollectionTemplate -Name $SubSites[$i] -UseParentTopNav -Language $SiteCollectionLanguage
Write-Output " "
#Write-Output "Site Created for " += $SubSites[$i]
Write-Output " "
}
Tuesday, 15 March 2016
Subscribe to:
Posts (Atom)