job admin apppool change FIXED

Error when trying to change the password for a Managed Account in SharePoint 2010:

Error deploying administration application pool credentials.
Another deployment may be active. An object of the type
Microsoft.SharePoint.Administration.SPAdminAppPoolCredentialDeploymentJobDefinition named
“job-admin-apppool-change” already exists under the parent Microsoft.SharePoint.Administration.SPTimerService named “SPTimerV4”. Rename your object or delete the existing object.

In my case, I needed to change the account that the SharePoint 2010 Timer service was running as. Every time I tried to update the password, the Timer would stop and the update would fail. Once I changed the Run As of the Timer, I was able to update the password.

Add-PSSnapin Microsoft.SharePoint.PowerShell -EA silentlycontinue

$m = Get-SPManagedAccount -Identity "domain\YourAccount"

Set-SPManagedAccount -Identity $m  -ExistingPassword (ConvertTo-SecureString "Your PASSWORD" -AsPlainText -force) –confirm

SharePoint SQL Server Errors

Another day of SharePoint fun!
DBA changed a service account password, then failed-over the cluster to a different node. Roughly one hour later, one of the WFE boxes pegged the CPU at 100% for an extended period of time. We also run KnowledgeLake, and the search web part would not load.

First, I directed our load balanced traffic to another WFE box. Once all the open connections were closed, I fired off an iisReset. This alleviated the CPU load.

BUT, the KnowledgeLake web part would not load AND the logs on one of the app servers had the below errors.

Fix? After hours I rebooted the app server in question. Errors stopped appearing and the KnowledgeLake web part loaded.

Unknown SQL Exception -2146893055 occurred. Additional error information from SQL Server is included below.

A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 – The handle specified is invalid)

Event ID 5586

Cannot connect to SQL Server. ServerName not found. Additional error information from SQL Server is included below.

Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

Event ID 3355

SQL Database ‘WSS_Logging’ on SQL Server instance ‘ServerName’ not found. Additional error information from SQL Server is included below.

Cannot open database “WSS_Logging” requested by the login. The login failed.
Login failed for user ‘domain\webAppAccount’.

Event ID 3760

The crawler could not communicate with the server. Check that the server is available and that the firewall access is configured correctly

The crawler could not communicate with the server. Check that the server is available and that the firewall access is configured correctly.

Unable to access object.

SharePoint 2010

Broke my content sources out by Site Collection. After doing this, my crawls would take a LONG time or I would see thousands of errors like the ones above.

In IE, I signed into SharePoint using the default content access account that the SSA uses to crawl content. When I navigated to the Site Collection that was error-ing out, I could not open any of the site page(s) or content.

Steps I followed to fix the issue.
Using my personal account, I opened the Site Collection.
In the top right corner of the browser I clicked on my name, then selected Sign in a Different User.
Signed in using the crawl account (default content access account).
Then reloaded the page. It took several tries before the page would load.

Once the page(s) started loading, the crawler was able to crawl the site(s).

Paused by system

If your Search Service Application shows a crawl status of Paused for:External request or Paused by system . You can use the following script to get it back online.

$ssa = Get-SPEnterpriseSearchServiceApplication “YOUR Search Service Application name here”

Resume-SPEnterpriseSearchServiceApplication $ssa

*NOTE*
Your Search App might be named something different than Search Service Application.
To find your Searh App name, navigate to your Central Admin site, under Application Management, click on Manage service applications. In the Type column, look for an item that says Search Service Application.

and credit for this post goes to a super smart coworker.

Use PowerShell to Create SharePoint Groups

Simple enough, needed to create a few SharePoint groups and thought PowerShell would be the best answer.


$SiteUrl = "http://sharepointed.com/sites/a"
$Web = Get-SPWeb $SiteUrl

$description = “Super cool stuff”
$permissionLevel = “Read”

$groups = “Group A”, “Group B”, “Group C”

foreach($groupName in $groups)
{
$web.SiteGroups.Add($groupName, $web.SiteUsers[“domain\SomeUser”], $web.SiteUsers[“domain\SomeUser”], $description)
$group = $web.SiteGroups[$groupName]
$roleAssignment = new-object Microsoft.SharePoint.SPRoleAssignment($group)
$roleDefinition = $web.Site.RootWeb.RoleDefinitions[$permissionLevel]
$roleAssignment.RoleDefinitionBindings.Add($roleDefinition)
$web.RoleAssignments.Add($roleAssignment)
$web.Update()
}

$web.SiteGroups.Add(name, owner, default user, description)

Parameters
name
Type: System.String
A string that represents the new group name.
owner
Type: Microsoft.SharePoint.SPMember
An SPMember object that specifies the owner.
defaultUser
Type: Microsoft.SharePoint.SPUser
An SPUser object that specifies the default user for the group.
description
Type: System.String
A string that contains a description for the group.

More details:
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spgroupcollection.add.aspx

To get all the uses / groups from a site or web see this post:

http://www.sharepointed.com/2016/10/17/get-all-groups-and-users-in-a-site-collection-or-web/

 

Monitor and Report on Long Running Crawls

Ever needed to know if your SharePoint crawls are running too long? I wrote the below script to keep an eye on my crawls, and report if they are running too long.

In the script, I’m getting the Search Service App. Looping through its content sources, then finding crawls that are running longer than 5 minutes.

