Tag: PowerShell
New Windows 2022 Domain Controller
Ben Liebowitz
- 0
- 2332
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…
Manage your Windows Failover Cluster with PowerShell
Ben Liebowitz
- 0
- 2378
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.…
List Scheduled Tasks for Remote Servers
Ben Liebowitz
- 0
- 5223
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…
Save Credentials to File in PowerShell
Ben Liebowitz
- 1
- 6049
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…
Change default VMware Remote Console Application
Ben Liebowitz
- 0
- 3307
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…
Running VMFS Unmap via PowerCLI
Ben Liebowitz
- 0
- 4998
Starting in vSphere 5.5, VMware introduced a new command in the esxcli namespace that allows deleted blocks to be reclaimed on thin provisioned LUNs that support the VAAI UNMAP primitive. You can run the command without any maintenance window, and the reclaim mechanism has been enhanced: Reclaim disk space size can be specified in blocks instead of a percentage value…
Using PowerCLI to set the Global System Log Location
Ben Liebowitz
- 0
- 3586
Are you seeing an error stating that the System Logs on your host(s) are stored on non-persistent storage. Following THIS VMware KB article, I knew I had to change the Global Logdir. What we did was create a shared datastore called ESXiScratch. On this datastore, we created folders for each host. .locker-lab01.locker-lab02etc. Next, I ran the following PowerCLI command to…
PowerShell Scripting with SCCM
Ben Liebowitz
- 0
- 885
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…
Using vSphere Tags to Check for Pending Reboot State
Ben Liebowitz
- 0
- 1118
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,…
The Pending Reboot Nightmare… PowerShell to the Rescue!
Ben Liebowitz
- 5
- 1974
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…