winrm e winrm/config/listener
将列出所有监听器,但以字符串格式显示。像这样:
Listener
Address = *
Transport = HTTPS
Port = 5986
Hostname
Enabled = true
URLPrefix = wsman
CertificateThumbprint = B
ListeningOn = 1.100.25.2, 127.0.0.1, 169.254.67.216, 169.254.74.33, 169.254.130.15, 172.20.0.1, 172.22.240.1, ::1
例如,我无法仅隔离地址字段。就像 $a.address.
Get-WSManInstance -ResourceURI winrm/config/listener
需要选择地址和传输来列出侦听器。 是否可以告诉 Get-WSManInstance 列出所有侦听器,以便我能够操作属性,或者我是否必须从 winrm 命令拆分文本输出? 谢谢。
您可以为地址传递通配符 (
*
),并使用 SelectorSet
参数指定传输。
Get-WSManInstance -ResourceURI winrm/config/listener -SelectorSet @{Address="*";Transport="http"}