Here goes the PowerShell script for DNS Inventory for AD Integrated DNS zones.
This script needs to be altered to set variable for DC Name and once ran, it would fetch details from each zone and would save it in separate files.
Updated the code to provide option to dynamic selection of DNS Server. Thanks for input from @singhalyogi22
Note: Skipping SOA records etc to avoid complexity
Continue reading “PowerShell: DNS Inventory – All records”
Another day, another PowerShell script.. this time to get DHCP settings, leases and reservations from all DHCP Servers in current domain. Pre-requisite is all DHCP Servers should be Windows 2012 based and WinRM should be enabled on all of them.
Continue reading “PowerShell: DHCP settings, leases and reservations inventory”
In line with the last post on File Server inventory, here comes the another script to perform patching for Domain Servers from a remote machine.
PowerShell already has methods to perform patching on any server, where we can list what all patches are available and create a downloader to download and install them all, but a limitation to the capability is, the same can not be done remotely. As a workaround for that, we would be creating schedule task on the remote machine via the script and performing the patching via triggering that schedule task.
It would involve two scripts InstallPatches.ps1 and PatchServer.ps1, whose code I would be listing below. It would make use of c:\temp directory and would be keeping logs and scripts in the same location. Also we would need any shared location, where we would keep a copy of InstallPatches.ps1, which then would be copied dynamically over the servers during patching. I have kept script source path as “\\ABCXYZ\sources\installpatches.ps1” while it can be changed as per your environment.
Continue reading “PowerShell: Script for patching Domain Servers remotely”