PowerShell script for DNS Inventory

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 →

Advertisements

PowerShell Script for DHCP settings, leases and reservations inventory

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 Script for patching Domain Servers remotely

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 File Share inventory of all File Servers

Managing a large infra never happens to be easy without right kind of tools and tools usually come with cost. In past Unix users used to taunt Windows users on this point as they used to enjoy many open source products and scripts which Windows users weren’t privy of. Things changed a lot since PowerShell.

Presenting you a script to have a size and permission inventory of all your shares on all file servers. Below would be the pre-requisites:

1. Names of all file servers.
2. All the file servers should have WinRM enabled (Windows 2012 servers have it on by default and for Windows 2008, winrm quickconfig may do the trick).
3. Obviously Local Administrator permissions on all File Servers, which should have permissions on shares as well.

After that just change the variable $RemoteComputers value with the name of file servers in place of dummy values placed in form of array right now. That’s it.

This script lists names of all servers (provided by you), shares on them, NTFS permissions, Size in MB, Last modified date and Last accessed date.

Continue reading →

In embrace of sea and greenery of South-Memoirs from day 7, 8 and 9

IMG_20170630_085006

Munnar was the only location, where we were scheduled to stay for two nights means full one day for the place as the day next, we were to leave as early as possible to reach Bangalore in time.

When we woke up, it was raining but nevertheless, we got ready and then by 7.30 AM, we would have been on nearby restaurant for a heavy breakfast. After which we started driving after 8.30 AM. This time we had hired a guide to drive with us and show us around @ 500Rs.

IMG_20170630_085004

It continued to rain though we had hopes that it would settle till the time we reach to the viewpoints and luckily it happened that way.

Continue reading →

In embrace of sea and greenery of South-Memoirs from day 5 and 6

DSCN9292

We all waited for morning to have more fun on beach, elders and kids alike. The first job in morning to get ready after bath etc and head to beach with sand castle tools.

DSCN9283

DSCN9319

We must have reached the beach by 7 AM. The lighthouse wasn’t gonna open before 10AM which means it wouldn’t cut into our schedule. It was all about the time on beach now and mild showers were worrying us.

Continue reading →

In embrace of sea and greenery of South-Memoirs from day 4

DSCN9147

What better feeling than to watch the sunrise at the last end of your country with 360 degree of sea view around and that too under a cloudy and less warm weather. Would admit we wouldn’t have preferred cloudy but a clear sky but every weather has its own texture and should be taken as such.

IMG_20170627_080156

Morning started with mild showers and we had to take umbrellas from the hotel. The excitement to walk towards the end of the country boundary was just something else.

IMG_20170627_060020

IMG_20170627_060556

Changing colors with each passing minute, the place is worth spending the entire day just sitting on that stone bridge.

DSCN9151

The view, the showers, people trying to sell sea shells and even tea vendors doing ferry on that small but not that crowded place, if it wasn’t about rains and specially kids, then we would have stayed much more longer there but then guarding kids on that place where both side it was heavy waves, our mind was asking us to move from there.

Continue reading →