diff --git a/CVE-2021-44228-LOG4J/Invoke-TSxLOG4JRemote.ps1 b/CVE-2021-44228-LOG4J/Invoke-TSxLOG4JRemote.ps1 index 0eaccdc..a9f66d6 100644 --- a/CVE-2021-44228-LOG4J/Invoke-TSxLOG4JRemote.ps1 +++ b/CVE-2021-44228-LOG4J/Invoke-TSxLOG4JRemote.ps1 @@ -58,15 +58,15 @@ if (!(Test-Path -Path $WorkPath\LOG4JCollection)) { $TimeStamp = Get-Date -UFormat "%Y%m%d.%H%M%S" -If ($ADLookup) { +If ($PSCmdlet.ParameterSetName -eq 'AD') { $Computers = (Get-ADComputer -Filter { Enabled -eq $true -and OperatingSystem -like "*Server*" } -Properties DNSHostName | Select-Object DNSHostName).DNSHostName } -If ($FileList) { +If ($PSCmdlet.ParameterSetName -eq 'FileList') { $Computers = Get-Content -Path $FileList } -If ($FileList) { +If ($PSCmdlet.ParameterSetName -eq 'ComputerName') { $Computers = $ComputerName } @@ -181,4 +181,4 @@ $Object | Add-Member JobsStarted $i $Object | Add-Member JobsCompleted (Get-Job -Name "Invoke-RemoteLog4Check-$JobSuffix" | Where-Object State -eq Completed).Count $Object | Add-Member ComputersNotReacheble $Failed -$Object \ No newline at end of file +$Object