Posts

Showing posts from 2020

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 snap in. NOTE: This script was written for a single WFE Share

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-installer-