Too much delay in taking Administration of SCOM? whether there is any other way to reduce delay?

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.

August 25th, 2015 12:57am

Have you tried PowerShell?

Import-Module OperationsManager

New-SCOMManagementGroupConnection -ComputerName "MANAGEMENT SERVER NAME"

Get-SCOMAgent | Select DisplayName, IPAddress, HealthState Version, InstallTime

Free Windows Admin Tool Kit Click here and download it now
August 25th, 2015 2:33am

Hi

Agree with Graham or use SQL on OpsMgrDB

select bme.DisplayName, InstallTime from MT_HealthService mths
INNER JOIN BaseManagedEntity bme on bme.BaseManagedEntityId = mths.BaseManagedEntityId

Cheers,

Stefan

September 3rd, 2015 1:56am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics