Hello everyone,
I was hoping someone may be able to help me with a Powershell query. I have a script which I can use to send out a message to all of our teacher's computers, this could be used to relay any critical messages that teachers need to see right away.
I've pasted the code below, in theory to send a message I'd open it in Notepad, go to edit, press replace and replace % with the message that needs to be sent, before running it as admin, I've tested it on a few machines and it works well:
Msg * /server:Computer01 "%"
Msg * /server:Computer02 "%"
Msg * /server:Computer03 "%"
However, here's where the problem is, I've been asked if a daily message can be sent out just before the end of school, to alert teacher's of any students who have after-school detentions.
I can just set a scheduled task to run the script once a day at the end of school, but, the list of students names would be different every day, and with the best will in the world, the IT department won't always have the time to update a scheduled script with the student's names in every day, it just wouldn't be viable for us to do it.
So, my question is - is there any way within PowerShell I can tweak the basic batch file above so that where the "%" is, I can insert the text a separate .txt document on an NTFS drive, so then I can tell the staff - "Put your message in the .txt file on SharedDrive/Notices/Notice.txt and that is what will be sent out at 15:15"??
Any help would be much appreciated, thank you in advance!!