The transition to NetApp MS Azure AD B2C is complete. If you missed the pre-registration, you will be invited to register at next log in.
Please note that access to your NetApp data may take up to 1 hour.
To learn more, read the FAQ and watch the video.
Need assistance? Complete this form and select “Registration Issue” as the Feedback Category.

Active IQ Unified Manager Discussions

Pass alarm environment variable to PowerShell


First post here, hope this is the right spot.

I'm trying to pass the environment variables from the OnCommand 5.0 Console Alarm Script to a PowerShell script similar to how it's worked in the past with perl:

I was wondering if anyone has any experience with this, or is this uncharted territory?

I'd be happy to upload some scripts that I've been working on if there is any interest.





Yes I do just recently, see this post I did on it


I solved this a while ago, but in a different way. I wasn't able to launch a PowerShell script directly from the alarm. If I put a file with a ps1 extension, it simply ignored it. I'm not sure it there is a problem with my install, or if I'm simply doing it wrong. I was able to create a batch file script, and pass the variable to a PowerShell script inside. Cumbersome, but I got it working. If you're having success launching PowerShell scripts directly from the alarm then that's awesome!




I got alarming working with the following command:


dfm alarm create -C Critical -s "powershell -command <scriptname>"


I'am now looking for information how toget the alarm variables into my powershell script.


If somebody knows how to do this, please share.






Yes I was able to get it to work it took a while but I did not want to go the batch file route some of the keys things were making sure in the path that the executable name to use was present should look something like this (powershell.exe c:\script.ps1) and I think I did self signed for the security in powershell since its running on the on command server. I also dropped the ps1 file on the root of C: and then my script goes to that location before it does anything.



I've tried what you have documented but I still cannot get the script to execute when I perform an alarm test. I've set the powershell execution policy to Unrestricte with no joy and also placed the script in the root of the c:\.

Any ideas?


Sorry guys I know how frustrating  this can be for some reason one of my issues was that before the script ran I needed to send powershell to the script what I did was in the first part of my script it sets the script run location in the same dir as myscript. I think it was a permission issue or something. Also need to ensure that when the script is excuted its done with the proper permission

Thx for your quick reply.

i can't add the 'Run script as:' option, This is only an option on Unix platforms is the response i get. When i run the command exactly as i do with the Alarm notification script, then the script works. This is the command i use in 'Script': powershell.exe D:\Progs\Powershell\scripts\test.ps1

Pls use the cli to create or modify the alarm with the script path.

This is a known issue and pls open a case with netapp support center and add it to bug 666431




We are facing the same issue, the alarm triggers the script. If you look in DFM log you will see that the powershell script is executed, but nothing happens. If i run the command which is executed from the alarm via start -> run, then the ps script works. In task manager you can see powershell is exexuted and stopped, but no error is  registered.

Did you find a solution for this?

Wim van der Heijden.

I did my script run in my environnement today when an event happens my script will parse the qtree owner and send them a custom email based on the event

NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner