Running Powershell Scripts

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
StefanG
Posts: 6
Joined: Thu Jun 24, 2010 1:37 am

Running Powershell Scripts

Post by StefanG »

Hi together,

I've another problem now.

When I try to build an Powershell Script or try to use an existing script for KS-Soft I get the following error:

Code: Select all

[14:46:43] Agent: RMA01.domain.local is going to execute "PowerShell: Drive Free Space" script ...
[14:46:44] Script started, invalid result received:
----------
Die Datei "C:\Users\HOSTMO~1\AppData\Local\Temp\TMP-41~1.PS1" kann nicht gelade
n werden, da die Ausf�hrung von Skripts auf diesem System deaktiviert ist. Weit
ere Informationen erhalten Sie mit "get-help about_signing".
Bei Zeile:1 Zeichen:50
+ C:\Users\HOSTMO~1\AppData\Local\Temp\TMP-41~1.PS1 <<<<  localhost C
    + CategoryInfo          : NotSpecified: (:) [], PSSecurityException
    + FullyQualifiedErrorId : RuntimeException
----------

RMA is installed as service and runs with a service account with administrative rights.
System is Windows Server 2008 R2 Enterprise.
Execution Policy was tested with Restricted, RemoteSigned and Bypass without any changes.

When I run a script logged in with the service account I can run it with powershell.exe <scriptname> without any problem.

Regards,

Stefan
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Sorry, we do not speak German so we cannot find correct Microsoft manual that will explain this error.
We tried to translate it but it does not fit Microsoft error descriptions...

Do you have English Windows that will show the same error message in English?
If you don't, then you may check what this error means using google.de
(you speak German, right?)

Regards
Alex
StefanG
Posts: 6
Joined: Thu Jun 24, 2010 1:37 am

Post by StefanG »

Hi Alex,

sorry I did not change the Error message.
I runned it on an english system after I started to post here but forgot to replace it.

I'll add the english error message tomorrow when I'm back in the office.

I had already checked the error and got it fixed when I'm logged in with the account that runs hostmonitor, but hostmonitor gives this error even then, I'll come back tomorrow :)

Regards,

Stefan
StefanG
Posts: 6
Joined: Thu Jun 24, 2010 1:37 am

Post by StefanG »

Hi Alex,

as promissed the english error message.

Code: Select all

[08:57:41] Agent: SRV-KA-DC03.abtis.local is going to execute "PowerShell: Analyse Defrag" script ...
[08:57:43] Script started, invalid result received:
----------
File C:\Users\HOSTMO~1\AppData\Local\Temp\TMP-28~1.PS1 cannot be loaded because
 the execution of scripts is disabled on this system. Please see "get-help abou
t_signing" for more details.
At line:1 char:50
+ C:\Users\HOSTMO~1\AppData\Local\Temp\TMP-28~1.PS1 <<<< 
    + CategoryInfo          : NotSpecified: (:) [], PSSecurityException
    + FullyQualifiedErrorId : RuntimeException
----------
As written before I doublechecked the Execution Policy:

Code: Select all

Get-ExecutionPolicy -list

                   Scope                                             ExecutionPolicy
                   -----                                             ---------------
           MachinePolicy                                                   Undefined
              UserPolicy                                                   Undefined
                 Process                                                   Undefined
             CurrentUser                                                   Undefined
            LocalMachine                                                      Bypass
And now I've no idea why hostmonitor has problems to run the script.

Regards,

Stefan
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

I think you should check Execution Policy for 32bit version of PowerShell (HostMonitor is 32bit application).

Code: Select all

%SystemRoot%\syswow64\WindowsPowerShell\v1.0\powershell.exe
Get-ExecutionPolicy -list
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope LocalMachine
As I know policy setting for CurrentUser are synchronized between 32bit and 64bit version of powershell.
While LocalMachine policy settings are different for each version of PowerShell.

Regards
Alex
StefanG
Posts: 6
Joined: Thu Jun 24, 2010 1:37 am

Post by StefanG »

Hi Alex,

thanks for you reply, this did the job.

Did not thought for the 32bit problem.

Thank you!
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

You are welcome :)

Regards
Alex
Post Reply