Start a Conversation

This post is more than 5 years old

Solved!

Go to Solution

24594

March 19th, 2014 07:00

Dell ULNM Won't Run Shutdown Script

I have a Poweredge R610 running Windows Server 2012 R2 plugged into a Dell 1000W Tower UPS.  ULNM is installed on the server and runs fine.  When set to the "Shutdown" shutdown mode, ULNM shuts down the server according to the parameters with no issue.

However, I have other devices that I want to shut down at the same time, and have written scripts that work in the command line and as batch files to shut down those devices.  My goal is to configure ULNM into the "Script" shutdown mode so that ULNM runs my script when a shutdown is triggered.

Thus far, I have been unable to get ULNM to trigger any scripts.  While I have working versions of the final scripts, I've scaled all the way back to just a script that will shut down the local server, and cannot even get Dell ULNM to run that script.  Here is the current form:

Shutdown1.bat - runas /env /savecred /user:Administrator C:\Shutdown2.bat

Shutdown2.bat - shutdown -s -f

Please note that these commands need separated into two commands due to a strange Windows Server 2012 R2 issue that would cause Shutdown2.bat to just repeatedly spam a command prompt with the command with no effect.  Wrapping it in the run as administrator command solves this issue while manually running the batch files.  I did not experience this issue in Windows Server 2008 R2.  That being said, I tried pointing Dell ULNM first to Shutdown1.bat and second to Shutdown2.bat with no effect using either.

After batch files failed, I also wrote a Powershell script to accomplish the same thing, also with no result.  The Dell ULNM User Guide does not specify what file type of script is preferred.

In summary, I want Dell ULNM to run a script when a shutdown is triggered, but have not yet had any luck.  Any help is very much appreciated. If this should be directed to another forum, please let me know. Thanks for your time!

5 Posts

March 19th, 2014 15:00

Daniel,

I've disabled UAC and elevated ULNM to run as Administrator instead of Local System.  I have tried pointing to the batch file with and without quotes around the absolute path.  No obvious success yet.

However, I noticed in Task Manager that I now have several instances of notepad.exe open under the same user that I am logged in as (Administrator).  However, these windows are not actually open, in that I don't have any instances of notepad open, and no instances of notepad appear on the taskbar.  Testing shows that these hidden instances are directly tied when the script should be running, so it seems that the script is running, after a fashion.  However, when I replace the notepad batch file with either batch file indicated in my first post, I receive no result.

I'm still interested in knowing if Dell ULNM can run a script properly, but I have developed a workaround.  I am using Dell ULNM configured in regular shutdown mode to shut down the server.  I have then configured a task in Task Scheduler with the Dell ULNM Power Failure Event Viewer event as a trigger.  When triggered, the task delays for a set period of time, then compares the latest Power Failure event with the latest Power Restore event.  If the power has not yet been restored, it executes the actions I need to shut down other devices.  I can provide this information to others if requested.

Thanks for the help!

Moderator

 • 

6.2K Posts

March 19th, 2014 09:00

Hello cwetzel

Could you post exactly what you are putting into ULNM. If you are wanting to execute that batch then you should have something like this in the Shutdown Script section:

c:\scripts\folder\shutdown1.bat

All ULNM is going to do is post that in the command line interface. You will need to use the absolute path. I don't think you need to put it in quotations, but you might try that as well. Also, try running ULNM as administrator. It may need admin rights to start the batch file.

Thanks

5 Posts

March 19th, 2014 10:00

Daniel,

Please see the enclosed screenshot.  I will also try running it with quotes after hours tonight - it is in production use so I do not want to disrupt the users at this time.

Do you mean that I should run ULNM as administrator when I am configuring it to point at the script?  If so, I will try, though I am already logged in as the Administrator account.  Or do you mean that I should somehow elevate the service that runs ULNM to be run as administrator?  Please clarify and let me know details.  The shutdown scenario generally means that no one would be logged on to the machine, so if privileges are the issue, ULNM would need to be set to always be running as administrator, and I am not clear on the steps to set it that way.

Thank you for the help!

1 Attachment

Moderator

 • 

6.2K Posts

March 19th, 2014 13:00

Do you mean that I should run ULNM as administrator when I am configuring it to point at the script?  If so, I will try, though I am already logged in as the Administrator account.  Or do you mean that I should somehow elevate the service that runs ULNM to be run as administrator?

Yes, elevate the service to run as admin and test.

One thing you could also test with is a more simple batch file, like something that opens notepad.exe or paint.exe to test that the proper command is being sent to run the batch.

I suspect one of two things are happening. Either ULNM is not sending the command properly to execute the batch or the batch or some action within the batch is being blocked by UAC. Doing something as simple as opening notepad should let us know if it is executing the batch as there should be no elevated access required to do that.

Thanks

No Events found!

Top