Comments (5)
Looks like it throws an error when the event log is clean, so we will need to handle that gracefully.
PS C:\> Get-WinEvent -FilterHashtable @{LogName='Application'; ProviderName='MSExchange Unified Messaging'; Level='2'} | Where-Object { $_.Message -like "*System.InvalidCastException*"}
Get-WinEvent : No events were found that match the specified selection criteria.
At line:1 char:2
+ Get-WinEvent -FilterHashtable @{LogName='Application'; ProviderName= ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (:) [Get-WinEvent], Exception
+ FullyQualifiedErrorId : NoMatchingEventsFound,Microsoft.PowerShell.Commands.GetWinEventCommand
from css-exchange.
That is true, but I experience the same when the eventlog is clean using the Get-Eventlog CMDlet
from css-exchange.
Ah you're right, we just need to tack on the SilentlyContinue like the other command had.
from css-exchange.
Thank you!
from css-exchange.
Right, forgot to take parameter "-ErrorAction SilentlyContinue" into my command
from css-exchange.
Related Issues (20)
- Show script version before update
- [Work Item] MSQM Updated Guidance
- [Work Item] New code formatter check to detect domains that have not been approved by CELA
- Health Checker - Add additional context for services that are not running
- [Issue] Update-Engines overwrites the files on 2nd run
- [Issue] Health Checker - Get-LocalGroupMember failing to execute
- [Issue] Health Checker - Get-SecurityCve-2022-21978 parameter ExchangeWellKnownSecurityGroups is null
- [Issue]ExPerfWiz adds counters incorrectly to datacollector HOT 2
- Add ability to collect REST logs in Exchange log collector HOT 2
- [Work Item] Health Checker - Add Installed Date for SU/HU/CUs when they are installed
- [Issue] - Health Checker computer group membership check HOT 5
- [Work Item] - Adjust output of Test-ExchAVExclusions
- Adding Disk Performance
- [Issue] Spelling issues in the .build folder
- Health Checker -- Include installed 3rd party applications in the report
- [Issue] - Health Checker HOT 2
- ExchangeLogCollector - Add HubProtocol logs to DefaultTransportLogging switch HOT 1
- [Issue] CodeFormatter fails for uncommitted changes
- ExchangeExtendedProtectionManagement.ps1 doesn't turn on PS SSL in Default Website HOT 8
- [Issue] - Health Checker --ERROR-- Not enough logs to cover 7 days HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from css-exchange.