PowerShell / MMI

Other
24 stars 17 forks source link

Failing to get all TXT records using WQL #59

Open dev-mega-01 opened 3 months ago

dev-mega-01 commented 3 months ago

Prerequisites

Steps to reproduce

cimsession.QueryInstances("root\MicrosoftDNS", "WQL", $"SELECT * FROM MicrosoftDNS_TXTType WHERE DomainName = 'example.com'");

Failing to get all records available on specified domain however working if a single TXT record is provided.

Expected behavior

Should return all TXT records using query SELECT * FROM MicrosoftDNS_TXTType WHERE DomainName = 'example.com'"

Actual behavior

Message :   "The WS-Management service cannot process the request. The WMI provider returned an 'invalid parameter' error. "
        MessageId:  "HRESULT 0x8033811e"
        Source  "Microsoft.Management.Infrastructure"   string
        StackTrace  "   at Microsoft.Management.Infrastructure.Internal.Operations.CimSyncEnumeratorBase`1.MoveNext()\r\n   at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection) in System.Collections.Generic\\List.cs:line 713\r\n   at System.Collections.Generic.List`1.AddRange(IEnumerable`1 collection) in System.Collections.Generic\\List.cs:line 283\r\n

Error details

No response

Environment data

Microsoft.Management.Infrastructure 2.0.0 
Windows server 2016
ASP.NET Core 3.1

Version

Microsoft.Management.Infrastructure 2.0.0

Visuals

No response