🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.misc
Article #177

Re: SQL inside Windows OS?

#177
From: 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.
Technical Details
Message-ID: <4q32vvya5o3m.t09tncbkygj9.dlg@40tude.net>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <nlq36rFtn8pU1@mid.individual.net>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: JJ <jj4public@gmail.com>
Newsgroups: comp.misc
Subject: Re: SQL inside Windows OS?
Date: Sat, 14 Nov 2026 11:45:43 +0700
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <4q32vvya5o3m.t09tncbkygj9.dlg@40tude.net>
References: <nlq36rFtn8pU1@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 14 Nov 2026 04:46:11 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="1751099"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18BHl2hcamK0Q0EQ9lGqB6T+Mrpn9akrBY="; posting-host="e4d7bcaba9cbd9db66a7b062ff1052e3"
User-Agent: 40tude_Dialog/2.0.15.84
Cancel-Lock: sha1:lm3nNmS1+RYTCSBhnY+sJgFL9ww= sha256:FN4TUsekw2EakryL5bZYVHf+8E1xN+fPytSa4WEv9yM=
	sha1:6Q96t027Wy61pvZXpk4qPF7MIw0= sha256:3riY3wtpVVhiTDj65hrkEL5D6a6pGs8EDnIWFgsPU+g=
X-Face:  \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS