Thursday, October 10, 2013

SP Powershell command for Backup and Restore

site collection backup:
backup-spsite -identity http://gss-w7g-0793 -path \\GSS-W7G-0793\share\rootsite.bak

restore:
restore-spsite -identity http://gss-w7g-0793 -path \\GSS-W7G-0793\share\rootsite.bak



site backup
export-spweb -identity "http://gss-w7g-0793/Training Blank Site" -path \\GSS-W7G-0793\share\TrainingBlank.cmp -IncludeUserSecurity

restore
import-spweb -identity "http://gss-w7g-0793/Training Blank Site" -path \\GSS-W7G-0793\share\TrainingBlank.cmp  -IncludeUserSecurity


document library backup
export-spweb -identity http://gss-w7g-0793 -path \\GSS-W7G-0793\share\DocumentLib.cmp -itemurl /DC

document library restore
Import-SPWeb -Identity http://gss-w7g-0793 –Path \\GSS-W7G-0793\share\DocumentLib.cmp –UpdateVersions -Overwrite


list backup
Export-SPWeb -Identity http://gss-w7g-0793 -Path \\GSS-W7G-0793\share\listBackup.cmp -ItemUrl "/Lists/Calendar"

restore
Import-SPWeb http://site –Path export.cmp –UpdateVersions -Overwrite


document library backup
Export-SPWeb -Identity http://gss-w7g-0793 -Path C:\SP2010_Backups\testlibbkp2s.cmp -ItemUrl test -Force






Tuesday, October 1, 2013

SPServiceApplicationPool

Get-SPServiceApplicationPool 
# This will show all service application pool 
Remove-SPServiceApplicationPool TestServiceWebApplicationPool
# This will remove service application pool 

Thursday, September 26, 2013

AZURE ACS for SharePoint powershell command

$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2("C:\Certs\AzureACS.cer")
$map1 = New-SPClaimTypeMapping -IncomingClaimType "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress" -IncomingClaimTypeDisplayName "emailaddress" –SameAsIncoming
$realm=”http://india.internal.com/”
$ap=New-SPTrustedIdentityTokenIssuer -Name "Azure ACS_indigo" -Description "For india.internal.com" –Realm $realm -ClaimsMappings $map1 -ImportTrustCertificate $cert -SignInUrl "https://thisisatest-sb.accesscontrol.windows.net/v2/wsfederation?wa=wsignin1.0&wtrealm=http://india.internal.com/" -IdentifierClaim $map1.InputClaimType
New-SPTrustedRootAuthority -Name "ACS_sp2013_indigo" -Certificate $cert


https://thisisatest-sb.accesscontrol.windows.net/v2/wsfederation?wa=wsignin1.0&wtrealm=http://globalapp.internal.com/

$ap=Get-SPTrustedIdentityTokenIssuer

http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress

Delete services using Powershell

$spapp = Get-SPServiceApplication -Name "Search Service Application 1"
Remove-SPServiceApplication $spapp -RemoveData


Get all the spServiceApplicationProxy

Get-spServiceApplicationProxy

Get-spServiceApplicationProxy 67f73fe6-723a-4350-842a-1fb19a2e52cb | remove-spServiceApplicationProxy

Wednesday, July 3, 2013

SharePoint 2010 Login as another user in SharePoint 2013

Due to Security issue and cache load, In SharePoint 2013 this has been hidden.

You can try to login with below url to get the windows prompt for login with another user.

http://<site url>/_layouts/closeConnection.aspx?loginasanotheruser=true

Sunday, June 2, 2013

Step by step working with SharePoint BCS


To do.
1) Create a table in your SQL server database. Script is below.

CREATE TABLE [dbo].[TblBCS](
[ID] [nchar](10) NULL,[Name] [varchar](50) NULL,[LastName] [varchar](50) NULL)
ON [PRIMARY])

2) Go to CA -> System settings -->Manage services on server 


   Check the "Secure Store Service" is working fine.

3) Create a user account at domain leve, I have created "kumarsji"
4) Go to CA > Application management   >  Manage service applications
5) Go to "secure store service"
6) click on the new button on the ribbon menu.

 
7) Enter the details as below, Check also Contact E-mail .

8) Click on next.

9) Do not change anything click on next.

10) Select Site collection Admin in the first box and put users to other box as below.

11) After clicking on ok button , We have to set credential as below.


12) Will set the credential as below.


13) Go to sharepoint designer open site go to external content type.As below.



Wednesday, May 29, 2013

Creating Content DB with New Site Collection



Better way to approach creating the new site collection in the specific content database is to use New-SPContentDatabase and New-SPSite PowerShell commands.

    Step 1- Add New Content DB to the Web Application

New-SPContentDatabase -Name WSS_Content_Accounts -WebApplication http://sp2010

    Step 2- Create New Site Collection with Top Level Site Based on Team Site Template in the New Content DB

New-SPSite http://sp2010/sites/accounts -OwnerAlias “Training\Administrator” -ContentDatabase WSS_Content_Accounts -Name “Account Sites” -Description “Account Sites Container” -Template “STS#0?

HTML

Script:

JS