Pages

Showing posts with label Sharepoint Admin. Show all posts
Showing posts with label Sharepoint Admin. Show all posts

Tuesday, January 23, 2018

All Power shell Backup Commands for SharePoint Site


Backup Site Collection

Backup -SPSite http://spuat/sites/SG -Path C:\Backup\SGSite.bak

Restore Site Collection

Restore-SPSite http://spuat:222/sites/SG  -Path C:\Backup\SGSite.bak -Force

Monday, January 8, 2018

Truncate WSS_Logging MDF and LDF database in the Sharepoint Server

we try to access our SharePoint site and notice that site does not load and instead throws an error. 
we investigate the error and find out that it has something to do with the WSS_Logging database when check WSS_LOGGIN MDF file size has more than 100 GB out of 120 GB Disk space. 
It is a common problem and If you are facing this type of issue, truncate your WSS_Logging DB and you should be follow in the below steps:

1.       Open your SQL UI. Right click WSS_Logging DB and go to Reports > Disk Usage OR Reports > Standard Reports > Disk Usage.

Figure 1: Disk Usage

2.       In the disk usage report, expand the second node to see current disk usage. It should be full.



3.       Right-click WSS_Logging B and select “New Query” and paste the following script in the window and then hit F5 to execute it. NOTE: This script was copied from the following link:


Script:

·         DECLARE @TableName AS VARCHAR(MAX)
DECLARE table_cursor CURSOR
FOR
SELECT TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE'
AND TABLE_NAME LIKE '%_Partition%'
OPEN table_cursor
FETCH NEXT FROM table_cursor INTO @TableName
WHILE @@FETCH_STATUS = 0
BEGIN
DECLARE @SQLText AS NVARCHAR(4000)

SET @SQLText = 'TRUNCATE TABLE ' + @TableName

EXEC sp_executeSQL @SQLText

FETCH NEXT FROM table_cursor INTO @TableName
END
CLOSE table_cursor
DEALLOCATE table_cursor


Different people have written different scripts to truncate the table. This one is a tested solution and works perfectly.

4.       After executing the query, go back to the disk usage report and now you should see that the database is empty. Open your SharePoint site and it should work.


After that we shrink MDF files from SQL Server management studio then WSS Logging MDF files has reduced disk size and which is working fine and tested in my environment.








Tuesday, June 13, 2017

Using PowerShell to Get SharePoint Content database size

To get the all CONTENT_DB  size in SHAREPOINT server(MB), Using below commands power shell commands.


Get-SPDatabase | Sort-Object disksizerequired -desc | Format-Table Name, @{Label ="Size in MB"; Expression = {$_.disksizerequired/1024/1024}} >c:\Content_DBsize.txt

The above code will export to C drive and you can change drive for your requirement.

Monday, May 8, 2017

Inherit Subsite Master Page from Parent Master Page in Sharepoint Foundation 2013

Do you want to change the master page setting for just one site, then use the script below:

$web = Get-SPWeb siteurl
$web.MasterUrl = "masterpagerelativeurl"
$web.Update()
$web.Dispose()

The script would be as follows:

$web = Get-SPWeb http://portal/sites/collaboration
$web.MasterUrl = "/sites/collaboration/_catalogs/masterpage/customSeatle.master"
$web.Update()
$web.Dispose()

Refreshing the root site in the browser will show the new master page design, but all sub-sites will still show the old master page design – this is because they are each using a master page stored on their respective site. To change the master page setting for all sites in a site collection, use the following script:

$site = Get-SPSite http://portal/sites/collaboration
$site | Get-SPWeb -limit all | ForEach-Object { $_.MasterUrl = "/sites/collaboration/_catalogs/masterpage/customSeatle.master";$_.Update() }
$site.Dispose()

Note that this will only change existing sites and will not set a custom master page for any new sites created. To update new sites, you will need to either run the script every time a new site is created, or use an alternative approach such as a feature receiver/stapler or Web provisioning event receiver to automatically set the new master page on site creation.

Do you want to revert all team sites in the site collection back to using their own default master page again, then use the following script:

