Quantcast
Channel: Operations Manager - General forum
Viewing all articles
Browse latest Browse all 11941

Diagnosctic and Recovery Task Time Out

$
0
0

Hello,

I'am creating a recovery task witch wil do a shutdown of my envirement when the temperature in the datacenter is above 30 degrees Celcius. When I did a test a run found out that the timeout option in the Recovery task pane isn't working.

My settings are:

Timeout Setting in the Diagnostic and Recovery Properties

The VBS script is Run to start a Powershell Script:

Option Explicit 
Dim objShell
Set objShell = CreateObject("WScript.Shell") 
objShell.run "powershell -noexit -file D:\Scripts\testscript.ps1",4,true

The Powershell Script that is called by the VBS Script. This is not the powerdown Script but a Timeout Test Script

import-Module "d:\scripts\Functions\Currenttime.ps1"

$Logfile = "D:\Log\Timeouttest.ps1.$logfile.txt"

Start-Transcript -Path $Logfile > $null
Write-Host (CurrentTime)" - Start Logfile"
do {
    $Value++
	if ($Value -eq 1)
		{
			Write-Host (CurrentTime)" - Start Waiting"
		}
	else
		{
    		write-host (CurrentTime)" - Time out + 30 Seconde"
		}
    sleep 30 #1800
   }
while (
       $Value -ne 21
     )

Stop-Transcript > $null

The Function that is imported in the powershell Script.

Function CurrentTime
{
	(get-date).toString('yyyy.MM.dd hh.mm.ss')
}

When I generate the a alert and the Recovery task is started the scripts times out after 5 minuters. When I run the same scripts whitout System Center Operations Manager then everything works.

Hope someone can help me

GRz

Roelkn


Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.


Viewing all articles
Browse latest Browse all 11941

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>