🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

6 total messages Started by Sylvia Else Sat, 14 Nov 2026 03:34
SQL inside Windows OS?
#176
Author: Sylvia Else
Date: Sat, 14 Nov 2026 03:34
17 lines
1509 bytes
This is a re-post, of sorts, since my previous attempt seems to have 
vanished into the void - something that Thunderbird occasionally does to me.

I was using a command in Windows Powershell and got this error

Get-NetTCPConnection: No matching MSFT_NetTCPConnection objects found by 
CIM query for instances of the ROOT/StandardCimv2/MSFT_NetTCPConnection 
class on the  CIM server: SELECT * FROM MSFT_NetTCPConnection  WHERE 
((State = 2)) AND ((OwningProcess = 99310)). Verify query parameters and 
retry.

This was an attempt to get the network ports on which a process is 
listening.

And it's doing an SQL query to achieve that? Are you for real?

Sylvia.
Re: SQL inside Windows OS?
#177
Author: JJ
Date: Sat, 14 Nov 2026 04:45
29 lines
2670 bytes
On Sat, 14 Nov 2026 11:34:51 +0800, Sylvia Else wrote:
> This is a re-post, of sorts, since my previous attempt seems to have 
> vanished into the void - something that Thunderbird occasionally does to me.
> 
> I was using a command in Windows Powershell and got this error
> 
> Get-NetTCPConnection: No matching MSFT_NetTCPConnection objects found by 
> CIM query for instances of the ROOT/StandardCimv2/MSFT_NetTCPConnection 
> class on the  CIM server: SELECT * FROM MSFT_NetTCPConnection  WHERE 
> ((State = 2)) AND ((OwningProcess = 99310)). Verify query parameters and 
> retry.
> 
> This was an attempt to get the network ports on which a process is 
> listening.
> 
> And it's doing an SQL query to achieve that? Are you for real?
> 
> Sylvia.

The SQL query is for WMI objects in the case. WMI provides both native API
and WQL (WMI Query Language; SQL for WMI), but for lazy development reason,
PowerShell chose to use WQL instead of native API. PowerShell's built-in
commands may also use SQL for other components instead of using native APIs
if available.

So, if you don't want PowerShell to use SQL, access WMI directly via its
native API from C# or VB.NET script. It'll be more work but it'd be slightly
faster and much more efficient - especially if what's needed must be
searched among all WMI objects and properties.
Re: SQL inside Windows OS?
#178
Author: Lawrence D’Oliveiro
Date: Sat, 14 Nov 2026 04:53
51 lines
3184 bytes
On Sat, 14 Nov 2026 11:34:51 +0800, Sylvia Else wrote:

> I was using a command in Windows Powershell and got this error
>
> Get-NetTCPConnection: No matching MSFT_NetTCPConnection objects found by
> CIM query for instances of the ROOT/StandardCimv2/MSFT_NetTCPConnection
> class on the  CIM server: SELECT * FROM MSFT_NetTCPConnection  WHERE
> ((State = 2)) AND ((OwningProcess = 99310)). Verify query parameters and
> retry.
>
> This was an attempt to get the network ports on which a process is
> listening.
>
> And it's doing an SQL query to achieve that? Are you for real?

Hey, what do I know, but how to do web searches. “CIM” might stand for
“Cloud Infrastructure Management”. Were you trying to get info
remotely from another machine? This blog post
<https://blog.ahasayen.com/powershell-cim-script/> says “CIM” is the
modern API that all the cool kids are using, in place of the old
hand-cranked jalopy-driven “WMI” way of querying info from other
machines.

Microsoft did try, once upon a time, to create a filesystem that
was actually a database underneath. The final incarnation of this
idea was “WinFS”, which was supposed to ship with Windows Vista,
along with two other revolutionary new technologies.

None of them made it into the final product.

IBM did succeed over two decades earlier, with its System/38 range,
later succeeded by AS/400. Also I believe BeOS from the 1990s had a
somewhat simplified version of the same idea, at least for doing file
searches.