$site = Get-SPSite http://portal/sites/collaboration
$site | Get-SPWeb -limit all | ForEach-Object { $_.MasterUrl = $_.ServerRelativeUrl + "/_catalogs/masterpage/v4.master";$_.Update() }
$site.Dispose()

Tuesday, February 14, 2017

Add Active Directory Module for Windows Powershell

Add Active Directory Module for Windows Powershell

Open Server Manager and Add role for Windows Powershell








Thursday, July 9, 2015

LDAP/AD Claims Provider For SharePoint 2013


I just configured  LDAPCP with ADFS. But I am not able to access the different domain users (abcd users) with sp site.

My configuration is:

I have Wxyz Ad Domain with Wxyz sharepoint 2013 server and have abcd domain and abcd adfs server.

Already configured ADFS server and deployed LDAPCP WSP(codeplaex) solution successfully,added LDAP connection in security on SP central Admin.

The people picker is retreiving abcd user name john and added in the sp site.

Issues occured:

when I am trying to access the Sharepoint site with abcd domain user's(john) on the AD FS server. It is showing in the below error

Error displaying:

Sharepoint Site Error:


Sorry, this site hasn't been shared with you.

Event viewer Error:

A Certificate validation operation took 15019.4231 milliseconds and has executed the execution time threshold.
If this continues to occur, it may represent a configuration issue.



Solutions:


Identifier Claim should be email address in the powershell script and set claim mapping should be Samsaccountname  = emailaddress on the AD FS server

Add ABCD user login id in the sharepoint sites and try to access the sp pages from AD FS Servers using cliam based authentication.

Finally we logged in successfully for ABCD users on the Sharepoint Sites.


Thursday, April 16, 2015

How to search SharePoint users in the User Information List


To find the User Information List in the sharepoint, You need to enter the below URL

http://SPSiteName/_Catalogs/users/simple.aspx

Then you can search either User ID or Email or FirstName or Last Name

Saturday, December 20, 2014

stsadm commands for sharepoint

echo off
set SPAdminTool=%CommonProgramFiles%\Microsoft Shared\web server extensions\12\BIN\stsadm.exe
set TargetUrl=http://starwood/
C:\Program Files\CommonProgramFiles\Microsoft Shared\web server extensions\12\BIN\stsadm.exe


Remove solution
stsadm.exe -o deactivatefeature -name fnb.timerjob -url http://starwood/ -force
stsadm.exe -o uninstallfeature -name fnb.timerjob -force

stsadm.exe -o retractsolution -name fnb.timerjob.wsp -immediate -allcontenturls
stsadm.exe -o execadmsvcjobs
stsadm.exe -o deletesolution -name fnb.timerjob.wsp
stsadm.exe -o retractsolution -name fnb.timerjob.wsp -immediate -allcontenturls

Add Solution

stsadm.exe -o addsolution -filename fnb.timerjob.wsp
stsadm.exe -o deploysolution -name fnb.timerjob.wsp -immediate -allcontenturls -allowgacdeployment
stsadm.exe -o deploysolution -name fnb.timerjob.wsp -immediate -allowgacdeployment
stsadm.exe -o execadmsvcjobs
stsadm.exe -o installfeature -name fnb.timerjob -force
stsadm.exe -o activatefeature -name solutionManager -url http://starwood/ -force

Tuesday, November 18, 2014

Create first sharepoint 2013 App,Develop and Deploy on the sharepoint server



Add DNS Server via server Role

 


Get IP Address
 








Add New Domain for App like karthiapp.com




Add wildcards





Add Host entry on the drive\etc\host







GO to central Admin and configure App URL





Login as spsfarm not as System Admin account and Open Visual studio shift + Right Click with different user (login as spsfarm) on the visual studio solution file


If deployment is restricted for administrator privileges then Login with windows as spsfarm than you can deployed


Once deployed you can see the app in the SharePoint sites




If you click on the app that content won’t display and it is asking three times for credentials


Disable Loop Back Check



In HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa, create a DWORD for DisableLoopbackCheck and enter a value of “1” (hexadecimal).


Note: I Just created DisableLoopBackCheck ,it was throw error, so this case sensitive


Follow the below steps






Reset the IIS


Then finally it will show your apps