Friday, July 22, 2005

Discovering Networking with Monad and MSH

Monad presents administrators with great features and facilities, but there is a learning curve. One key aspect of learning any new feature or product is the aspect of "discoverability" - the ability to find things out simply. There are several ways to discover things, but the built-in reflection methods are at hand to help (although getting used to Monad and>.NET is a learning curvre!).

With Windows XP, there are over 900 WMI classes returned from the Get-WmiObject -List command, as shown:

[C:\]: $wmi=Get-WmiObject -list
[C:\]: $wmi.length
[C:\]: $wmi | format-list
(... a long list not shown!)

WMI class names are relativey self explanatory - so to find all the WMI classes that have 'net' or 'networking', you can do the following:

[C:\]: $netsettings = $wmi | where {$_.__PATH -match "net"}
[C:\]: $networksettings = $wmi | where {$_.__PATH -match "network"}

You can then use these to get the key network class names, as follows:

[C:\]: $netsettings.length
[C:\]: $networksettings.length
[C:\]: $networksettings | ft __Path


Once you have these names, you can begin exploring:

[C:\]: $nw=Get-WMIObject Win32_NetworkAdapter
[C:\]: $nw.length
[C:\]: $nw | gm
(long display - deleted)

No comments: