4 Replies Latest reply on Oct 22, 2013 4:30 AM by Nand Mhase

    Error While Running Powershell Script Using NSH

      Hi All,


      We are configuring the Failover Cluster on Windows 2008 R2 using Powershell script.


      We are trying to execute a powershell script, which is used to validate windows 2008 R2 cluster. The script is executed but with errors.


      We already set execution policy to remote signed.


      --------------------------------------------------------Script Code-------------------------------------------

      echo "Import-Module failoverclusters" >> //$NodeFirstIP/c/nodeMainConfigSQL.ps1

      echo "Test-Cluster -Node $NodeFirstHostName,$NodeSecondHostName" >> //$NodeFirstIP/c/nodeMainConfigSQL.ps1


      The above script will create a PS1 file on node one.


      -------------------Command to execute the PS1 File--------------------------------------

      nexec -i $NodeFirstIP cmd /c "echo .|powershell C:\nodeMainConfigSQL.ps1"




      BPCLUS-3,Info,"Oct 8, 2013 6:09:24 PM",Test-Cluster : OpenService 'RemoteRegistry' failed.

      BPCLUS-3,Info,"Oct 8, 2013 6:09:24 PM",The handle is invalid



      Also have another query, is there a way to run powershell using local admin user.


      Please find the logs in the attachment.