#Get PowerShell Snapin
if ((Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null)
{
	Add-PsSnapin Microsoft.SharePoint.PowerShell
}

#get your Search Service App
$ssa = Get-SPEnterpriseSearchServiceApplication "Search Service Application"

#get the content sources from your Search Service App
$contentsources = Get-SPEnterpriseSearchCrawlContentSource -SearchApplication $ssa 


#loop through the content sources
foreach($cs in $contentsources)
{
	#check for crawls that are running
	if ($cs.CrawlStatus -ne "Idle")
	{			
		$cLength = New-TimeSpan -Start ($cs.CrawlStarted) -End (Get-Date) 
		$cLength = $cLength.Minutes
		
		#if the crawl has been running for more than X minutes, send an email
		if($clength -gt 5)
		{
			#email someone that cares
		}
	}
}

SharePoint Crawls and Security Updates

Keeping an eye on my SharePoint crawls, I noticed some crawls were taking a long time.
The crawls were picking up a few items, but then I noticed the number of security updates.

Thanks to my friend Google, I found this posting on the subject.

A clip from the posting:

Question:

Why do security only crawls take so long?

Answer:

The time difference in crawl can be attributed to expansion of the SharePoint Group and also that the group is at the site collection level and affects items beyond the list. If a Sharepoint group has several thousand users at site collection level, you can see how this can be very expensive. Also, a large number of items within that site collection can add to the delay because new ACL changes will be pushed down to every item affected by the security change.

Question:

How can I work around this and prevent security only crawls from affecting incremental crawl times?

Answer:

Instead of users explicitly added to SharePoint groups, add AD groups instead. Managing adding/removing users from Active Directory security groups will not cause ACL changes within SharePoint. Because of this, no security only crawls will occur.

*Update*

Read this:

http://blogs.msdn.com/b/kaevans/archive/2013/05/06/clarifying-guidance-on-sharepoint-security-groups-versus-active-directory-domain-services-groups.aspx

Modify Search Topology Stuck on Processing

More than once I’ve had this happen. For one reason or another, a change to the SharePoint Search Topology needed to be made.

Go in, add a new crawler or partition index, click save, and the page gets stuck on

Processing….
Please wait while your changes are processed for SharePoint Server Search.

sharepoint-search-stuck-processing

Okay, one thing I’ve found to help avoid this issue. Make sure the SharePoint Admin service is running on each box in the farm BEFORE making any updates to the search topo.

Fix:

Navigate to timer job definitions.
http://YourCentralAdminSite/_admin/ServiceJobDefinitions.aspx

Change the View to Service
then change
Service: SharePoint Server Search

Run the Configuring the existing search service application SharePoint Server Search job.

Go back and check the modify topology page.

Remember, make sure the Admin Service is running!

*NOTE*
In the comments, user SM pointed out that the Configuring the existing search…. job may not appear unless it needs to be executed.

SharePoint Not Crawling List or Library

SharePoint search results were not correct or would be missing some data. After hours of digging around, I noticed that one Search Scope was empty. To try and fix this, I went as far as reseting the search index, yes, clearing out all the search data. No fun!

Here is what I found to work.

List Settings
Allow items from this list to appear in search results?
Change this to NO
Run a crawl on the Content Source.
Go back to List Settings.
Allow items from this list to appear in search results?
Change this to YES
Run a crawl on the Content Source.

My Search Scope filled up.
Search was working again!

EDIT –
I first wrote this post back in 2013, and Microsoft has made a change in how this works.

Reindex a sit

  1. On the site, select Settings Settings icon., and then select Site settings. If you don’t see Site settings, select Site information, and then select View all site settings.
  2. Under Search, select Search and offline availability.
  3. In the Reindex site section, select Reindex site.
  4. A warning appears, check the box before Please check this box to acknowledge and agree to the statement above. Select Reindex site again to confirm. The content is reindexed during the next scheduled crawl.

Reindex a document library or a list

  1. On the site, go to the list or library that you want to reindex.
  2. In the upper right corner, selet Settings, and then choose Library Settings or List Settings.
  3. On the Settings page, under General Settings, choose Advanced settings. If you don’t see the Settings page, you may need to choose More library settings or More List settings.
  4. Scroll down to Reindex Document Library or Reindex List, and select the button. A warning appears. Select the button again to confirm. The content is reindexed during the next scheduled crawl.

https://learn.microsoft.com/en-us/sharepoint/crawl-site-content

Cannot Undeclare Record in SharePoint

Using SharePoint Records Management, I declared a document as a record.  Then I tried to undeclare the document as a record.  For some reason SharePoint wouldn’t not undeclare the document.

Using PowerShell, you can force the undeclare action.

#Load the sharepoint snapin
$SPWeb = Get-SPWeb "http://sharepointed.com/sites/taco" 
  
$SPList = $SPWeb.Lists["Taco Recipes"]   
$SPItem = $SPList.GetItemById("75")     

#new code to remove hold first    
$SPItem.Properties.Remove("ecm_ItemLockHolders")
$SPItem.File.Properties.Remove("ecm_ItemLockHolders")   
$SPItem.SystemUpdate()    

#undeclare the record
[Microsoft.Office.RecordsManagement.RecordsRepository.Records]::UndeclareItemAsRecord($SPItem)

 

Doing this will remove the lock from the document.