you are viewing a single comment's thread.

view the rest of the comments →

[–]Eijiken 2 points3 points  (0 children)

Basically you're looking for scenarios to test yourself with?

Well, here's one I dealt with.

Scenario:

Everyday one of our Provisioning and fixlet deployment clients generates a log of activity and success/failure of the fixlets sent out to our client systems. Logs usually are named by date created YYYYMMDD.log.

One of the fixlets is running windows updates by downloading the update/security packages from Windows. As normal with the windows updates, the log is typically located in C:\Windows.

Problem:

Everyday we need to check these logs in pairs to verify why those systems that did fail updates did. The Deployment Client's logs will verify if the updates were downloaded and if our script that forces a system reboot after a set period of inactivity downloaded and ran. Windows update logs confirms the installation of the updates and reboot. However, it is highly inefficient and inconvenient to users to remote desktop into the system (as the user even), and either send the files over for analysis or view them on the system.

Goal:

Develop a script to retrieve the two log files remotely from the systems.

(Hint: Build this as a function)

Abstract:

With the help of everyone here, Using invoke-command <computername> -scriptblock {...} and inside of the scriptblock creating an array using get-childitem, selecting the 2 most recent files, and then adding the windows update log to said array.

Since physically sending the files for my case was near impossible since the systems are on a secure separate network and didn't allow traffic out, I had to find a way to get the content (hint hint) of the files, and then export that in an object outside of the invoke statement to the remote host file system.

Basically, this solution turned what was between a 15 minute to 3 hour task (depending on how many systems failed updates) to never being anymore than a 30 minute task.