Skip to content

Commit

Permalink
.PARAMETER
Browse files Browse the repository at this point in the history
Filled in .PARAMETER section of the comment block.
  • Loading branch information
kenrward authored Oct 17, 2023
1 parent fb83055 commit 14c138e
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions Segment/Trust Server/znlog-filter.ps1
Original file line number Diff line number Diff line change
@@ -1,20 +1,34 @@
<#
.Synopsis
.SYNOPSIS
Sample Script to parse through the trust server WinRM logs including those that are in zips.
.Description
.DESCRIPTION
This script will first grab zipi files depending on the number of days you set for lookback (default lookback two days).
Next the script will extract the zip files into the temp folder path.
After that, the script will copy the current Trust-WinRM.log file to the temp folder path.
Finally, the script will loop through all log files looking for lines that contain the assetID supplied and write those lines to a new file.
.PARAMETER targetAssetId
This is the Zero Networks Internal ID for the asset. It can be found
by going to the Asset page in the portal and looking at the URL.
The asset ID will be in the format of 'a:a:XYZabc12'
.PARAMETER logFolderPath
Path to where the trust-winrm.log and trust-winrm.log.zip file(s) reside.
Defaults to installation path\logs
.PARAMETER lookBack
Number of days to look back in zip files. Default = 2 days back.
.PARAMETER dpath
Path to where the extracted zip files should be placed and the outputfile.
.PARAMETER outputFile
Name of the output file.
.NOTES
Filename: znlog-filter.ps1
Author: Ken Ward <[email protected]>
Modified date: 10/17/2023
#>

$defaultAssetID = "a:a:tTrHI9Rm"
$defaultAssetID = "a:a:XYZabc12"
$targetAssetId = Read-Host -Prompt "AssetID [$defaultAssetID]"
if (-not $targetAssetId) { $targetAssetId = $defaultAssetID }

Expand Down

0 comments on commit 14c138e

Please sign in to comment.