Remote Server file checker

Remote Server file checker

Here’s a nice little script that will return the latest file from a remote directory. I use it to check  that the remote repo servers have gotten the update files for the month before deploying MS updates. Problem:

Bandwidth gets saturation at a particular location when I deploy MS updates to the enterprise- the netOps guys contact me “Hey, are you rolling out updates, cause we are seeing high  bandwidth saturation at so-and-so location.” We look at the repo server at that location that is SUPPOSED to have the patch files for this month and is SUPPOSED to be serving out said files to the local clients at that location-and lo and behold, the files aren’t there! So instead of getting the files locally, now ALL the clients at this particular location are going over the WAN to get the files from the core….BAD!

Resolution:

Check each remote repo server BEFORE deploying the updates-to make sure that the patch files for this month made it over to the repo server

 

This script will essentially map a drive to the remote directory where the patch files should be, and then return the name and last write date of the most recent file in the directory for each remote server. If all is right, the name of the file and the write date should all be the same—and more importantly, they should all be AFTER the most recent patch Tuesday.

 

As with all things PowerShell, its best to output to an object rather than simply write-host-wouldn’t want to kill any puppies right?  You can then pipe the objects into a nice out-GridView like so:

 

An you get back a nice report like this:

grid

 

You Might Also Like

Leave a Reply

Your email address will not be published. Required fields are marked *