Исправить recovery config и разбор RDP sessions
This commit is contained in:
@@ -116,6 +116,7 @@ $config = New-ActivityWatchDeploymentConfig `
|
|||||||
-LogsRoot $effectiveLogsRoot `
|
-LogsRoot $effectiveLogsRoot `
|
||||||
-CollectorScript $effectiveCollector `
|
-CollectorScript $effectiveCollector `
|
||||||
-EndpointCollectorScript $effectiveEndpointCollector `
|
-EndpointCollectorScript $effectiveEndpointCollector `
|
||||||
|
-SessionCollectorScript $effectiveSessionCollector `
|
||||||
-RulesPath $effectiveRules `
|
-RulesPath $effectiveRules `
|
||||||
-PolicyPath $effectivePolicy `
|
-PolicyPath $effectivePolicy `
|
||||||
-PollSeconds $effectivePollSeconds `
|
-PollSeconds $effectivePollSeconds `
|
||||||
|
|||||||
@@ -70,16 +70,25 @@ function Get-SessionRecords {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$sessionName = ''
|
||||||
|
$sessionIdIndex = 2
|
||||||
|
if ($parts[1] -match '^\d+$') {
|
||||||
|
$sessionIdIndex = 1
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$sessionName = $parts[1]
|
||||||
|
}
|
||||||
|
|
||||||
$sessionId = 0
|
$sessionId = 0
|
||||||
if ($parts[2] -match '^\d+$') {
|
if ($parts[$sessionIdIndex] -match '^\d+$') {
|
||||||
$sessionId = [int]$parts[2]
|
$sessionId = [int]$parts[$sessionIdIndex]
|
||||||
}
|
}
|
||||||
|
|
||||||
$records += [pscustomobject]@{
|
$records += [pscustomobject]@{
|
||||||
username = $parts[0]
|
username = $parts[0]
|
||||||
sessionName = $parts[1]
|
sessionName = $sessionName
|
||||||
sessionId = $sessionId
|
sessionId = $sessionId
|
||||||
state = $parts[3]
|
state = $parts[$sessionIdIndex + 1]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ $config = New-ActivityWatchDeploymentConfig `
|
|||||||
-LogsRoot $effectiveLogsRoot `
|
-LogsRoot $effectiveLogsRoot `
|
||||||
-CollectorScript $effectiveCollector `
|
-CollectorScript $effectiveCollector `
|
||||||
-EndpointCollectorScript $effectiveEndpointCollector `
|
-EndpointCollectorScript $effectiveEndpointCollector `
|
||||||
|
-SessionCollectorScript $effectiveSessionCollector `
|
||||||
-RulesPath $effectiveRules `
|
-RulesPath $effectiveRules `
|
||||||
-PolicyPath $effectivePolicy `
|
-PolicyPath $effectivePolicy `
|
||||||
-PollSeconds $effectivePollSeconds `
|
-PollSeconds $effectivePollSeconds `
|
||||||
|
|||||||
@@ -70,16 +70,25 @@ function Get-SessionRecords {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$sessionName = ''
|
||||||
|
$sessionIdIndex = 2
|
||||||
|
if ($parts[1] -match '^\d+$') {
|
||||||
|
$sessionIdIndex = 1
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$sessionName = $parts[1]
|
||||||
|
}
|
||||||
|
|
||||||
$sessionId = 0
|
$sessionId = 0
|
||||||
if ($parts[2] -match '^\d+$') {
|
if ($parts[$sessionIdIndex] -match '^\d+$') {
|
||||||
$sessionId = [int]$parts[2]
|
$sessionId = [int]$parts[$sessionIdIndex]
|
||||||
}
|
}
|
||||||
|
|
||||||
$records += [pscustomobject]@{
|
$records += [pscustomobject]@{
|
||||||
username = $parts[0]
|
username = $parts[0]
|
||||||
sessionName = $parts[1]
|
sessionName = $sessionName
|
||||||
sessionId = $sessionId
|
sessionId = $sessionId
|
||||||
state = $parts[3]
|
state = $parts[$sessionIdIndex + 1]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user