简体   繁体   English

SCSM 2012 R2-无法使用cmdlet获取工作项列表

[英]SCSM 2012 R2 - Unable to get list of Work Items using cmdlets

I am trying to use the inbuilt Powershell cmdlets for SCSM 2012 R2 in order to query the work items (Incidents, Service Requests, Problems) on a test box. 我试图将内置的Powershell cmdlet用于SCSM 2012 R2,以便在测试盒上查询工作项(突发事件,服务请求,问题)。

The command that I am trying to run is 我尝试运行的命令是

`Get-SCSMClassInstance -Class (Get-SCSMClass -Name System.WorkItem.Incident)`

The command runs without errors but I get no results even though I have ~20 test incidents. 该命令运行无错误,但是即使有约20个测试事件,也没有任何结果。 I have been tearing my hair out as I have tried various suggested methods on my journey with Google. 在尝试使用Google的各种建议方法时,我一直在扯头发。

Try: 尝试:

Get-SCSMObject -Class (Get-SCSMClass -Name 'System.WorkItem.Incident$')

Because Get-SCSMClass may return one match, use the '$' to anchor the name it matches on. 由于Get-SCSMClass可能返回一个匹配项,因此请使用'$'锚定其匹配的名称。 (if you run it without, you'll probably see about 4 classes returned). (如果不运行它,则可能会返回大约4个类)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM