Skip to content

Commit

Permalink
v2.3
Browse files Browse the repository at this point in the history
v2.3 -> manged 2008R2, IIS 7.5 issue and powershell version 2 and 3 .
  • Loading branch information
crnegule committed Jan 28, 2020
1 parent a9eb8e7 commit 1181c3e
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 8 deletions.
31 changes: 31 additions & 0 deletions Docs/2008R2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
### To to run tool first time please follow the seps below:

__1.__ Download the latest ZIP from : https://github.com/crnegule/LogCatcher/releases/latest

__2.__ Right Click the zip and select the option __Unblock__.

![Image of Unblock](/images/Unblock.jpg)

__3.__ Unzip the archive.

__4.__ Open Powershell with all modules present on server.

![Image of Unblock](/images/ImportModules.jpg)

__5.__ Move to the unzipped folder :
```
cd C:\temp\LogCatcherV2.2
```

__6.__ Run this to command before running the tool:
```
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force:$true
```
__7.__ If you have you can run the tool with:

* For UI: `.\LogCatcher.ps1` If you have PowerShell version 2 UI will error out, use CLI.
* For UI:
`.\LogCatcher.ps1 -Quiet $true -ZipLocation c:\temp -LogAge 42 -SiteIds "1,2"` If you have PowerShell version 2 ZIP will not be created, logs can be found in `FilteredMSDT` fodler.
* For Help :
`get-help .\LogCatcher.ps1`

File renamed without changes.
25 changes: 19 additions & 6 deletions LogCatcher/General/CatchFilteredIISzip.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,32 @@ foreach ($FilteredLogDefinition in $FilteredLOGSDefinitions) {
$ExcludeFilter += $stringtoADD
}
$iisInfo = Get-ItemProperty HKLM:\SOFTWARE\Microsoft\InetStp\
IF ($iisInfo -ge 8)
IF ($iisInfo.MajorVersion -ge 8)
{
GenerateSiteOverview -ErrorAction silentlycontinue -ErrorVariable +ErrorMessages | Out-Null
$logName = $GeneralTempLocation+"\SiteOverview.csv"
$Global:SiteOverview | Export-csv -Path $logName -NoTypeInformation -Force -ErrorAction silentlycontinue -ErrorVariable +ErrorMessages
}
else {
"$Time Exception Message: IIS server version is lower than 8.0 so no SiteOverView generated!" | Out-File $ToolLog -Append
}
Add-Type -assembly "system.io.compression.filesystem"
[io.compression.zipfile]::CreateFromDirectory($FilteredTempLocation, $FilteredZipFile)

Remove-Item -Recurse $FilteredTempLocation -Force -ErrorAction silentlycontinue -ErrorVariable +ErrorMessages
Remove-Item -Recurse $FilteredTempLocation -Force -ErrorAction silentlycontinue -ErrorVariable +ErrorMessages
}
else {
if($Host.Version.Major -ge 3)
{
Add-Type -assembly "system.io.compression.filesystem"
[io.compression.zipfile]::CreateFromDirectory($FilteredTempLocation, $FilteredZipFile)
Remove-Item -Recurse $FilteredTempLocation -Force -ErrorAction silentlycontinue -ErrorVariable +ErrorMessages
"$Time Exception Message: IIS server version is lower than 8.0 so no SiteOverView generated!" | Out-File $ToolLog -Append

}

else{
"$Time Exception Message: IIS server version is lower than 8.0 so no SiteOverView generated!" | Out-File $ToolLog -Append
"$Time Exception Message: Zip was not created as system.io.compression.filesystem version could not be loaded!" | Out-File $ToolLog -Append
}
}

Foreach ($Message in $ErrorMessages) {
$Time = Get-Date
$ErroText = $Message.Exception.Message
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# __LogCatcher__
[How To Run First Time](https://github.com/crnegule/LogCatcher/blob/master/RunFirstTime.md) | [Download LatestZIP](https://github.com/crnegule/LogCatcher/releases/latest)
-------------| -------------
[How To Run First Time](https://github.com/crnegule/LogCatcher/blob/master/Docs/RunFirstTime.md) | [Download LatestZIP](https://github.com/crnegule/LogCatcher/releases/latest)|[For 2008R2](https://github.com/crnegule/LogCatcher/blob/master/Docs/2008R2.md)
-------------| -------------| -------------



Expand Down
Binary file added images/ImportModules.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1181c3e

Please sign in to comment.