power shell file not created - powershell

my need is that I have an interface that drops files regularly into a specific directory. I need to monitor this directory to make sure the interface is still functional. I must be notified by e-mail if there is no new file created for more than one specific time (x hours). I need a script powershell that can notify me in this specific case.

You need to have some Cron Job Schedule that will send you the email by checking the status of you conditions.
Link below will help you.
https://technet.microsoft.com/en-us/library/jj649816(v=wps.630).aspx
Thanks

Related

Schedule script to attach CSV file report to a data source in servicenow

Schedule script to attach CSV file report to a data source in servicenow.
Schedule script that automatically attach csv file to the data source in servicenow.
how can we achieve this scenario?
Well this can be achieved in multiple ways. Bit of a vague description you have there. So I'll just drop a few general ideas for you:
If you don't mind turning things around, you could consider an external program push the file directly to ServiceNow and then run the associated TransformMap:
https://docs.servicenow.com/bundle/orlando-platform-administration/page/administer/import-sets/task/t_PostCSVOrExcelFilesToImportSet.html
If you have an FTP, you can have a scheduled script that will fetch the file from the FTP and run the transform:
https://docs.servicenow.com/bundle/orlando-platform-administration/page/administer/import-sets/task/t_ScheduleADataImport.html
You could use the MID Server application to have your custom logic of retrieving the file data. This is probably most complex to set up but also giving you the biggest advantages, like having your file encrypted etc. Basically, MID Server checks every couple seconds for a piece of code to be executed (called probes), for example you could trigger some Powershell script sitting on your server with it.
I'm sure there's other options as well. Good luck!

SCOM Rule for Fake Alerts

I am working on a tool to generate fake data for System Center Operations Manager for internal testing purposes. I wrote a script as part of a discovery that is able to create an instance of any class I want and make SCOM fake-discover it. Currently, I'm using a class for AD Printer. Now the next step is to somehow create alerts on behalf of the Printer. For this, I wrote a rule targeted at the AD Printer, which reads from the logs to detect when it should be fired. The logs are being written to from a PowerShell script. However, I see no results. But when I target the same rule to All Windows Computers, I see the alerts.
From what I understand the rule will run on all agents that have an instance of the target class. Since I fake-discovered the AD Printer on this agent (which also happens to be the Management Server), should the rule not run on this?
Any other suggestions on how I can achieve this are welcome as well.
PS. I probably cannot share any of my code as I am under an NDA, but I can clarify my approach further, if needed.
Yes, the Powershell script should run on the agents which have instances of the AD Printer. I recommend you to check the OperationsManager event log for script errors. The easiest way to generate (fake) alerts is to set up a simple, Event-based text log monitor: one specific word can trigger the unhealthy state (which in turn generates an alert), while another word resets the monitor to the healthy state. You can specify criteria for both events. Look at this blog post for further details.

Automated email cakephp 3.x

I am trying to develop a system which allows the user to enter a date and time. Then at entered time the system send an email to the user. I already have the system. All I am looking for is a way to send emails at a given time. I can send emails but cannot programme them to be sent on a precise date and time. Can you help me please? Thanks in advance.
This problem could be solves by using a "cron job" that checks at some interval whether there's any emails to be send now.
You could simply make a single Cake Shell (http://book.cakephp.org/3.0/en/console-and-shells.html) and use some built-in task runner (eg. cron on linux) - but you could also use a plugin for this principle and have that part set up for you.
For a quick'n'easy plugin that works for lots of sites: https://github.com/dereuromark/cakephp-queue.
The functionality you're asking is even built into this plugin already! :)
You'll have got create a class like this: https://github.com/dereuromark/cakephp-queue/blob/master/src/Shell/Task/QueueExampleTask.php#L74 and then just create a new job of this task and set the notbefore parameter to the time you want this email to be sent.
Check the readme here: https://github.com/dereuromark/cakephp-queue/tree/master/docs.
Remark: The email will be sent when the worker executes the given task, so it will be x time after the notbefore property, depending on your amount of workers and jobs - and how long time they'll take to execute.

Suitescript - nlapiSendEmail() - Can I delay an email through script to send on certain date?

I currently have a script that triggers on save that sends out an email. However, under certain criteria, I would like to still trigger the script on save but delay the email until a certain date. Is this possible? How would that be written?
You might want to you NetSuite Workflow. You can put the record in a workflow state based on you condition. On that workflow state have a delay transition to another state after x days which will send the email.
Look at the SuiteAnswer for drop marketing for sample workflows.
#scheppsr77's answer is a good idea.
Another way to do it would be to create a new custom record type that holds the email information and the date you want to send it on. Then have a script that runs periodically checking for any emails to send. Basically it could run like a cron job. I've done that before, for certain items that needed to be re-run or needed to delay.

Email Task in Informatica

Is there a way of sending a text version of your changes to a mapping on an email task? I have mapping that would make approximately 10 changes to a table. As this mapping finishes, I want to use the email task to send the recipient a list of changes that were made.
Is that possible? (If not, is the next best solution outputting these changes to a .txt or flat file, and sending that to the recipient?) Either way, can someone provide detailed instructions on how to accomplish this task? I just want to know the changes made in an email form.
Thank you