Learn Windows PowerShell in a Month of Lunches by Don Jones

Learn Windows PowerShell in a Month of Lunches by Don Jones

Author:Don Jones [Jones, Don]
Language: eng
Format: epub, pdf
ISBN: 9781617290213
Publisher: Manning Publications
Published: 2011-05-14T07:00:00+00:00


The WMI way: invoking WMI methods

149

__DERIVATION : {}

__SERVER :

__NAMESPACE :

__PATH :

ReturnValue : 0

__GENUS : 2

__CLASS : __PARAMETERS

__SUPERCLASS :

__DYNASTY : __PARAMETERS

__RELPATH :

__PROPERTY_COUNT : 1

__DERIVATION : {}

__SERVER :

__NAMESPACE :

__PATH :

ReturnValue : 84

The only useful information here is the one property that doesn’t start with two underscores: ReturnValue. That number tells me the result of the operation. A Google search for “Win32_NetworkAdapterConfiguration” turns up the documentation page, and I can then click through to the EnableDHCP method to see the possible return values and what they mean. Figure 13.1 shows what I discovered.

Zero appears to mean success, while 84 says that IP isn’t enabled on that adapter configuration, so DHCP can’t be enabled. But which bit of the output went with which of my two network adapter configurations? It’s difficult to tell, because the output Figure 13.1 Looking up return values for a WMI method’s results Download from Wow! eBook <www.wowebook.com>



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.