Thursday, February 20, 2014

SharePoint 2010 and SCOM 2012 R2 with APM starts csc.exe instances which overloads the server resources. SCOM 2012 R2 with APM errors with .NET 2.0

The WFE servers resources get overloaded or maxed out with instances of csc.exe running when a site is called.  No real errors are displayed in the event viewer.
Pages do not get loaded due to time outs with the memory and the processors being maxed out.

To resolved till they fix SCOM 2012 R2 APM issues with .NET 2.0, you will need to uninstall from all programs the Microsoft Monitoring and reboot.  Or revert back to SCOM 2012 SP1 agent.

Then all sites are back to normal.  

Tuesday, February 4, 2014

Distributed Cache Powershell commands

From http://technet.microsoft.com/en-us/library/jj219613.aspx
Change the service account running the Distributed Cache
It is recommended to use a SharePoint managed account for this service.
$spfarm = Get-SPFarm
$spcacheService = $spfarm.Services | where {$_.Name -eq “AppFabricCachingService”}
$spaccount = Get-SPManagedAccount -Identity domain\spdistcache$spcacheService.ProcessIdentity.CurrentIdentityType = “SpecificUser”
$spcacheService.ProcessIdentity.ManagedAccount = $spaccount
$spcacheService.ProcessIdentity.Update()
$spcacheService.ProcessIdentity.Deploy()

Graceful stop and deattach local server (No lost cache data)
Stop-SPDistributedCacheServiceInstance -Graceful
Remove-SPDistributedCacheServiceInstance
Deattach local server from a cache cluster (Multiple Distributed Cache servers)
Remove-SPDistributedCacheServiceInstance
Reattach local server to a cache cluster (Multiple Distributed Cache servers)
Add-SPDistributedCacheServiceInstance
Delete the service
$instanceName =”SPDistributedCacheService Name=AppFabricCachingService”
$serviceInstance = Get-SPServiceInstance | ? {($_.service.tostring()) -eq $instanceName -and ($_.server.name) -eq $env:computername}
$serviceInstance.delete()
Verify in Central Admin, System Settings, Manage Services on Server. It should be gone from this list when it has been completely deleted.
In a multi server farm, you will have to select which server to show the services from in the top-right dropdown.
Create a new service
Add-SPDistributedCacheServiceInstance
Verify in Central Admin, System Settings, Manage Services on Server. It should appear in this list when it has been created. In a multi server farm, you will have to select which server to show the services from in the top-right dropdown.
Start the service on a server
$instanceName =”SPDistributedCacheService Name=AppFabricCachingService”
$serviceInstance = Get-SPServiceInstance | ? {($_.service.tostring()) -eq $instanceName -and ($_.server.name) -eq $env:computername}
$serviceInstance.Provision()
Stop the service on a server
$instanceName =”SPDistributedCacheService Name=AppFabricCachingService” $serviceInstance = Get-SPServiceInstance | ? {($_.service.tostring()) -eq $instanceName -and ($_.server.name) -eq $env:computername}
$serviceInstance.Unprovision()
Check current Cache memory allocation
Use-CacheCluster Get-AFCacheHostConfiguration -ComputerName $env:computername -CachePort “22233″
Change the Cache memory allocation
On all Cache servers in the farm stop the service
$instanceName =”SPDistributedCacheService Name=AppFabricCachingService” $serviceInstance = Get-SPServiceInstance | ? {($_.service.tostring()) -eq $instanceName -and ($_.server.name) -eq $env:computername}
$serviceInstance.Unprovision()
Update the memory allocation
Update-SPDistributedCacheSize -CacheSizeInMB CacheSize
Start the service on all Cache servers
$instanceName =”SPDistributedCacheService Name=AppFabricCachingService” $serviceInstance = Get-SPServiceInstance | ? {($_.service.tostring()) -eq $instanceName -and ($_.server.name) -eq $env:computername}
$serviceInstance.Provision()


Remove a host from the cluster: if all else failes
Stop-CacheHost -HostName <servername> -CachePort 22233


Unregister-CacheHost -HostName <servername> -RemoveServicePermissions -ProviderType SPDistributedCacheClusterProvider -ConnectionString 'Data Source=<dbservername>;Initial Catalog=<SharePoint_Config>;Integrated Security=True;Enlist=False'