Tag Archives: SharePoint 2013

How to enable PowerShell remoting to execute tasks remotely in SharePoint

Here’s a quick and short summary on enabling PowerShell Remoting(PSRemoting) so you can perform SharePoint administration by using powershell to run SharePoint commands on a SharePoint server from your local laptop or workstation.

Consider an environment with SharePoint server XYZ.contoso.com

Server-side Steps:

On server XYZ.contoso.com, open Windows powershell and run the following commands:

 $computer = “XYZ”

winrm quickconfig 

Enable-WSManCredSSP -Role Server 

Connect-WSMan -ComputerName $computer

Set-Item “WSMAN:\$computer\service\auth\credssp” -Value $true

 

Client-side Steps:

Enable Windows Remoting and CredSSP

On the local workstation or laptop from where you want to connect to the server XYZ, open Windows powershell and run the following commands:

winrm quickconfig

Enable-WSManCredSSP -Role client -DelegateComputer XYZ.contoso.com –Force

 

Enabling in registry

Open registry by going to Run ->  regedit. Add the following entry to registry:

Set-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\Credssp\PolicyDefaults\AllowFreshCredentialsDomain -Name WSMan -Value “WSMAN/*.contoso.com”

Allowing Credential delegation via Group Policy

Now make following changes to Group Policy:

Go to Run -> gpedit.msc

Navigate to

Computer Configuration > Administrative Templates > System > Credentials Delegation

Double-click

Allow Delegating Fresh Credentials

Select               Enabled

Click                  Add servers to the list: Show

Add WSMAN/*contoso.com

Click                  OK

Click                  OK

Go to Run -> gpedit.msc

Navigate to

Computer Configuration > Administrative Templates > System > Credentials Delegation

Double-click

Allow Delegating Fresh Credentials with NTLM-only Server Authentication

Select               Enabled

Click                  Add servers to the list: Show

Add WSMAN/*contoso.com

Click                  OK

Click                  OK

GP

GP2

PS Remoting

Now we can test the powershell remote connection. On your local workstation where you enabled PS Remoting using the client side steps above, type:

Enter-PsSession -computer U1VMPRTNRPCS01.production.online.dell.com -Auth Credssp -Credential “domain\serviceaccount”

PSSession

You would see a popup window again prompting you for credentials. Once you enter, it should now change shell to XYZ.contoso.com. Enable SharePoint Snapin using:

 

[XYZ.contoso.com]: PS C:\WINDOWS\system32> Add-pssnapin microsoft.sharepoint.powershell

 

To test whether you can execute SharePoint commands, try any command like:

[XYZ.contoso.com]: PS C:\Users\<serviceaccount>\Documents> Get-SPSolution

PSSnapin

Now you can execute SharePoint commands using powershell. Once done just close the powershell window or type “exit” to return back to the shell of your machine.

Note: As a security practice disable Win remoting and Cred SSP on Production machines after use using following commands:

Disable-WSManCredSSP -Role Server

Set-Item “WSMAN:\$computer\service\auth\credssp” -Value $false

Happy PSRemoting!! 🙂

Advertisements

SharePoint 2013 SP1 installation failing with event id: 1000, “Faulting application name: MsiExec.exe”

I was trying to build a new box with SharePoint 2013 SP1 slipstreamed. The install kept failing with the error:

Log Name: Application
Source: Application Error
Event ID: 1000
Task Category: (100)
Level: Error
Keywords: Classic
User: N/A
Computer: *****
Description:
Faulting application name: MsiExec.exe, version: 5.0.9600.16384, time stamp: 0x5215f49e
Faulting module name: KERNELBASE.dll, version: 6.3.9600.16408, time stamp: 0x523d557d
Exception code: 0xe06d7363
Fault offset: 0x000000000000ab78
Faulting process id: 0x1718
Faulting application start time: 0x01cf58bdd3e6f830
Faulting application path: C:\Windows\System32\MsiExec.exe
Faulting module path: C:\Windows\system32\KERNELBASE.dll
Report Id: 7b39da05-c4b1-11e3-80c1-1803732dc367

 

None of the steps like re-registering msiexec, clearing temp folder, rebooting computer etc. helped.

Finally, my friend Nishant Shah, a SharePoint Support Escalation Engineer in Microsoft asked me to check the following registry entries and delete them if  present: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\FileRenameOperations

I found there was an entry for FileRenameOperations and deleted that registry key.

Lo, this time the SharePoint install went on flawlessly. (Thanks Nishant!! 🙂 )

Hope this bit helps you if you encounter a similar issue.

SharePoint 2013–While updating a list or adding a new user, getting error “The server was unable to save the form at this time. Please try again”

Recently users and I started getting error when trying to update a list or adding a new user:

The server was unable to save the form at this time. Please try againimage

server error

As a Farm administrator and site collection administrator, I had full access to the site. Also, earlier I had no issues updating lists, so it was flabbergasting at first why this error was cropping up.

Then I remembered that the only change I made to environment was to add multiple bindings in the site.

e.g.

I had added both server:8080 and server.production.online.domain.com:8080 to IIS bindings.

Further, a quick search on the net gave me multiple articles about WCF having issues with multiple bindings (http://mrhodes.net/2010/03/30/sharepoint-designer-2010-the-server-could-not-complete-your-request-the-content-type-of-the-response-is-8/, http://social.msdn.microsoft.com/Forums/vstudio/en-US/96390c8b-efa1-4471-8f36-6cd615c5f120/iis-hosted-wcf-with-two-bindings?forum=wcf etc.)

So, as soon as I removed the additional binding e.g. server:8080, I was able to edit lists without the above error!

SharePoint 2013 – Fix all issues reported in “Content Deployment Source Status”

 

Content deployment steps have changed a bit with SharePoint 2013.  It has introduced an option to do a “Source Status check” in which can be found in Central Administration under –> General Application Settings –> Configure content deployment.

image

 

 

If this is enabled at Destination site, you cannot create a Content Deployment Path\Job until you fix all the issues.

 

image

 

As such when you proceed to create a content deployment path, it might fail and ask you to fix issues at source.

To find issues at source,  on a Source Site Collection e.g. I have used a site collection http://<>:8080/sites/channel. Go to Site Settings -> Content Deployment Source Status and verify there are no errors.

image

 

In case you cant find it, you need to enable the feature from Site collection Features

 

image

 

image

 

 

After you enable Content Deployment Source Status and go there, if errors are seen, e.g. missing features, remove them using PowerShell or a tool like SharePoint Feature Admin Tool.

image

 

After you do remediation the page should show no errors as below

image

Remediation with SharePoint Feature Admin Tool

Disclaimer: SharePoint Feature Admin is a free third party tool available from Microsoft CodePlex site. While I have had no issues at all with it and would highly recommend this tool for its ease of use, please use it at your own risk. Be sure to test it on Test\Development environment before testing on Production.

 

Launch the FeatureAdmin2013.exe with Admin\Service Account.

i. Under Web applications, select Channel – 8080,

ii. Under Site Collections within this Web Applications select http://<server or FQDN>/sites/channel

iii. Click Find Faulty Feature in Farm

image

iv. For each Faulty feature found, it will show a popup and give option to remove it. Click Ok until all faulty features are removed.

image

v. Now select http://<server or FQDN>/sites/channel in Web site within selected Site Collection, select Remove/Deactivate features in selected sites, check all features showing error and click first on Remove Feature from Farm and it says it’s a site collection feature then click on Remove from selected Site Collection.

image

vi. Click Ok on the popup

image

vii. Click on Reload Web apps and then repeat steps i, ii, and v. Cycle through each subsite and remove any error feature by first clicking on Remove Feature from Farm and it says it’s a site feature clicking on Remove from selected Site(SPweb) until all faulty(or unwanted or missing) features are removed.

Remove faulty/missing/unwanted features listed in Content Deployment Source Status page using same steps listed above.

image

e.g. Ratings is listed as an unsupported feature at Home which is http://<server>/sites/channel

image

In FeatureAdmin Tool, select site collection and locate the Ratings feature under Remove/deactivate features in selected sites and then click on Remove feature from farm.

image

Click Yes on the popup.

image

Similarly locate and remove all missing\unsupported\unwanted features from both Site Collection Features (SPSite) and Site Features (SPWeb) until the Content Deployment Source Status page shows no more errors .

Once all errors are removed, SharePoint will allow you to create a content deployment path and job for that site collection.

SharePoint 2013 – Error while creating a new site “New-SPSite : User cannot be found.”

 

I wanted to do a content deployment to a new farm and wanted to create a new blank site using powershell:

New-SPSite -Url http://<servername>:8080/sites/test –OwnerEmail  <email address> –OwnerAlias domain\<account>

 

. While trying to create a new site, I got the following error:

New-SPSite : User cannot be found.
At line:1 char:2
+  New-SPSite -Url http://<servername>:8080/sites/tes
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (Microsoft.Share…SPCmdletNewSite:SPCmdletNewSite) [New-SPSite], SPException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletNewSite

 

I was initially stumped. Only the other day I had created a new site successfully, why would it fail now?

I tried creating a new site using Central Administration and it still failed with error “Sorry, something went wrong   User cannot be found”:

 

image

But, I was able to create a new site collection on another farm using the same account. Also I was able to create a new site collection on on a new test web application on the problem server with this user account.

Turns out the issue was due to enabling Trusted Identity Provider (STS) for Forms login for external users  on an extended site. For some reason, after enabling STS,  SharePoint was failing to identify Windows NT id .

Funny thing was this was not enabled on http://<servername>:8080/sites/test but on extended site http://<servername>:80/sites/test. I have not investigated on why this happens yet.

 

image

 

So, my best guess is, with STS enabled SharePoint wants to resolve users in the format  i:0#.w|domain\account and this creates problem. (btw, I had already tried creating a new site using

New-SPSite -Url http://<servername>:8080/sites/test –OwnerEmail <email address> –OwnerAlias  i:0#.w|domain\account

But that did not work either.

But what I did find was that if I disabled the Trusted Identity provider by unchecking the box, I could create a new site without error.

SharePoint 2013 content deployment– Export fails with error Exception of type ‘Cobalt.ErrorException’ was thrown.

 

I was performing a Full content deployment and the Export phase failed with the following error seen in ImportExportLogs:

 

Exception of type ‘Cobalt.ErrorException’ was thrown.

[2/20/2014 6:44:43 AM] Debug:    at Cobalt.Roundtrip.ThrowIfAnyError()

   at Cobalt.DataElementGraphOnEndpoint.OnCacheDataElements(CollectionAtom`1 dataElementIds)

   at Cobalt.DataElementGraph.GetDataElement(DataElementId dataElementId, Boolean nullIfNotFound, Boolean excludedDataOk)

   at Cobalt.DataElementGraph.DataElementNode.EnsureDataElementFullyPopulated()

   at Cobalt.ObjectLoadStateInternal.TryGetDataForPartition(PartitionId partitionId, Atom& data)

   at Cobalt.ObjectLoadStateInternal.GetDataForPartition(PartitionId partitionId)

   at Cobalt.BinaryObjectNode.get_DataForRead()

   at Cobalt.GenericFdaGraph.IntermediateNode.FindDataInternal(Range absoluteRangeToFind, UInt64 absoluteOffsetOfThis, Boolean regenerateNodeSignatures, LeafDataNode& leafDataNode, Range& leafNodeAbsoluteRange)

   at Cobalt.GenericFdaGraph.IntermediateNode.FindDataInternal(Range absoluteRangeToFind, UInt64 absoluteOffsetOfThis, Boolean regenerateNodeSignatures, LeafDataNode& leafDataNode, Range& leafNodeAbsoluteRange)

   at Cobalt.GenericFdaStream.OnReadFromBackingStore(Range rangeToRead, Byte[] buffer, Int32 offset)

   at Cobalt.SmartSizingBytesBase.Read(Range rangeToRead, Byte[] buffer, Int32 offset)

   at Cobalt.OnDemandBytes.Read(Range rangeToRead, Byte[] buffer, Int32 offset)

   at Cobalt.Bytes.Read(Int64 sourcePosition, Byte[] buffer, Int32 offset, Int32 count)

   at Cobalt.Bytes.ReadIfPossible(Int64 sourcePosition, Byte[] buffer, Int32 offset, Int32 count)

   at Microsoft.SharePoint.LockBytesFromBytes.ReadAt(Int64 offset, Byte* pv, UInt32 cb, UInt32& pcbRead)

   at Microsoft.SharePoint.CobaltStream.ReadAt(Int64 offset, Byte* pv, UInt32 cb, UInt32& pcbRead)

[2/20/2014 6:57:23 AM] Progress: Export did not complete.

[2/20/2014 6:57:23 AM] Finish Time: 2/20/2014 6:57:23 AM.

[2/20/2014 6:57:23 AM] Duration: 10:39:04

[2/20/2014 6:57:23 AM] Total Objects: 578346

[2/20/2014 6:57:23 AM] Finished with 686 warnings.

[2/20/2014 6:57:23 AM] Finished with 36 errors.

On checking application event logs on the SharePoint server, I found this:

Critical   2/20/2014 7:03:31 AM    SharePoint Foundation 3355       Database

Critical   2/20/2014 7:02:27 AM    SharePoint Foundation 3355       Database

Critical   2/20/2014 7:01:24 AM    SharePoint Foundation 3355       Database

Critical   2/20/2014 7:00:21 AM    SharePoint Foundation 3355       Database

Event log 3355 said:

Log Name:      Application

Source:        Microsoft-SharePoint Products-SharePoint Foundation

Date:          2/20/2014 7:03:31 AM

Event ID:      3355

Task Category: Database

Level:         Critical

Keywords:     

User:          ***********

Computer:      *************

Description:

Cannot connect to SQL Server. *******.production.online.****.com not found. Additional error information from SQL Server is included below.

Connection Timeout Expired.  The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement.  This could be because the pre-login handshake failed or the server was unable to respond back in time.  The duration spent while attempting to connect to this server was – [Pre-Login] initialization=21048; handshake=0;

Turns out that Export will fail with Cobalt exception if there is a network issue or a SQL connectivity issue.

Also, we are using SQL cluster with Always On. SharePoint was having issues connecting to the SQL AGL name (SQL cluster name). So I used the tool cliconfig.exe on both source and destination SharePoint servers to point it to an active individual server of the SQL cluster.

image

Now the content deployment completed successfully without ‘Cobalt.ErrorException’