【问题标题】:Get DNS Suffix Search list on remote servers获取远程服务器上的 DNS 后缀搜索列表
【发布时间】:2018-08-17 10:57:12
【问题描述】:

如果 DNS 后缀列表设置正确,我需要检查一堆服务器。

我计划使用 PowerShell 和 Get-DnsClientGlobalSetting,但我只能在本地计算机上工作。

那么,有没有办法,我可以从远程服务器列表中获取这些信息?

【问题讨论】:

    标签: powershell dns


    【解决方案1】:

    如有疑问,请阅读documentation(强调我的):

    Get-DnsClientGlobalSetting
       [-CimSession <CimSession[]>]
       [-ThrottleLimit <Int32>]
       [-AsJob]
       [<CommonParameters>]
    

    [...]
    -CimSession
    在远程会话或远程计算机上运行 cmdlet。 输入计算机名称或会话对象,例如 New-CimSessionGet-CimSession cmdlet 的输出。默认是本地计算机上的当前会话。

    参数-CimSession 采用主机名列表(或现有的 CIM 会话),因此像这样调用它:

    Get-DnsClientGlobalSetting -CimSession 'host1', 'host2', ...
    

    【讨论】:

    • CimSession 就是这样,有点尴尬,但感谢您启发我
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-02-14
    • 2020-02-06
    • 2020-10-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多