SharePoint Experts, Information Architects, Expert Witness

We provide consulting in a broad array of business and technology from architecture to design to deployment of global systems with a focus on surfacing data in the enterprise. Specialists in Microsoft, we are a premier provider of SharePoint Expertise (including 2016 and Office 365). We also provide Expert Witness/Legal Expert in eDiscovery, source discovery, patent infringement, piracy and more! We also have established SICG DLDS s.a. - our counterpart in Costa Rica that specializes in water systems (http://www.crwatersolutions.com) - Contact me direct: david_sterling@sterling-consulting.com or call 704-873-8846 x704.

Search This Blog

Sunday, August 6, 2017

Adding a Description to your Timer Jobs (SharePoint 2013/2016)

I know, been a while since I needed one but had to build a few timer jobs for an On Premise location. As in the past, there's a 'bug' in the Timer Job namespace where in you cannot add a 'description' (it's read only due to crappy development).

I had to do some research having not touched these for quite a while so posting here so I don't have to remember (again).

To add a description, you have to override the "Description" in the timer job and provide your own, then you have to add it to all three of the class definitions. In this case it was a timer job to purge documents after 72 hours.

The Override and new description property:

        /// <summary>
        /// Description - Override built-in Description property
        /// </summary>
        public override string Description
        {
            get
            { return CustomDescription; }
        }
        /// <summary>
        /// CustomDescription - Used to provide "Set" to the Job Description
        /// </summary>
        private string CustomDescription
        {
            get;
            set;
        }

Adding to the the class def

             public PurgeAfter72HoursClass() : base()
        {
            this.Title = JobName;
            this.CustomDescription = JobDescription;
        }

        public PurgeAfter72HoursClass(string jobName, SPService service, SPServer server, SPJobLockType targetType)
            : base(jobName, service, server, targetType)
        {
            this.Title = JobName;
            this.CustomDescription = JobDescription;
        }

        public PurgeAfter72HoursClass(string jobName, SPWebApplication webApplication, string strUrl)
            : base(jobName, webApplication, null, SPJobLockType.ContentDatabase)
        {
            this.Title = JobName;
            this.CustomDescription = JobDescription;
        }

Have fun!


Tuesday, August 1, 2017

The Open Procedure for service "BITS" in DLL

As many will know, the following error shows up in the Event Log (Event ID 1008):

Log Name:Application 
Source:Microsoft-Windows-Perflib 
Event ID:1008 
Description:The Open Procedure for service "BITS" in DLL "C:\Windows\System32\bitsperf.dll" failed. Performance data for this service will not be available. The first four bytes (DWORD) of the Data section contains the error code. 

This problem occurs when BITS(Background Intelligent Transfer Service)has been never started.
The error is not recorded if BITS starts by manual operation or Windows Update starts.

Fix: Simply start the dang service - no harm, no foul. Leaving it on automatic startup doesn't hurt either. Resetting the counters as many suggest doesn't work.

From the Administrative Tools, click on Services or click Start > Run then enter services.msc. Find the "Background Intelligent Transfer Service" and start it (and/or set it to start automatically):



While I found MANY references, this one gave the assurance on what the real problem is (and how to fix): http://www.fujitsu.com/global/products/computing/servers/mission-critical/primequest/software/win2012-r2-precautions.html

Sunday, July 16, 2017

SharePoint web application creation - '' is an unexpected token. Expecting white space. Line 1, position 15478f

So this was interesting - a "lesson learned":

Setup of a new farm, all going well - tried to create a web application. It was created but show the message 'MD2' is an unexpected token. Expecting white space. Line 1, position 15478 and there was no link to create a site.

In my case, the "MD2" was the start of the names of the databases that were being created for the services.

What I thought could this be? Turns out the PowerShell scripts I was using was putting a space in the database name - i.e. "MD2 SessionState" due to an edit error.

The workaround is let it create then assign a site - however, the PROPER fix is to rebuild all services and be sure that there is NO space in the name.


The trust relationship between this workstation and the primary domain failed

Everyone's had this problem - I just wasted a day yesterday trying to fix on a set of VM's. An update to VMWare Workstation caused a bunch of network issues - tracking many of them down was a real pain.

Additional note: this has become a common re-occurrence since updating VM Workstation 12 (specifically 12.5.7 build-5813279).

