public static ManagementAgent GetManagementAgent(Guid id) { MMSWebService ws = new MMSWebService(); XmlNode node = ManagementAgent.GetMaData(ws, id); return(new ManagementAgent(node, id)); }
public static IEnumerable <ManagementAgent> GetManagementAgents() { foreach (KeyValuePair <Guid, string> k in GetManagementAgentNameAndIDPairs()) { yield return(ManagementAgent.GetManagementAgent(k.Key)); } }
public static Guid MANameToID(string name) { Guid id = ManagementAgent.GetManagementAgentNameAndIDPairs().FirstOrDefault(t => string.Equals(t.Value, name, StringComparison.CurrentCultureIgnoreCase)).Key; if (id == Guid.Empty) { throw new InvalidOperationException($"Management agent {name} was not found"); } return(id); }
protected object InvokeWmi(string method, params object[] arguments) { try { using (ManagementObject wmiObject = ManagementAgent.GetManagementAgentWmiObject(this.ID)) { return(wmiObject.InvokeMethod(method, arguments)); } } catch (COMException ex) { throw new MiiserverException(SyncServer.TranslateCOMException(ex), ex); } }
public static void ExportMetaverseConfiguration(string path) { SyncServer.ValidateEmptyDirectory(path); string timestamp = DateTime.Now.ToMmsDateString(); string data = ws.ExportMetaverse(timestamp); string filename = Path.Combine(path, "MV.XML"); System.IO.File.WriteAllText(filename, data); foreach (ManagementAgent ma in ManagementAgent.GetManagementAgents()) { filename = Path.Combine(path, string.Format("MA-{0}.XML", ma.ID.ToMmsGuid())); ma.ExportManagementAgent(filename, false, timestamp); } }
public static ManagementAgent GetManagementAgent(string name) { return(ManagementAgent.GetManagementAgent(ManagementAgent.MANameToID(name))); }
internal XmlNode GetMaData(Guid id) { return(ManagementAgent.GetMaData(this.WebService, id, MAData.MA_ALLBITS, MAPartitionData.BFPARTITION_ALL, MARunData.BFRUNDATA_ALLBITS)); }
internal XmlNode GetMaData(Guid id, MAData madata, MAPartitionData partitionData, MARunData rundata) { return(ManagementAgent.GetMaData(this.WebService, id, madata, partitionData, rundata)); }
internal static XmlNode GetMaData(MMSWebService ws, Guid id) { return(ManagementAgent.GetMaData(ws, id, MAData.MA_ALLBITS, MAPartitionData.BFPARTITION_ALL, MARunData.BFRUNDATA_ALLBITS)); }