多个 wsus 客户端使用 powershell 移动到 wsus 控制台中的特定组

问题描述

这是我的代码

我正在尝试将内容从 servername.txt 移动到 wsus 控制台中的特定组 谁能告诉我错误是什么 任何答案将不胜感激谢谢

$content = Get-Content .\servername.txt

$内容 | foreach{

$client =$wsus.SearchComputerTargets()

$group = $wsus.GetComputerTargetGroups() |其中 {$_.Name -eq "生产服务器"}

$group.AddComputerTarget($client) }

这是我的错误

找不到“SearchComputerTargets”的重载和参数计数:“0”。 在行:4 字符:25

  •                     $client =$wsus.SearchComputerTargets()
    
  •                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [],MethodException
    • FullyQualifiedErrorId : MethodCountCouldNotFindBest

找不到“AddComputerTarget”和参数计数的重载:“1”。 在行:6 字符:25

  •                     $group.AddComputerTarget($client)
    
  •                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [],MethodException
    • FullyQualifiedErrorId : MethodCountCouldNotFindBest

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)