Hello,
I have problem with showing/exporting properties of object: NetIPConfiguration in PS.
I run get-member to show all methods and properties of this object. Result is:
PS H:\> Get-NetIPConfiguration |Get-Member
TypeName: NetIPConfiguration
Name MemberType Definition
---- ---------- ----------
Equals Method bool Equals[System.Object obj]
GetHashCode Method int GetHashCode[]
GetType Method type GetType[]
ToString Method string ToString[]
AllIPAddresses Property ciminstance[] AllIPAddresses {get;set;}
ComputerName Property string ComputerName {get;set;}
Detailed Property bool Detailed {get;set;}
DNSServer Property ciminstance[] DNSServer {get;set;}
InterfaceAlias Property string InterfaceAlias {get;set;}
InterfaceDescription Property string InterfaceDescription {get;set;}
InterfaceIndex Property int InterfaceIndex {get;set;}
IPv4Address Property ciminstance[] IPv4Address {get;set;}
IPv4DefaultGateway Property ciminstance[] IPv4DefaultGateway {get;set;}
IPv6Address Property ciminstance[] IPv6Address {get;set;}
IPv6DefaultGateway Property ciminstance[] IPv6DefaultGateway {get;set;}
IPv6LinkLocalAddress Property ciminstance[] IPv6LinkLocalAddress {get;set;}
IPv6TemporaryAddress Property ciminstance[] IPv6TemporaryAddress {get;set;}
NetAdapter Property ciminstance NetAdapter {get;set;}
NetIPv4Interface Property ciminstance NetIPv4Interface {get;set;}
NetIPv6Interface Property ciminstance NetIPv6Interface {get;set;}
NetProfile Property ciminstance NetProfile {get;set;}
When I simply use:
PS H:\> Get-NetIPConfiguration
It shows me properties values as follows [changed digits to zeros]:
InterfaceAlias : Ethernet
InterfaceIndex : 3
InterfaceDescription : Realtek PCIe GBE Family Controller
IPv4Address : 000.000.0.000
IPv6DefaultGateway :
IPv4DefaultGateway : 000.000.0.0
DNSServer : 000.000.000.000
00.000.0.000
However when I use:
PS H:\> get-NetIPConfiguration |select -Property IPv4Address, IPv4DefaultGateway, DNSServer
The result is:
IPv4Address IPv4DefaultGateway DNSServer
----------- ------------------ ---------
{192.168.1.101} {MSFT_NetRoute [InstanceID = ":8:8:8:9:55?... {MSFT_DNSClientServerAddress [Name = "3", ...
So basically values are missing and instead it shows me something like: "MSFT_NetRoute (InstanceID = “:8:8:8:9:55?..”
The same is when I want to use ConvetTo-Html:
PS H:\> get-NetIPConfiguration |select -Property IPv4Address, IPv4DefaultGateway, DNSServer |ConvertTo-Html
And result:
HTML TABLE IPv4AddressIPv4DefaultGatewayDNSServer Microsoft.Management.Infrastructure.CimInstance[]Microsoft.Management.Infrastructure.CimInstance[]Microsoft.Man agement.Infrastructure.CimInstance[]
Now instead of values I have: Microsoft.Management.Infrastructure.CimInstance…
Any suggestions ? How should export NetIPConfiguration properties to html - any ideas ?
Appreciate any help in that matter,
Macieq