Quantcast
Channel: SCSM PowerShell Cmdlets
Viewing all articles
Browse latest Browse all 306

New Post: SCSMObjectTemplate

$
0
0
Hello, I have scrpit to make the service request and work fine, but form yesterday ist return some error.

I can made te SR, but when i what set the template for it:
$serviceRequest_SD1_TypeProjection = Get-SCSMTypeProjection -name System.WorkItem.ServiceRequestProjection$
$serviceRequest_SD1_Projection = Get-SCSMObjectProjection -ProjectionName $serviceRequest_SD1_TypeProjection.Name -Filter "Id -eq $ServiceRequest_SD1_ID"
$serviceRequest_SD1_Template = Get-SCSMObjectTemplate | Where-Object {$_.ID -eq "e0728326-9031-2e11-b3a1-dc5d8289e4ee"}
Set-SCSMObjectTemplate -Projection $serviceRequest_SD1_Projection -Template $serviceRequest_SD1_Template
First third lins work ok, buy last of them return:
Set-SCSMObjectTemplate : The given key was not present in the dictionary.
At line:1 char:1
Set-SCSMObjectTemplate -Projection $serviceRequest_SD1_Projection -Template $ser ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo          : InvalidOperation: (Template.60c992...45996818be9b3bc:ManagementPackObjectTemplate) [Set-SCSMObjectTemplate], KeyNotFoundException
FullyQualifiedErrorId : ApplyTemplate,SMLets.SetSCSMObjectTemplateCommand
I have no idea why. That day i imported someone management pack pack but that template is in another one and they are not connected.

Viewing all articles
Browse latest Browse all 306

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>