MemberType = NoteProperty - Definition = ciminstance

This topic contains 1 reply, has 1 voice, and was last updated by  Salam ELIAS 1 year, 1 month ago.

  • Author
  • #62367

    Salam ELIAS

    Hi, I use powershell where-object regularlt with strings but today, I came across a need to use this clause with a property of a type ciminstance but really confused as I have very little experience working with CIMinstances

    Get-DnsServerResourceRecord -ZoneName -ComputerName myDC1 -RRType A | gm

    I have a property

    RecordData                Property   CimInstance#Instance RecordData {get;set;}  

    when I issue
    Get-DnsServerResourceRecord -ZoneName -ComputerName myDC1 -RRType A
    I get a nice table where I have the IPs of each server in this property as follows

    HostName RecordType Type Timestamp TimeToLive RecordData
    ——– ———- —- ——— ———- ———-

    Backups A 1 0 01:00:00
    BTS2K13 A 1 8/10/2014 1:00:00 PM 00:20:00

    I tried
    Where-Object $_.RecordData -Like "*192.168.1*" and Where-Object RecordData -Like "*192.168.1*"
    nothing comes back, so how we can query and use this ip property? I tried doint a GM and get the following for the this property

    Get-DnsServerResourceRecord -ZoneName -ComputerName salammain -RRType A | Select -Property "RecordData" | gm

    Name MemberType Definition
    —- ———- ———-
    Equals Method bool Equals(System.Object obj)
    GetHashCode Method int GetHashCode()
    GetType Method type GetType()
    ToString Method string ToString()
    RecordData NoteProperty ciminstance RecordData=DnsServerResourceRecordA

  • #62395

    Salam ELIAS

You must be logged in to reply to this topic.