Posts

How to change your ADFS Service Account

 How to change your ADFS Service Account We had set up our original ADFS farm with a standard user account as the service account.   However, we wanted to change the account to a Group Managed Service Account (GMSA) instead. Unfortunately, there weren't any complete instructions on changing the ADFS account. Export-AdfsAuthenticationProviderConfigurationData Import-AdfsAuthenticationProviderConfigurationData I did manage to find the following great related articles: http://tunnik.name/changing-adfs-service-account/ https://github.com/Microsoft/adfsToolbox/tree/master/serviceAccountModule https://social.technet.microsoft.com/Forums/windowsserver/en-US/8f558762-f92c-4803-916c-cc36ecc7c988/adfs-2016-change-service-account-to-gmsa?forum=ADFS After reading the article from the tunnik.name site, I decided to give the change a shot in my dev environment.  Here are the notes I came up with: The error messages shown in the notes are from the [Event Viewer -> Application an...

PowerShell Script for Updating the Password for SharePoint On Premise Service Accounts

 Here's a useful script for updating SharePoint Service Account passwords.   SharePoint actually has a useful ManagedAccounts system where it will automatically change the password for the account.  However, on one of my SharePoint farms, it doesn't quite work right.   For some reason, after the automatic password change, some of the services or app pools never receive the new password. So, I have had to change the password manually and make sure the services and app pools have the correct password. The following script will change the service account password, and then update the app pools and services on the server it is running on.   The service accounts are  specified in the $serviceAccounts variable.  You will need to edit the script and set those accounts to the ones on your farm.   You will need the  ActiveDirectory Module | Microsoft Docs  ,the WebAdministration module, and the Microsoft.SharePoint.Powershell ...

PowerShell Script to Clean the Windows Installer Directory

Yesterday, I had a case of the Windows folder filling up the OS drive on a server. I already have scripts to archive the event log files in c:\windows\system32\winevt, as well as c:\inetpub\logs for web servers.  So I ran those again, but found the OS drive still down to less than 5 GB in space. Using a program called WinDirStat, I discovered that the Windows Installer directory had gotten pretty big, like over 40GB in size. I began my quest to Google for a solution. I saw one article talking about using DISM to clean up the winsxs directory.  https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/clean-up-the-winsxs-folder However, that didn't clean up the c:\windows\installer directory at all.  Also, installing the Desktop Experience Feature and using the cleanmgr.exe (Disk Clean up) utility didn't clean up the Installer directory either. Many blogs pointed towards a tool called Patch Cleaner. https://www.winhelponline.com/blog/windows-inst...

KPI Fix for SharePoint 2013

Wrote a fix for KPIs loading on SharePoint 2013: 1) Create a file called KPIFix.js and save it to a document library on your SharePoint site. // Fix for KPI loading var arrayKPIPanelIds = []; var KPIPanelIndex = 0; function kpiEndRequestHandler() {     try{         if (KPIPanelIndex < arrayKPIPanelIds.length)         {             var pid=arrayKPIPanelIds[KPIPanelIndex];             __doPostBack(pid,"");             KPIPanelIndex++;             Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(kpiEndRequestHandler);             Sys.WebForms.PageRequestManager.getInstance().add_endRequest(kpiEndRequ...

Getting Authentication Prompt When Accessing SharePoint Web Services

You have a SharePoint site that is configured to be accessible by anonymous users, and the site's permissions are also configured to allow anonymous users.  You create a JavaScript based web part to access SharePoint's web services, pull list items, and display them using the GetListItems SOAP 1.2 call.  For some reason, users are prompted to authenticate when accessing your site.  I discovered that the fix for this is in the web request content type. If you set the content type to "text/xml; charset=utf-8" as in the SOAP 1.1 envelope sample, SharePoint won't prompt you to authenticate. Here's the /_vti_bin/lists.asmx?op=GetListItems output for reference: SOAP 1.1 The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values. POST /_vti_bin/lists.asmx HTTP/1.1 Host: moss2007hv.kor.cmil.mil Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "http://schemas.mi...

SP2013 and PlanetWilson.SharePoint.ColourCalendarV2.4

So, we finally upgraded to SharePoint 2013. PlanetWilson.SharePoint.ColourCalendarV2.4 was being used on our old SP2007 farm.  I delayed writing this script until my company was off of SP2007, thinking someone else would write it by the time we migrated. However, I noticed no one easily Googleable has done it. So after a few hours of coding, here is the script that you can add to your calendars that are using Planet Wilson color coding to get it working again, as originally designed (pulling colors from the Colour Calendar Mapping list). I wrote it using SharePoint 2013 JavaScript Client API.  I didn't use JQuery to reduce the number of library dependencies it had.  Just plain old JavaScript.  It uses document.getElementsByClassName, though, which only started getting support from IE  after IE11.  If you are on SP2013, you are more than likely using a fairly recent browser, anyways. 1) Throw the below code into a file called PlanetWi...

Link Field for the Workflow Task List in SharePoint 2010

I noticed that the display name for the "Link" field for WorkflowTask content type has changed to "Related Content" with static name "WorkflowLink." The Link field normally contains the Url to the List and the title/name of the item that the workflow task is referring to in a comma delimited format. I was using the Link field to get the associated item information.  Excerpt from C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES\ctypes\ctypeswss.xml: <ContentType Version="0" Group="_Hidden" Name="$Resources:WorkflowTask" ID="0x010801" Description="$Resources:WorkflowTaskCTDesc" Hidden="TRUE"> <FieldRefs> <FieldRef Name="Link" ID="{58ddda52-c2a3-4650-9178-3bbc1f6e36da}"/> <FieldRef Name="OffsiteParticipant" ID="{16b6952f-3ce6-45e0-8f4e-42dac6e12441}"/> <FieldRef Name="Offs...