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

Question
-
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.
Tuesday, August 25, 2015 4:55 AM
Answers
-
Have you tried PowerShell?
Import-Module OperationsManager New-SCOMManagementGroupConnection -ComputerName "MANAGEMENT SERVER NAME" Get-SCOMAgent | Select DisplayName, IPAddress, HealthState Version, InstallTime
http://blogs.technet.com/b/manageabilityguys/
- Proposed as answer by Xin GuoMicrosoft contingent staff Wednesday, September 9, 2015 6:56 AM
- Marked as answer by Xin GuoMicrosoft contingent staff Thursday, September 10, 2015 2:50 AM
Tuesday, August 25, 2015 6:30 AM -
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.BaseManagedEntityIdCheers,
Stefan
Blog: http://stefanroth.net If my post helped you, please take a moment to vote as helpful and\or mark as an answer
- Edited by Stefan RothMVP Thursday, September 3, 2015 6:16 AM
- Proposed as answer by Xin GuoMicrosoft contingent staff Wednesday, September 9, 2015 6:56 AM
- Marked as answer by Xin GuoMicrosoft contingent staff Thursday, September 10, 2015 2:50 AM
Thursday, September 3, 2015 5:53 AM
All replies
-
Have you tried PowerShell?
Import-Module OperationsManager New-SCOMManagementGroupConnection -ComputerName "MANAGEMENT SERVER NAME" Get-SCOMAgent | Select DisplayName, IPAddress, HealthState Version, InstallTime
http://blogs.technet.com/b/manageabilityguys/
- Proposed as answer by Xin GuoMicrosoft contingent staff Wednesday, September 9, 2015 6:56 AM
- Marked as answer by Xin GuoMicrosoft contingent staff Thursday, September 10, 2015 2:50 AM
Tuesday, August 25, 2015 6:30 AM -
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.BaseManagedEntityIdCheers,
Stefan
Blog: http://stefanroth.net If my post helped you, please take a moment to vote as helpful and\or mark as an answer
- Edited by Stefan RothMVP Thursday, September 3, 2015 6:16 AM
- Proposed as answer by Xin GuoMicrosoft contingent staff Wednesday, September 9, 2015 6:56 AM
- Marked as answer by Xin GuoMicrosoft contingent staff Thursday, September 10, 2015 2:50 AM
Thursday, September 3, 2015 5:53 AM