/// <summary> /// Report the failure of connecting to the target computer /// </summary> /// <param name="Type">What connection type failed?</param> public void ReportFailure(ManagementConnectionType Type) { switch (Type) { case ManagementConnectionType.CimRM: CimRM = ManagementConnectionProtocolState.Error; LastCimRM = DateTime.Now; break; case ManagementConnectionType.CimDCOM: CimDCOM = ManagementConnectionProtocolState.Error; LastCimDCOM = DateTime.Now; break; case ManagementConnectionType.Wmi: Wmi = ManagementConnectionProtocolState.Error; LastWmi = DateTime.Now; break; case ManagementConnectionType.PowerShellRemoting: PowerShellRemoting = ManagementConnectionProtocolState.Error; LastPowerShellRemoting = DateTime.Now; break; } }
/// <summary> /// Creates a new default connection object, containing only its computer's name and default results. /// </summary> /// <param name="ComputerName">The computer targeted. Will be forced to lowercase.</param> public ManagementConnection(string ComputerName) { this.ComputerName = ComputerName.ToLower(); if (Utility.Validation.IsLocalhost(ComputerName)) { CimRM = ManagementConnectionProtocolState.Disabled; } }