How to read Windows Notification?

I have an interesting scenario where the software logs out users if they don’t reset their password within 30 days.

When the 30-day countdown begins, a notification appears in the Windows notification area, reminding users to reset their password within a specified number of days. If they fail to reset their password, the application logs them out on the password’s expiration date.

The behavior is somewhat unpredictable. I have observed the notification only once, making it impossible for me to capture a screenshot to share here.

My objective is to create a method that can monitor the notifications in the notification stack. When it identifies the relevant password reset notification, it should automatically send an email to the business user (BU) as a reminder to reset their password. This proactive approach ensures that the main application continues to function smoothly without being disrupted by password expiration issues.

The process will run on Mondays and Thursdays, but the challenge lies in the fact that the notification may not always be visible when the bot runs. It might have been displayed previously and is accessible from the Windows notification tray (Probably, Not sure if its visible in Windows notification tray ). When I detect such a notification, I will record the expiration date and notify the BU accordingly.

@indiedev91

Instead you can try to maintain the dates with in a db or data entity and then use those as references to send notifications to business team once it approaches last week or two weeks

Cheers

The situation is quite variable, as indicated by their statement. There is no discernible pattern regarding the expiration dates. It’s puzzling that something like this doesn’t adhere to fixed rules. I believe there must be a window of time after the notification initiates, but the users themselves seem to be unaware of it.

It also seems that using UI automation may not be practical. It might be more efficient to access text stored in a file that Windows displays as a notification. If this is the case, it might be feasible to read the notification from that file itself. However, I doubt that Windows maintains any specific files for notifications. I’m not entirely certain about this situation.

You can try building a custom activity here using UiPath

Create a custom activity in UiPath to handle the SysTrayNotifier events. This custom activity can be used to extract the text of the notification and send an email to the BU if the notification is a password reset notification where SysTrayNotifier is a free and open-source tool that allows you to monitor the Windows notification tray and receive events when new notifications are received.

This approach is better than using UI automation because it is more reliable and efficient

I haven’t tried it
But thought would help you in this scenario

Even if not this I would still recommend to build a custom activity to handle this

Cheers @indiedev91

Could you tell if this can help

1 Like

@indiedev91

The link you provided might help…but as you mentioned earlier…the notifications might not persist or are random…so there is a chance of missing them as well…

For which ever application you are trying to do this…check with the corresponding application team to know the expiry dates interval …that might be more viable

Cheers

Yes but atleast its will show in the notification tray right

1 Like

Yeah it does
You can build either a workflow or custom activity referring to this method or accessing the notification informations

Cheers @indiedev91

Thanks , I will try to run this code in VS and let you know if its working or not , after that i can make an activity out of it , thanks for the idea

1 Like

@indiedev91

If it persists in the notifications you can use…

But as you mentioned uou saw only once…I thought may be the trace is also not there

Cheers

+1 for this approach. Scanning Windows notifications seems error prone, taking into consideration that the process is not going to be running 24/7.

If this is MS account related, your AD team should be able to provide you expiration dates for the accounts.

Yes you are correct the bot is not going to run 24/7

No they are hoping on me for a solution

And it’s question of Windows user credential? In that case one solution would be to open a command line, and type the command

net user [username] /[domain]

replace [username] with the actual username and [domain] with the actual domain.

As a result you will see the information about the account, including the next expiration date of password.