SharePoint Experts, Information Architects, Expert Witness

SICG provides a broad array of business and technology consulting from architecture to design to deployment of global systems with a focus on surfacing data in the enterprise. We focus on the "How", not just the possible. Contact me direct: david_sterling@sterling-consulting.com or call 704-873-8846 x704.

Search This Blog

Thursday, May 16, 2019

Removing the Default Documents Library in SharePoint

So you want to delete the default Documents (or Shared Documents) library - which you should but in many site templates it cannot be deleted (the Delete this library link isn't shown). 

Quick and easy, do it in PowerShell:

# Set Site URL, i.e. http://<site>, http://site/sites/abc, https://, etc.
$theWeb = Get-SPWeb <Site URL>
# Display the object (will display the URL to the site)
$theWeb
$list = $theWeb.Lists[“Documents”]
# Display List Details
$list
# Make it deletable
$list.AllowDeletion = $True
# Update it
$list.Update()
# Now delete it
$list.Delete()

PS: This is also a reminder for myself - I know what to do just forget sometimes!

Wednesday, January 16, 2019

Setting Time Servers (Windows)

A note here for future reference! You might find yourself off time on a server, laptop, pc, etc. and it is a great idea to sync with a known time service. While you have to have admin rights on the individual box (or VM), you can set the time servers using an elevated Command prompt (i.e. Run as Administrator).

I happen to use the NTP servers in the US for synching all of my servers. So - how to set these? A few simple commands - stop the time service, set the sync option with server list, set as reliable and start it back up - the last two commands show you the configuration and status.

Open a command prompt (cmd) using Run as administrator and enter the following (careful, second line is wrapped):

net stop w32time
w32tm /config /syncfromflags:manual /manualpeerlist:"0.us.pool.ntp.org,1.us.pool.ntp.org,2.us.pool.ntp.org,3.us.pool.ntp.org"
w32tm /config /reliable:yes
net start w32time

w32tm /query /configuration
w32tm /query /status


All set!


Wednesday, January 9, 2019

Active Directory Error 0X800708C5

I get questions about this error all the time - the answer is usually very simple - the password you are attempting to apply does not meet the criteria required.

Hope that helps!

Saturday, November 24, 2018

The timer service failed to recycle

This is one I see all the time on client sites - under Review problems and solutions you see the message "The timer service failed to recycle". The problem is actually due to running other jobs that conflict with the recycle process - in short, something else is running.

Many have a habit of having long running jobs start after Midnight (00:00) which is generally around the time the Recycle job runs - if something else is running, the job fails. The solution is quite simple - either A) review and modify jobs that run at the same time as the Recycle job and make sure they don't overlap or B) simply change the time that the recycle happens. Since A may take some time, B is quite simple.

Open Central Administration and click Monitoring then Review job definitions and look for "Timer Service Recycle" (you'll have to page through to find it). Click to open the job and change the Starting time to be either earlier or later than other long running jobs. In most cases (depending on the installation and/or 24 x 7 usage), you can usually set it for late evening (like 10 PM).

For more reference, see here:
https://docs.microsoft.com/en-us/sharepoint/technical-reference/the-timer-service-failed-to-recycle

SharePoint Most Popular does not appear in Lists

As we all know, document libraries have the option to review Most Popular items. While there can be issues with this (showing no counts for example), it does work in most cases. Assuming you are getting counts, you might notice that this option does not appear in Lists.

Enabling this is easy enough - simply activate the Cross Site Publishing feature - Site Settings > Site Collection Features > Cross-Site Collection Publishing.

Saturday, November 10, 2018

ULS Logs Searching for the Correlation ID

Having forgotten about this myself, I am posting here. In many cases, there's instances where you want to scan across ULS in SharePoint for a single Correlation ID. Notepad/Notepad++ are not much help here since messages are mixed. The ULS Viewer isn't always the best either.

The proper way to help you narrow down what you are looking for is "Merge-SPLogFile". This little gem searches across the ULS logs and helps you dump it into a single file.

Format is simple (obviously run one of the farm servers):

Merge-SPLogFile - Path <File Path> -Correlation <Correlation ID> -Overwrite

Overwrite is optional - it simply overwrites an existing file. So for example:

Merge-SPLogFile -Path "c:\temp\MyLogsMerged.log" -Correlation 7d88815d-17d5-412d-a71d-f0d124c8ad7c -Overwrite

And you can add the date (or time):

Merge-SPLogFile -Path "c:\temp\MyLogsMerged-$(Get-Date -f yyyy-MM-dd).log" -Correlation 7d88815d-17d5-412d-a71d-f0d124c8ad7c -Overwrite

Now you can use this merged log file in the ULS viewer so you can take your time to review an entire event without having to filter.

There are actually a lot of things you can use to filter - Correlation is just one. It can be an Event ID, service name, etc. - see the details here:

Merge-SPLogFile on docs.microsoft.com



Monday, November 5, 2018

Trouble adding a Custom Action in SharePoint 2016

Minor annoyances. I had this problem a while back and just haven't worked with it in a while so I figured I'd share.

When working with creating a Custom Action to add it to say the EditControlBlock, it's easy to make a common mistake. When you are adding it, you have to add it to the collection separately instead of directly on the list/library. So for example, this does not work (where DL is the Document Library to add to) - notice the bolded lines in each:

SPUserCustomAction TheCopyAction = DL.UserCustomActions.Add();
TheCopyAction.Title = "Copy to Extranet";
TheCopyAction.Sequence = 0;
TheCopyAction.Name = TheCopyAction.Id.ToString();
TheCopyAction.Url = "http://mdsp13sp2:83/hdtintra/eng/_layouts/15/copy.aspx?SourceUrl=http://mdsp13sp2:83{ItemUrl}&FldUrl=http://mdsp13sp2:83/eng/MyDocs/&Source=http://mdsp13sp2:83/hdtintra/eng/";
TheCopyAction.Location = "EditControlBLock";
TheCopyAction.Description = "Copy this file to the extranet site";
TheCopyAction.Update();

BUT, using the collection DOES work:

SPUserCustomActionCollection CustomActionCollection = DL.UserCustomActions;
SPUserCustomAction TheCopyAction = CustomActionCollection.Add();
TheCopyAction.Title = "Copy to Extranet";
TheCopyAction.Name = "Copy this file to the extranet site";
TheCopyAction.Sequence = 0;
TheCopyAction.Location = "EditControlBlock";
TheCopyAction.Url = "http://mdsp13sp2:83/hdtintra/eng/_layouts/15/copy.aspx?SourceUrl=http://mdsp13sp2:83{ItemUrl}&FldUrl=http://mdsp13sp2:83/eng/MyDocs/&Source=http://mdsp13sp2:83/hdtintra/eng/";
TheCopyAction.Update();

Oddly, you can see this in Designer - two added via C#, the first by the the top way and 2nd by the 2nd way:


Kudos to:
http://www.dotnetspark.com/kb/3773-diffrent-ways-to-deploy-custom-action-menu.aspx
(after spending 3 hours on this due to failure of memory, thanks!)