Here’s another simple script I put together. It allows you to specify a Security Group in Active Directory, and add a list of hosts to this group. Simple, but yet another tool that every SysAdmin should have in their repository.
Category: Windows Administration
Posts pertaining to performance of administrative tasks in Windows operating systems
PowerShell – Get OS By Device Name
Here’s a basic script I put together to generate a .CSV report of the operating system for a given list of device names. A handy tool for any sysadmin to add to their repository.
PowerShell – Save Updates And Import to WSUS
Since Internet Explorer has now been deprecated, there is a need to import updates to WSUS natively without the installation of additional browsers. I’ve found that some of the functionality can be accomplished with Microsoft MVP Chrissy Lemaire’s “KBUpdate” PowerShell module, but it merely facilitated the process by downloading the update, and thus, I did…
PowerShell – Add/Modify Registry Key
Creating or modifying registry keys in PowerShell is a task that comes up frequently when working with Windows. I’ve put together a function that will check for and create a registry key if it does not exist. Just specify the key path, name, and value. As you can see in the first execution, the script…
PowerShell – Ultimate Oracle Client Deinstaller
I’ve put together a PowerShell deinstall script for Oracle clients that I’m dubbing the Ultimate Oracle Client Deinstaller. This deinstall script clears relevant environment variables and creates a .RSP file using Oracle’s deinstall.bat utility. It then deinstalls the Oracle client and cleans up the registry. But wait, there’s more! This script is compatible with Oracle…
PowerShell – Set AD Security Group Membership
Here’s a script that I wrote to allow you to provide a list of machine names and set the membership of an Active Directory security group. It outputs the initial membership count to the console, removes devices that are not present in the provided list, adds devices that are not already present, and then outputs…
Homelab – Virtual Network Configuration
In my home lab environment, I find it convenient (most of the time) for my devices to be able to communicate with one another unimpeded. Doing so allows for simple file transfer, to use RDP, or to ping virtual devices. Often these capabilities are not a necessity, but they do make things convenient. And, in…
PowerShell- Clearing Nullified Environment Variables
I have posted before on the nuances of handling environment variables with PowerShell. I recently encountered an issue where I found a shortcoming of some of my previous scripting work. I was unable to clear nullified environment variables in my current session. I can’t take credit for the script I pieced together to accomplish this,…
Fix “SQL Availability Replica Disconnected”
If you are using Always On Availability Groups in SQL, you may encounter connectivity issues between nodes if there has been a change in configuration of the nodes. When I encountered this issue, the nodes in question had been transitioned from a commercial firewall application to Windows Defender Firewall, and traffic was not being allowed…
Scripted Restart of Service – Azure Update Management
If you are using Update Management to handle patching of Windows VMs in Azure, you are bound to see devices display in the “Not Assessed” compliance state from time to time. To remedy this, one can restart the service “Microsoft Monitoring Agent (HealthService).” This service has a corresponding process as well, and I check the…