1

我正在尝试在我正在创建的管理包中使用 PowerShell 脚本来自动触发发现。

我尝试使用链接中描述的 PowerShell 脚本:

任务结果/输出 Discovery_not_found SCOM

TaskId               : ff34dc4f-2db3-1736-d9f2-6d85b539ff96
BatchId              : 53d9f71a-a3ce-494f-9536-cc2443d6fb1d
SubmittedBy          : dev2\administrator
RunningAs            : 
TargetObjectId       : 6904f683-999f-ae14-5be7-fef74d1e5596
TargetClassId        : ab4c891f-3359-3fb6-0704-075fbfe36710
LocationId           : 6904f683-999f-ae14-5be7-fef74d1e5596
Status               : Succeeded
Output               : <DataItem type="System.OnDemandDiscoveryResponse" time="2013-08-16T11:36:10.9682547-07:00" sourceHealthServiceId="6904F683-999F-AE14-5BE7-FEF74D1E5596"><Result>DISCOVERY_NOT_FOUND</Result><Timestamp></Timesta
                       mp></DataItem>
ErrorCode            : 0

我尝试了操作控制台任务,得到了与图像所示相同的结果。

注意我传递了我拥有的发现的 GUID。我尝试将目标 ID 保留为 $Target/Id$ 并将其更改为我的发现运行的目标类的 GUID。两者都在下面给出了相同的结果。

4

1 回答 1

0

发现可以在 SCOM 管理服务器/网关或代理上运行。Michel 的示例发现在管理服务器上运行。大多数发现将在代理上运行,如果是这种情况,您需要将类更改为“Microsoft.SystemCenter.Agent”。替换这一行:

$instance=get-scomclass -name Microsoft.SystemCenter.ManagementServer | get-
scomclassinstance | ?{$_.displayname -eq $Omserver}

有了这个:

$instance = get-scomclass -name Microsoft.SystemCenter.Agent | get-
scomclassinstance | ?{$_.displayname -eq $TargetDisplayName}
于 2017-10-23T18:31:26.300 回答