Quantcast
Channel: Exchange Server 2013 - Outlook, OWA, POP, and IMAP Clients forum
Viewing all articles
Browse latest Browse all 10580

Load to variable Test-serviceHealth

$
0
0

Hi,

On our MS exchange 2010 infra we have this server having two roles ( CAS Role & Hub Transport Role). We develop a script that will be able to check the health of our exchange server, on my script I have this commandlet "Test-servicehealth | Format-list -Property requiredservicesrunning", which give us this two line output:

RequiredServicesRunning : True

RequiredServicesRunning : True

My question is, How am I going to place this output into variable in a per server role basis? of this format $varCAS=RequiredServicesRunning : True and for the other role $varHUB=RequiredServicesRunning : True. I tried this command "$VarTest=Test-ServiceHealth | Format-List -Property servicesnotrunning" then I issued this command "write-host "$varTest"" it give this output "Microsoft.Powershell.Commands.Internal.Format...." which is not what we wanted. Really need your help here. Thanks in advance. 


Viewing all articles
Browse latest Browse all 10580

Trending Articles



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