Published: 01/08/2018
Applies to: Cayosoft Administrator 5.x.
Summary:
Every result of each rule, including actions in Web Interface, is stored as an individual report in the Execution History. This information is critical for monitoring the system for problems and troubleshooting.
Execution history reports store in Execution History database (Cayo.PolicyManager.RH) and we recommend to clean up this database once per month.
Cayosoft Administrator has a special build-in rule 'Home > Rules > Built-in Rules (Pre-configured) > Archive Execution History' that automatically archives and then cleanups execution history details. The rule exports Execution History database records to separate HTML files to a folder specified in the rule. It is customizable, and you can change the cleanup period and the folder where exported records will be saved.
Eventually, there comes a time when you need to free up space in a folder with exported records and in this article, we describe how to archive these files by default Windows tool into a .zip archive and avoid errors.
Prepare RunHistory files for archiving (not required since v5.3.2)
Some of Cayosoft Administrator rules contain special character '™' that can cause an error in the work of archiving tools. We recommend renaming all files that contain prohibited symbols before running the tool by the PowerShell script below.
This script finds all files with '™' in the folder with RunHistory records and removes the symbol from file names.
How to run the script:
- Open the Windows PowerShell command prompt or the Windows PowerShell ISE
- If you customized export path in the 'Archive Execution History' rule you need to change $inputFolder variable value before running the script.
- Paste the script text below into PowerShell console and press Enter
$inputFolder = "C:\ProgramData\Cayo Software\AdminAssistant\Reports"
#$charsToReplace = @('™','®','©')
$charsToReplace = @('™')
$charReplaceTo = ''$RenamedFileNames = @{}
$fileItems = Get-ChildItem -path $inputFolder
foreach ($fileItem in $fileItems)
{
$fileItemName = $fileItem.Name
$fileItemNameNew = $fileItemName
foreach ($charToReplace in $charsToReplace)
{
$fileItemNameNew=$fileItemNameNew.Replace($charToReplace, $charReplaceTo)
}if ($fileItemName -ne $fileItemNameNew)
{
$fileName= [System.IO.Path]::Combine($inputFolder, $fileItemName)
$fileNameNew= [System.IO.Path]::Combine($inputFolder, $fileItemNameNew)
#Rename-Item -path $fileName -newName $fileNameNew -force
Move-Item -path $fileName -destination $fileNameNew -force
$RenamedFileNames.Add($fileItemName, $fileItemNameNew)
}
}#$RenamedFileNames
$RenamedFileNames.Count - Wait until the script completes, it should show the number of updated files as a result.
How to archive these files by default Windows tool
Windows provides a simple tool that can create a zip archive with files selected in the folder.
All you need to do is:
- Open RunHistory folder location. By default it is 'C:\ProgramData\Cayo Software\AdminAssistant\Backup\RunHistory'.
- Select all files in the folder, right-click on them, then select Send to > Compressed (zipped) folder.
- As a result, a new compressed folder will appear in the folder. Now you can delete all archived files.
Related Articles
Working with Cayosoft Administrator Execution and Change History
Comments
0 comments
Please sign in to leave a comment.