Get-SPSite 'http://sharepointwebapplicationurl' | Get-SPWeb -Limit All
Search This Blog
Sunday, November 15, 2015
Powershell to list all SharePoint Site Collections and subsites a web application
Get-SPSite 'http://sharepointwebapplicationurl' | Get-SPWeb -Limit All
Backup and Restore SharePoint Site using Shell Command
Backup SharePoint Site Shell Command:
Backup-SPSite http://sitename -Path E:\Backup\site_name.bak
Description:
The Backup-SPSite cmdlet performs a backup of the site
collection when the Identity parameter is used. By default, the site collection
will be set to read-only for the duration of the backup to reduce the potential
for user activity during the backup operation to corrupt the backup.
Restore a SharePoint site Shell Command:
Restore-SPSite http://sitename -Path "E:\Backup\file.bak" -Force
Restore a SharePoint site to a specific database Shell Command:
Restore-SPSite http://sitename -Path "E:\Backup\file.bak" -Force -DatabaseName "Database"
Description:
The Restore-SPSite cmdlet performs a restoration of the
site collection to a location specified by the Identity parameter. A content
database may only contain one copy of a site collection. If a site collection
is backed up and restored to a different URL location within the same Web
application, an additional content database must be available to hold the
restored copy of the site collection.
List of all SharePoint custom solutions and deployed web applications in the farm
$File = "D:\SolutionandDeployedWebApplications.txt"
foreach ($solution in Get-SPsolution)
{
echo $solution.Name | Out-File $File -Append
echo $solution.DeployedWebApplications |Format-Table -Property Url | Out-File $File -Append
}
Saturday, November 14, 2015
How to find the Version, Culture and PublicKeyToken of an Assembly (DLL) using PowerShell
([system.reflection.assembly]::loadfile("c:\temp\test.dll")).FullName
The output of this PowerShell statement will provide the Version, Culture and PublicKeyToken as shown below.
Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=630d986a50055aa6
Install to global assembly cache without gacutil
In Windows Server 2012 you can't install a DLL to the GAC by drag/drop, but you can do it using GACUTIL.exe.
GacUtil.exe is not present on the server by default.
You can do it using the following script instead of Gacutil.exe
In Windows 2012 you can use the following PowerShell to install dll to GAC
Set-location "c:\temp"
[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
$publish = New-Object System.EnterpriseServices.Internal.Publish
$publish.GacInstall("c:\temp\test.dll")
iisreset
In Windows 2012 you can use the following PowerShell to remove dll from GAC:
Set-location "c:\temp"
[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
$publish = New-Object System.EnterpriseServices.Internal.Publish
$publish.GacRemove("c:\temp\test.dll")
iisreset
GacUtil.exe is not present on the server by default.
You can do it using the following script instead of Gacutil.exe
In Windows 2012 you can use the following PowerShell to install dll to GAC
Set-location "c:\temp"
[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
$publish = New-Object System.EnterpriseServices.Internal.Publish
$publish.GacInstall("c:\temp\test.dll")
iisreset
In Windows 2012 you can use the following PowerShell to remove dll from GAC:
Set-location "c:\temp"
[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
$publish = New-Object System.EnterpriseServices.Internal.Publish
$publish.GacRemove("c:\temp\test.dll")
iisreset
Thursday, November 5, 2015
Inside Update panel calendar picker controls are not working
When we are using update panel we may face some issues. In that one of the major issue is using calendar picker control inside update panel.
To over come this issue we have to include the following script tag.
<script type="text/javascript" src="/_layouts/datepicker.js"></script>
Now we can use calendar picker inside update panel without any issues.
thanks,
To over come this issue we have to include the following script tag.
<script type="text/javascript" src="/_layouts/datepicker.js"></script>
Now we can use calendar picker inside update panel without any issues.
thanks,
Inside Update panel people editor is not working
When we are using update panel we may face some issues. In that one of the major issue is using people editor control inside update panel. Update panel does not allow post back. So people editor will not resolve the users.
To over come this issue we have to include the following script tag.
<script type="text/javascript" src="/_layouts/15/entityeditor.js"></script>
Now we can use people editor inside update panel without any issues.
thanks,
To over come this issue we have to include the following script tag.
<script type="text/javascript" src="/_layouts/15/entityeditor.js"></script>
Now we can use people editor inside update panel without any issues.
thanks,
Subscribe to:
Posts (Atom)
Restricting Custom People Picker to only one Sharepoint group programatically
Refer the following script files in your page, <!-- For People Picker --> <script type="text/javascript" src...
-
As i showed how to create a simple jquery tree view, now we are going to do some small modifications to achieve it dynamically. Refer thi...
-
Problem Suspect that because date time control is located under update panel, and page didn’t manage to load in picker’s javascript. ...
-
Here we are going to create a Simple Tree View with out using any plugins Use the below code for tree view nodes: <div class="t...