locked
Launch script powershell from cmd RRS feed

  • Question

  • Hi Everyone!!

    First of all thanks for all the support that you provide!! I've read in the forum but I couldn't get anything about the following issue:

    I have a scrip called "test.ps1", this script basically shutdown Virtual Machines in a cluster  and Hosts (2 Servers). Besides I have another script call "Sh.cmd" with this text: powershell -file "c:\script\test.ps1".

    The issue is If I run manually the "Sh.cmd" script with domain administrator account everything is ok and it works. However if a configure a task using a System account then the script just execute commands which affects only at local host, so only shutdown the Virtual Machine which are hosted in Host1 and only shutdown the Host 1... could anyone  tell me why?!!!!!

    The hosts and VM are 2008 R2 Sp1.

    Monday, July 8, 2013 2:43 PM

Answers

  • The easiest way is to re-configure the task using a Domain Administrator account.  However this is usually frown upon for security reasons.

    At the least the domain account you use should have the "Force Shutdown from a Remote System" user right on both cluster nodes and all the VMs you're trying to shutdown.  This right by default is only granted to local administrators; therefore that domain account will need to be a local administrator of all the computers mentioned above.

    Also make sure the "Run with highest privileges" checkbox is checked off.
    • Edited by AverageJoeOfToronto Thursday, July 11, 2013 4:08 AM Added notes
    • Proposed as answer by Mike Laughlin Thursday, July 11, 2013 4:44 AM
    • Marked as answer by jose_it Thursday, July 11, 2013 2:49 PM
    Thursday, July 11, 2013 4:03 AM

All replies

  • Hi,

    The local System account only has rights to the local system, not network resources. The account you run the task under will need to have rights to the second server as well.


    Don't retire TechNet!

    Monday, July 8, 2013 2:52 PM
  • Thank you for the reply!! Ok the problem is that I have a program (UPS'software) when it detects a UPS on battery launch this script and the user is System, so how can I force the "SH.cmd" that run under domain user???

    Thanks a lot of!!

    Tuesday, July 9, 2013 8:03 AM
  • The easiest way is to re-configure the task using a Domain Administrator account.  However this is usually frown upon for security reasons.

    At the least the domain account you use should have the "Force Shutdown from a Remote System" user right on both cluster nodes and all the VMs you're trying to shutdown.  This right by default is only granted to local administrators; therefore that domain account will need to be a local administrator of all the computers mentioned above.

    Also make sure the "Run with highest privileges" checkbox is checked off.
    • Edited by AverageJoeOfToronto Thursday, July 11, 2013 4:08 AM Added notes
    • Proposed as answer by Mike Laughlin Thursday, July 11, 2013 4:44 AM
    • Marked as answer by jose_it Thursday, July 11, 2013 2:49 PM
    Thursday, July 11, 2013 4:03 AM