MemberType = NoteProperty - Definition = ciminstance

This topic contains 1 reply, has 1 voice, and was last updated by Profile photo of Salam ELIAS Salam ELIAS 6 months ago.

  • Author
    Posts
  • #62367
    Profile photo of Salam ELIAS
    Salam ELIAS
    Participant

    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 mydomain.net -ComputerName myDC1 -RRType A | gm
    
     

    I have a property

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

    when I issue
    Get-DnsServerResourceRecord -ZoneName mydomain.net -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 192.168.1.21
    BTS2K13 A 1 8/10/2014 1:00:00 PM 00:20:00 192.168.1.36

    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 salam.net -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
    Profile photo of Salam ELIAS
    Salam ELIAS
    Participant

You must be logged in to reply to this topic.