-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Set-SCSMsupportGroup.ps1
36 lines (31 loc) · 1.3 KB
/
Set-SCSMsupportGroup.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Set Support Group based on Incident Classification and Incident Description content
Import-Module SMlets
$smDefaultComputer = "SCSM1"
$irID = "IR2046"
$supportGroup1 = "AppSupport-1"
$supportGroup2 = "AppSupport-2"
$irClassification = "Application1"
$classIncident = Get-SCSMClass -Name System.WorkItem.Incident$
$irObj = Get-SCSMObject -Class $classIncident -Filter "ID -eq $irID"
$irDescription = $irObj.Description
$irObjClassification = $irObj.Classification.DisplayName
if ($irObjClassification -eq $irClassification) {
if ($irDescription -match "Are you seeing an error message when opening Application1: Yes") {
Set-SCSMObject -SMObject $irObj -Property "TierQueue" -Value $supportGroup2
$result = "IR is classification $irClassification and SupportGroup $supportGroup2"
}
else {
if ($irDescription -match "Do you need a file unlocked: Yes") {
$newSupportGroup = "$enumSupportGroup1"
Set-SCSMObject -SMObject $irObj -Property TierQueue -Value $supportGroup1
$result = "IR is classification $irClassification and SupportGroup $supportGroup1"
}
else {
$result = "IR is classification $irClassification but no condition met"
}
}
}
else {
$result = "IR is not classification $irClassification"
}
$result