Oh, by the way:

    SELECT * FROM MSFT_NetTCPConnection WHERE ((State = 2)) AND
    ((OwningProcess = 99310))

Wildcard field specs?? Really? (And look at all those parentheses ...)

> This is a re-post, of sorts, since my previous attempt seems to have
> vanished into the void - something that Thunderbird occasionally
> does to me.

It could also be that the NNTP service you posted to rejected it as
spam.

(I found that Eternal September would get triggered if I used a
certain peculiar word ...)
Re: SQL inside Windows OS?
#179
Author: Lawrence D’Oliveiro
Date: Sat, 14 Nov 2026 04:55
6 lines
1383 bytes
On Sat, 14 Nov 2026 11:45:43 +0700, JJ wrote:

> So, if you don't want PowerShell to use SQL, access WMI directly via
> its native API from C# or VB.NET script.

In other words, don’t use PowerShell ...
Re: SQL inside Windows OS?
#180
Author: Sylvia Else
Date: Sat, 14 Nov 2026 07:49
36 lines
2504 bytes
On 14-Nov-26 12:45 pm, JJ wrote:
> On Sat, 14 Nov 2026 11:34:51 +0800, Sylvia Else wrote:
>> This is a re-post, of sorts, since my previous attempt seems to have
>> vanished into the void - something that Thunderbird occasionally does to me.
>>
>> I was using a command in Windows Powershell and got this error
>>
>> Get-NetTCPConnection: No matching MSFT_NetTCPConnection objects found by
>> CIM query for instances of the ROOT/StandardCimv2/MSFT_NetTCPConnection
>> class on the  CIM server: SELECT * FROM MSFT_NetTCPConnection  WHERE
>> ((State = 2)) AND ((OwningProcess = 99310)). Verify query parameters and
>> retry.
>>
>> This was an attempt to get the network ports on which a process is
>> listening.
>>
>> And it's doing an SQL query to achieve that? Are you for real?
>>
>> Sylvia.
> 
> The SQL query is for WMI objects in the case. WMI provides both native API
> and WQL (WMI Query Language; SQL for WMI), but for lazy development reason,
> PowerShell chose to use WQL instead of native API. PowerShell's built-in
> commands may also use SQL for other components instead of using native APIs
> if available.
> 
> So, if you don't want PowerShell to use SQL, access WMI directly via its
> native API from C# or VB.NET script. It'll be more work but it'd be slightly
> faster and much more efficient - especially if what's needed must be
> searched among all WMI objects and properties.

OK, thanks. So it's not as bad as I thought.

Wouldn't have surprised me, though.

Sylvia.
Re: SQL inside Windows OS?
#181
Author: Andy Burns
Date: Sat, 14 Nov 2026 08:42
26 lines
1947 bytes
Sylvia Else wrote:

> This is a re-post, of sorts, since my previous attempt seems to have 
> vanished into the void - something that Thunderbird occasionally does to 
> me.

FWIW I don't remember your previous attempt making it to anwhere I was 
looking.
> I was using a command in Windows Powershell and got this error
> 
> Get-NetTCPConnection: No matching MSFT_NetTCPConnection objects found by 
> CIM query for instances of the ROOT/StandardCimv2/MSFT_NetTCPConnection 
> class on the  CIM server: SELECT * FROM MSFT_NetTCPConnection  WHERE 
> ((State = 2)) AND ((OwningProcess = 99310)). Verify query parameters and 
> retry.
> 
> This was an attempt to get the network ports on which a process is 
> listening.
> 
> And it's doing an SQL query to achieve that? Are you for real?
Not Microsoft's fault, the DMTF produced the CIM and WBEM standards, 
that's where the SQL-a-like query language comes from.  Microsoft 
implemented them as WMI on Windows, then later stacked Powershell 
cmdlets on top of that.

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads