-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Filled in .PARAMETER section of the comment block.
- Loading branch information
Showing
1 changed file
with
17 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 } | ||
|
||
|