Skip to content

Commit 91f360d

Browse files
committed
The Channel in telemetry is nomore logged on DW
1 parent 6095530 commit 91f360d

File tree

1 file changed

+37
-31
lines changed

1 file changed

+37
-31
lines changed
Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,46 @@
11
function AddToStatInfo_SmEnv_SM() {
2-
#region Notification Channel
3-
# Caution: Authentication types are hardcoded to be only Anonymous,OAUTHAuthentication,WindowsIntegrated
4-
$Channel = CreateElementForStatInfo -elemTagName Channel
5-
$ChannelData = GetFileContentInSourceFolder Get-SCSMChannel.csv | ConvertFrom-Csv
6-
$Channel.SetAttribute("IsEnabled", $ChannelData.IsEnabled)
72

8-
$ConfigurationSources = CreateElementForStatInfo -elemTagName ConfigurationSources
9-
$ConfigurationSourcesData = GetFileContentInSourceFolder Get-SCSMChannel_WithAuthentication.csv | ConvertFrom-Csv
10-
$authCounts = @{
11-
"Anonymous" = 0
12-
"OAUTHAuthentication" = 0
13-
"WindowsIntegrated" = 0
14-
}
15-
$count_Total = 0
16-
$ConfigurationSources.SetAttribute("PrimaryAuth", "None")
17-
foreach($line in $ConfigurationSourcesData) {
3+
if (IsSourceScsmMgmtServer) { # if running on a WF or Secondary mgmt server.
4+
5+
#region Notification Channel
6+
# Caution: Authentication types are hardcoded to be only Anonymous,OAUTHAuthentication,WindowsIntegrated
7+
$Channel = CreateElementForStatInfo -elemTagName Channel
8+
$ChannelData = GetFileContentInSourceFolder Get-SCSMChannel.csv | ConvertFrom-Csv
9+
$Channel.SetAttribute("IsEnabled", $ChannelData.IsEnabled)
1810

19-
if ($line.SequenceNumber -eq "0") {
20-
$ConfigurationSources.SetAttribute("PrimaryAuth", $line.Authentication)
11+
$ConfigurationSources = CreateElementForStatInfo -elemTagName ConfigurationSources
12+
$ConfigurationSourcesData = GetFileContentInSourceFolder Get-SCSMChannel_WithAuthentication.csv | ConvertFrom-Csv
13+
$authCounts = @{
14+
"Anonymous" = 0
15+
"OAUTHAuthentication" = 0
16+
"WindowsIntegrated" = 0
2117
}
22-
$ConfigurationSource = CreateElementForStatInfo -elemTagName ConfigurationSource
23-
$ConfigurationSource.SetAttribute("SequenceNumber", $line.SequenceNumber)
24-
$ConfigurationSource.SetAttribute("Authentication", $line.Authentication)
18+
$count_Total = 0
19+
$ConfigurationSources.SetAttribute("PrimaryAuth", "None")
20+
foreach($line in $ConfigurationSourcesData) {
21+
if ($line.SequenceNumber -eq "0") {
22+
$ConfigurationSources.SetAttribute("PrimaryAuth", $line.Authentication)
23+
}
24+
$ConfigurationSource = CreateElementForStatInfo -elemTagName ConfigurationSource
25+
$ConfigurationSource.SetAttribute("SequenceNumber", $line.SequenceNumber)
26+
$ConfigurationSource.SetAttribute("Authentication", $line.Authentication)
2527

26-
$ConfigurationSources.AppendChild( $ConfigurationSource ) | Out-Null
28+
$ConfigurationSources.AppendChild( $ConfigurationSource ) | Out-Null
2729

28-
$authCounts[$line.Authentication]++
29-
$count_Total++
30-
}
31-
$ConfigurationSources.SetAttribute("Count_Total", $count_Total.ToString() )
32-
$ConfigurationSources.SetAttribute("Count_Anonymous", $authCounts["Anonymous"].ToString() )
33-
$ConfigurationSources.SetAttribute("Count_OAUTHAuthentication", $authCounts["OAUTHAuthentication"].ToString() )
34-
$ConfigurationSources.SetAttribute("Count_WindowsIntegrated", $authCounts["WindowsIntegrated"].ToString() )
30+
$authCounts[$line.Authentication]++
31+
$count_Total++
32+
}
33+
$ConfigurationSources.SetAttribute("Count_Total", $count_Total.ToString() )
34+
$ConfigurationSources.SetAttribute("Count_Anonymous", $authCounts["Anonymous"].ToString() )
35+
$ConfigurationSources.SetAttribute("Count_OAUTHAuthentication", $authCounts["OAUTHAuthentication"].ToString() )
36+
$ConfigurationSources.SetAttribute("Count_WindowsIntegrated", $authCounts["WindowsIntegrated"].ToString() )
3537

36-
$Channel.AppendChild($ConfigurationSources)
37-
$smEnv_SM.AppendChild($Channel)
38-
#endregion
38+
$Channel.AppendChild($ConfigurationSources)
39+
$smEnv_SM.AppendChild($Channel)
40+
#endregion
3941

42+
#region Connectors
43+
44+
#endregion
45+
}
4046
}

0 commit comments

Comments
 (0)