You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过WMI查询获取RRAS SSTP端口数量?

Solution to Retrieve SSTP Ports via WMI Query in PowerShell

Got it, I’ve dug into this for you—since you’re restricted to using Get-WmiObject -Query instead of the Get-VpnServerIPsecConfiguration cmdlet, here’s exactly what you need:

The SstpPorts value you’re after is stored in the VpnServerIPsecConfiguration WMI class, which lives under the Root\Microsoft\Windows\RemoteAccess namespace (not the default root\cimv2).

Working WMI Query Commands

You can retrieve the SSTP port count with either of these PowerShell commands:

  1. Specify the namespace explicitly with the -Namespace parameter:
Get-WmiObject -Namespace "Root\Microsoft\Windows\RemoteAccess" -Query "SELECT SstpPorts FROM VpnServerIPsecConfiguration"
  1. Or include the namespace directly in your query string:
Get-WmiObject -Query "SELECT SstpPorts FROM Root\Microsoft\Windows\RemoteAccess.VpnServerIPsecConfiguration"

Key Notes

  • You’ll likely need elevated (administrator) privileges to access this WMI class—RemoteAccess-related configuration data is restricted to admin-level users.
  • The result will match exactly what you get from (Get-VpnServerIPsecConfiguration).SstpPorts, since both pull from the same underlying WMI data source.

内容的提问来源于stack exchange,提问作者rGA145

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.07 22:27:33