Forum Discussion
theyounngun
Mar 03, 2021Copper Contributor
How to get event log from Server
Dear All, Please help me. I've tried to create PS script in order to get event log when file is either deleted or created by somebody on ShareFile Server. It's working if they just create or dele...
- Mar 03, 2021
Hi
You can check the schedule history and see what happens and how the task was executed, probably you will find something like Task Scheduler did not launch task "\MyScriptName" because instance "{317256a8-7ddf-4cf8-8267-90ab66c84907}" of the same task is already running.
The Delete event log are listed one each another and I think that the Task Scheduler won't start the script as another instance is running.
What you can do is add a small delay to the script and let the script read multiple events and send them in one report, instead of having each event sent alone
theyounngun
Mar 04, 2021Copper Contributor
farismalaeb
Hi
Can you guide me what kind of command or how to add a small delay to script ? I'm not good at PS script. By the way do I have to make a change "MaxEvents" ?
Thank you.
Hi
Can you guide me what kind of command or how to add a small delay to script ? I'm not good at PS script. By the way do I have to make a change "MaxEvents" ?
Thank you.
farismalaeb
Mar 04, 2021Iron Contributor
sleep 20
- theyounngunMar 05, 2021Copper ContributorHello Farismalaeb.
I checked the command is Start-Sleep -s 20 and I have to put at the end of script Am I correct ?
Thank you- farismalaebMar 05, 2021Iron ContributorHi,
it's better to keep it in the top- theyounngunMar 05, 2021Copper ContributorOk Noted. I will try.
Thank so much.
- theyounngunMar 05, 2021Copper ContributorOk thanks. I will try to add that to script and might come to you again.
Have a nice day.