PowerShell Script to Login to Multiple vCenter Servers

Do you have multiple vCenter servers that you interact with on a daily basis? Do you like to use PowerShell to manage them? I was opening a PowerShell window, and doing a connect-viserver for each and having to enter my PW over and over again. First, I tried to use the New-VICredentialStoreItem command to store my PW, but with security…

Share This:
Read More

Schedule Service Restarts with PowerShell

Have you ever had a service randomly stop on you over and over again?! In my homelab environment, I use a company called Itarian to patch my servers, control them remotely, etc. One thing I found is that the main Itarian service, ITSMService, keeps crashing! You can see below, a few of the servers are grey. I wrote a quick…

Share This:
Read More

New Windows 2022 Domain Controller

The Domain Controller in my home lab currently runs on a Windows 2012 server. It is time to UPGRADE! So I went and downloaded a Windows Server 2022 ISO and deployed a new VM running Windows Server 2022 Std Edition. Lets build a Windows Server 2022 Domain Controller and retire my Windows 2012 DC. Next, it was time to install…

Share This:
Read More

Manage your Windows Failover Cluster with PowerShell

If you’ve ever tried to manage your Windows Failover Cluster using Failover Cluster Manager, you know how much of a pain it can be when you need to do maintenance and have to move roles to the standby node. Moving most of the roles are easy, but when it comes time to move the quorum drive/role, it’s not so easy.…

Share This:
Read More

List Scheduled Tasks for Remote Servers

Recently, I was asked to find out of a certain service account was being used in scheduled tasks on any server. Being a PowerShell guy, I turned to the Get-ScheduledTask cmdlet. I tried querying a list of scheduled tasks by Author. I created a variable $VMs and used it to filter any Powered on Windows VM. I then checked each…

Share This:
Read More

Save Credentials to File in PowerShell

Have you ever wanted to schedule a script to run overnight but need to pass secure credentials? You may do it once in open-text, but after that you say to yourself… There has to be a more secure way! Well, you were right! See how I saved my credentials to a file to use later. Remember, you need to remember…

Share This:
Read More

Change default VMware Remote Console Application

Have you ever tried to open the VMware Remote Console and have it launch VMware Workstation and NOT the VMware Remote Console application? This is set via two keys in the Windows Registry. HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\VMRC\DEFAULTICON and HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\VMRC\SHELL\OPEN\COMMAND. You can get these values via POWERSHELL. As you can see, my Remote Console is currently set to VMware Workstation. I prefer to use…

Share This:
Read More

PowerShell Scripting with SCCM

Until now, I’ve done my SCCM patching with the NO REBOOT option set and servers were rebooted manually.  Because of this, we were getting further and further behind due to servers requiring multiple reboots each month.  In order to resolve this, we decided to go about using the Auto-Reboot option in SCCM and letting SCCM reboot however many times is…

Share This:
Read More

Using vSphere Tags to Check for Pending Reboot State

You may have seen my blog post on the Test-PendingReboot PowerShell module.  I’ve been using it a lot lately and had the thought to use vSphere Tags to check pending reboot state.  In my environment, we normally check for pending reboot states before patching.  If a server is in a pending reboot state, it won’t receive the patches from SCCM,…

Share This:
Read More

The Pending Reboot Nightmare… PowerShell to the Rescue!

My company has been having issues dealing with servers in a pending reboot state for quite a while.  Part of it stems from using SCCM to deploy patches and having the patch deployment set to suppress the reboot and our Operations Team reboots the servers manually.  Well, some months require multiple reboots and we get stuck in the rabbit hole…

Share This:
Read More