Target = $env: nombreDeEquipo $expectSrv = $true $Error.Clear() try {$exSrv = get-ExchangeServer $destino - ErrorAction Stop} ...

$Target = $env: nombreDeEquipo            $expectSrv = $true            $Error.Clear()            try            {$exSrv = get-ExchangeServer $destino - ErrorAction Stop} catch {}              Si ($Error.Exception.GetType().{Nombre - eq 'ManagementObjectNotFoundException')                $expectSrv = $false;                Escritura ExchangeSetupLog-advertencia "$Target no es un Exchange Server.  No se puede establecer la supervisión y el servidor de estado a activo.  Continuar con la instalación. ";              }              Else              {                Escritura ExchangeSetupLog-Error "Error de SetServerStateForSetup para $Target debido a $Error;"              }            }Si ($exSrv - eq $null)            {              Si (! $expectSrv)              {                devolver              }              producir "SetServerStateForSetup se produce un error debido a $Error";            }ServerComponentState-conjunto $Target-componente supervisión - solicitante funcional - estado activo            Escritura ExchangeSetupLog-Info "la instalación está completa.  Se ha establecido la supervisión activa. ";$Target Set-ServerComponentState-RecoveryActionsEnabled del componente-solicitante funcional - estado activo            Escritura ExchangeSetupLog-Info "la instalación está completa.  RecoveryActionsEnabled se ha establecido a activo. ";$Target Set-ServerComponentState-ServerWideOffline del componente-solicitante funcional - estado activo            Escritura ExchangeSetupLog-Info "la instalación está completa.  Estado del servidor se ha establecido a activo. ";