Beispiel #1
0
        public static ManagementAgent GetManagementAgent(Guid id)
        {
            MMSWebService ws   = new MMSWebService();
            XmlNode       node = ManagementAgent.GetMaData(ws, id);

            return(new ManagementAgent(node, id));
        }
Beispiel #2
0
 public static IEnumerable <ManagementAgent> GetManagementAgents()
 {
     foreach (KeyValuePair <Guid, string> k in GetManagementAgentNameAndIDPairs())
     {
         yield return(ManagementAgent.GetManagementAgent(k.Key));
     }
 }
Beispiel #3
0
        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);
        }
Beispiel #4
0
 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);
     }
 }
Beispiel #5
0
        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);
            }
        }
Beispiel #6
0
 public static ManagementAgent GetManagementAgent(string name)
 {
     return(ManagementAgent.GetManagementAgent(ManagementAgent.MANameToID(name)));
 }
Beispiel #7
0
 internal XmlNode GetMaData(Guid id)
 {
     return(ManagementAgent.GetMaData(this.WebService, id, MAData.MA_ALLBITS, MAPartitionData.BFPARTITION_ALL, MARunData.BFRUNDATA_ALLBITS));
 }
Beispiel #8
0
 internal XmlNode GetMaData(Guid id, MAData madata, MAPartitionData partitionData, MARunData rundata)
 {
     return(ManagementAgent.GetMaData(this.WebService, id, madata, partitionData, rundata));
 }
Beispiel #9
0
 internal static XmlNode GetMaData(MMSWebService ws, Guid id)
 {
     return(ManagementAgent.GetMaData(ws, id, MAData.MA_ALLBITS, MAPartitionData.BFPARTITION_ALL, MARunData.BFRUNDATA_ALLBITS));
 }