Wednesday, May 13, 2015

SharePoint 2013 server is not allowing 32bit application

I got a task to setup SharePoint 2013 production environment. Simply I was told by customer that we need SharePoint 2013 setup in single server with Search and Excel services.  I have download AuthoSPInstaller from here and updated the configuration values as per customer need. The AutoSPIntstaller reduce most of my time on installing pre-requisites and SharePoint installation. I will write all in details in separate post.

Post SharePoint 2013 installation, Customer is happy with the configuration and they started using all SharePoint 2013 features. After a week of time customer planned to use same SharePoint server to deploy some 32bit .Net web services. But the deployment was not successful as the SharePoint server not to ready allow any 32bit application.

The issue reported to me then I have investigated the issue and found the problematic place. The global module web config does not have any  property to allow 32bit application. At same time I found some more 32bit related error in event viewer.

The Module DLL 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\isapi\spnativerequestmodule.dll' could not be loaded due to a configuration problem. The current configuration only supports loading images built for a x86 processor architecture. The data field contains the error number. To learn more about this issue, including how to troubleshooting this kind of processor architecture mismatch error, see http://go.microsoft.com/fwlink/?LinkId=29349.

New ISAPI module in SharePoint 2013 stopping our 32 site from loading. Probably part of the new Request Management piece in SP2013 (http://blogs.technet.com/b/speschka/archive/2012/09/14/working-with-request-manager-in-sharepoint-2013.aspx)

I  have verified global section in “ ApplicationHost.config” file which present at %systemroot%\system32\inetsrv\config

Alternatively command prompt can be used list global module section from “ ApplicationHost.config”

  1. Open command prompt
  2. Change directory to %systemroot%\system32\inetsrv (e.g. c:\windows\system32\inetsrv)
  3. Used below command to list all config details.

         appcmd list config  /section:globalmodules

Check the property in SharePoint Native Request Module

< add name="SPNativeRequestModule" image="C:\Program Files\Common Files\Micro
soft Shared\Web Server Extensions\15\isapi\spnativerequestmodule.dll" />

If precondition property not available then update property using below command to enable the server to allow 32bit application.

appcmd.exe set config -section:system.webServer/globalModules /[name='SPNativeRequestModule'].preCondition:integratedMode,bitness64

Once the above command executed successfully then the property of SharePoint Native Request Module will be updated as below.

   
< add name="SPNativeRequestModule" image="C:\Program Files\Common Files\Micro
soft Shared\Web Server Extensions\15\isapi\spnativerequestmodule.dll" preConditi
on="integratedMode,bitness64" />  

Restart the server and verify 32 bit application.

Good luck :-)





Tuesday, May 5, 2015

Retrieve Secure Store Service credentials in SharePoint 2010/13


There are some actions to be taken care manually in SharePoint 2010/13. If any service account password is updated then the same password can be updated using managed accounts which get updated in all the places in same SharePoint Farm. But if SharePoint using any services from other farm then the password will not be updated and create new issue while access the service from other farms.

The account details will be stored in secure store services. To update the new password, SharePoint Administrator should aware or refer any document to find services and currently using credentials. SharePoint 2010 service application does not have any user interface to identify those details quickly. In such case below PowerShell script can be used.

$serviceCntx = Get-SPServiceContext -Site http://kmsnet:12345/
$sssProvider = New-Object Microsoft.Office.SecureStoreService.Server.SecureStoreProvider
$sssProvider.Context = $serviceCntx
$marshal = [System.Runtime.InteropServices.Marshal]

try
{
$applicationlications = $sssProvider.GetTargetApplications()
foreach ($application in $applicationlications)
{
Write-Output "`n$($application.Name)"
Write-Output "$('-'*50)"
try
{
$sssCreds = $sssProvider.GetCredentials($application.Name)
foreach ($sssCred in $sssCreds)
{
$ptr = $marshal::SecureStringToBSTR($sssCred.Credential)
$str = $marshal::PtrToStringBSTR($ptr)
Write-Output "$($sssCred.CredentialType): $($str)"
}
}
catch
{
Write-Output "(Something went wrong) - Error getting credentials!"
}
Write-Output "$('-'*50)"
}
}

catch
{
Write-Output "(Something went wrong) - Error getting Target Applications."
}

$marshal::ZeroFreeBSTR($ptr)