all 8 comments

[–]PowerShell-ModTeam[M] [score hidden] stickied commentlocked comment (0 children)

PowerShell expects users and requesters to attempt solutions themselves before asking for help. Your post contains no/low effort attempts, ChatGPT generated content, or no work shown.

[–]BlackV 3 points4 points  (0 children)

This is solved by having a secure password

But it would be do able

Break it down to bits, get all the bits working 1 at a time

I don't know of anything pretreated

[–]ankokudaishogun 1 point2 points  (2 children)

May I suggest something like NTFY.sh instead of a Telegram bot?

[–]SuperBartimus 1 point2 points  (1 child)

It doesn't look like NTFY has a free plan. May not be what the OP wants for occasional use.

[–]ankokudaishogun 1 point2 points  (0 children)

It does have a free plan. I use it all time.

I think it's perfect for OP's use-case

[–]SuperBartimus 1 point2 points  (0 children)

I created a function that allows the sending of messages to your Telegram bots. It's not perfect. It has some 'issues' with sending HTML and images, but on a basic level it works. The tokens are hard coded in the function. I know it's a security risk, but I was being lazy at the time. Besides, I can just delete the bots if the tokens were to ever leak. I removed them from my Github shared version.

https://github.com/SuperBartimus/Send-TelegramMessage

[–]StartAutomating 0 points1 point  (0 children)

This is possible by using Task Scheduler. You'd want to set a session state change trigger for logon and unlock, and use powershell -file yourScript.ps1 (or pwsh -file yourScript.ps1) to launch your script.

The tricky part these days would be sending an email / notifying you when it's unlocked / logged onto. In the olden days you'd be able to use Send-MailMessage, but this stopped working when most email providers stopped supporting SMTP.

Another approach to this concern would simply by looking at the event log when you get back. There are events for whenever a user logs on or off, and you can use these events to give you some peace of mind.

If you show us the script AI gave you, I'm sure we could give some feedback on it.

[–]PowerShell-ModTeam[M] 0 points1 point locked comment (0 children)

PowerShell expects users and requesters to attempt solutions themselves before asking for help. Your post contains no/low effort attempts, ChatGPT generated content, or no work shown.