So Kudos to http://implbits.com/active-directory/2012/04/03/dont-rejoin-to-fix.html on how to fix this issue. I recommend using the netdom method - simply login to the box with problem as an administrator, open a command prompt (using Run as administrator) then enter:

netdom resetpwd /s:<domain server name> /ud:<user with permissions, domain\name> /pd:<user password>

Example:

netdom resetpwd /s:SysTestADMachine /ud:SysTest\ADManager /pd:ABC1234!

If not prompted, reboot anyway.

AS A SIDE EFFECT - your accounts might be a bit whacked, particularly if it is a server running application - be aware that you MAY have to reset the password for all system related accounts (application pools, etc.).

Some other issues that were encountered in my foray of fun yesterday:

Using NETDOM - the Target Name is Incorrect - the above corrects.

Using Remote Desktop - "The Local Security Authority Cannot Be Contacted" - simply reset the password of the account in Active Directory (Kudos: http://blog.mnewton.com/articles/solution-rdp-the-local-security-authority-cannot-be-contacted/).

NOTE: There seems another 'fix' per VMWare in which the Computer Password changes automatically which can get out of sync with clean systems. This is a Registry Fix (so if you don't know Regedit, don't try this):

  1. Open Regedit (using Run as administrator)
  2. Navigate to HKLM\System\CurrentControlSet\services\Netlogon\Parameters
  3. Change the DisablePasswordChange key from 0 to 1

A reboot may be required AND you might have to reset the computer password as above (using NetDom). Full explanation can be found here: https://communities.vmware.com/thread/327644






Friday, July 14, 2017

So this one is a question! User Profile Service Page is BLANK!

So here's a question for all - working a development system, I suddenly noticed that I was unable to access Site Settings in any collection despite having full access. 

Took a while looking around but then found this:


Notice? There are NO OPTIONS on the page!

I'd love to get an answer if anyone has it - in the meantime, I rebuilt the User Profile Service - same problem!

I will post an answer if I can find it!

Monday, June 19, 2017

SharePoint Event ID 5586 - Target Principal name is incorrect. Cannot generate SSPI context.

Deploying a solution to SharePoint, it seemed to hang for a really long time. I ended up stopping the deployment to see what was up. Immediately thereafter, I could no longer connect to SharePoint at all.

In the Windows Application Event Log, I found multiple Event ID 5586 entries - basically saying "The target principal name is incorrect".

After a few hours of searching, I found one solution here:

http://www.jrjlee.com/2013/01/the-target-principal-name-is-incorrect.html *

* Note that he doesn't indicate that you have to adsiedit.msc to get to the entry (a little headscratching to figure that out).

Some say it worked for them, but it definitely did not work for me.

For one, there were no MSSQLSvc entries. For two, removing the RestrictedKrbHost entries condition went from bad to worse (new error: Unable to login to untrusted domain). I restored the RestrictedKrbHost entries just fine so I tried adding the MSSQLSvc entries and got "Name is not unique".

The final one that worked for me was:

Step 1) Logged on the AD Server and opened adsiedit.msc (Run as administrator)
2) Right clicked on the SQL Server entry and clicked Refresh:



3) Opened AD Users & Computers, right clicked on the account running SQL Services and clicked Unlock Account:


Hat tip to David Murdoch's post *:

http://www.davidmurdoch.com/2014/10/06/the-target-principal-name-is-incorrect-cannot-generate-sspi-context/

Note: his blog incorrectly says "Refresh" from Active Directory Users and Computers - you actually have to use adsiedit.msc.

Sunday, June 18, 2017

Event ID 6398 SharePoint User Profile Synchronization


Having seen this myself a number of times (and sick of having to look for the answer), there is an error that occurs in the User Profile Sync - Event ID 6398 - in the Event Viewer it looks like this:


Notice that the error is every minute! This will certainly fill up the logs!

The issue is quite simple - there are many fixes but turns out the problem in simply the Forefront Identity Manager Service is not running (or could be the Sync). Open Administration > Services (or use Run and type in services.msc) and locate the Forefront Identity Services:


Simply start the service(s) (right click and select Start). I am not sure what causes it to stop periodically but in this state, User Profile sync errors will continue frequently,.

Hat tip to this post:
https://social.technet.microsoft.com/wiki/contents/articles/24496.sharepoint-2013-event-6398-the-execute-method-of-job-definition-microsoft-office-server-userprofiles-userprofileimportjob-threw-an-exception.aspx