Maintain control of your Microsoft 365 data
Post Reply
rtheseeker
Enthusiast
Posts: 56
Liked: 2 times
Joined: Sep 26, 2022 9:13 pm
Full Name: Rajeev Mehta
Contact:

powershell script to count the instance specific warning message

Post by rtheseeker »

we have multiible backup jobs protecting thousands of users; as a result we get warning acrosss diffrent jobs; it becomes very cumbersome to look at each job and scroll through the warning(100s) for each job to see if there is any new warning type as most of the warning relate to Exchange Account not found or Does not have a valid Office 365 License however recently buried among these messages was group owner not found.
Is there a way to script this?
Mildur
Product Manager
Posts: 8735
Liked: 2296 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: powershell script to count the instance specific warning message

Post by Mildur » 1 person likes this post

Hello Rajeev

You could write a script with a command similar to mine. It takes the last job session and filters out every "success" info.

Code: Select all

Get-VBOJobSession -JobType backup -last | select -First 50 -ExpandProperty Log | select title | Where-Object {$_.Title -notlike "*Success*"}
Best,
Fabian
Product Management Analyst @ Veeam Software
rtheseeker
Enthusiast
Posts: 56
Liked: 2 times
Joined: Sep 26, 2022 9:13 pm
Full Name: Rajeev Mehta
Contact:

Re: powershell script to count the instance specific warning message

Post by rtheseeker »

I could not get all the warning of a job into an array so that I can loop through the array and check for specific warnings
I did manage to achive this using Excel however this involves a bit of manual work
- copy the warning to excel sheet; each warning gets copied in a cell, then use match formula to check for common warning anything that does not match use another formula to check for other common error and likewise so eventually anything which do not fall into these known warnings are unqiue and investigated
for example
I copy warning from each job protecting multiple mailboxes on the basis of Azure Dynamic Groups

Code: Select all

1/17/2024 7:00:09 PM :: Processing mailbox XYZ completed with warning: Exchange account was not found ()..1000s of such entries in a job 
and copy it to Excel sheet and use the following

Code: Select all

=IF(ISNUMBER(SEARCH("Exchange account was not found", A2)), "Match", "No Match")
I then filter no Match and repeat the above formula to match another common warning

Code: Select all

=IF(ISNUMBER(SEARCH("Mailbox does not have a valid Microsoft 365 license", A1890)), "Match", "No Match")
Finally anything that does not match I investigate

Is it possible to use a powershell script to achive this without this manual work; all I am looking for is to get a alert if there is a new type of warning so that I do not miss anything
Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests