Hi All,
I want to retrieve "Install time" from SCom agent installation for that i am using following code.
AgentManagedComputerCriteria agentCriteria = new AgentManagedComputerCriteria( "LastModified >= '" + new DateTime(2015, 7, 25).ToString("G") + "'"); Console.WriteLine("before administration"+DateTime.Now); ManagementGroupAdministration administration = mgGroup.GetAdministration(); Console.WriteLine("after administration"+DateTime.Now); Console.WriteLine("Querying for data..."); //ReadOnlyCollection<AgentManagedComputer> agents = // administration.GetAgentManagedComputers(agentCriteria); ReadOnlyCollection<AgentManagedComputer> agents = administration.GetAllAgentManagedComputers(); Console.WriteLine("after getting managed agents "+DateTime.Now); // Display information about each agent. foreach (AgentManagedComputer agent in agents) { if (agent.InstallTime.Date > new DateTime(2015, 5, 25).Date) { Console.WriteLine("Agent name: " + agent.Name); Console.WriteLine("IPAddress: " + agent.IPAddress); Console.WriteLine("Health State: " + agent.HealthState); Console.WriteLine("Version: " + agent.Version + Environment.NewLine); Console.WriteLine("agent installed time" + agent.InstallTime); } }But it is taking taking nearly 10 min to fetch data from 4 window managed computers. Is there any other way to retrieve data fast.