My MVP Profile

Monday, April 09, 2007

Ops Mgr 2007 Command Shell: Agent Inventory by Date

A quick Ops Mgr Command Shell sample - enjoy!

Want a list of machines where Ops Mgr agents have been installed, by whom and when? That's a one-liner...I've formatted output as a table.

get-agent | where {$_.name -like "*" } | ft name, InstalledBy, InstallTime

If we go an extra couple steps, you can easily sort by Install date and time (descending order in this example) using SORT. We'll then again use format-table (ft) to format the output in a table, which displays a bit more neatly.

$list = get-agent | where {$_.name -like "*" }
$list = $list | sort -desc InstallTime
$list | ft name, InstalledBy, InstallTime

Output format looks like this:





Comments on "Ops Mgr 2007 Command Shell: Agent Inventory by Date"

 

post a comment links to this post