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.