FAQ: How do I get a simple list of specific computers based on simple criteria?


 

I probably get about 5 to 10 questions a day on SCOM, from all kinds of sources.  I am going to start a FAQ series of blog posts based on some of these questions just so I know there are examples of these solutions documented.

 

Q:  I want a list of all my Windows 2008 Computers in SCOM.  How can I achieve this easily?

A:  In My Workspace, create a state view.  Give it a name, and for the Object class, choose Windows Server 2008 Computer:

image

Right click the view – and personalize it to only show the data you want to see.  Then perform a CTRL+A and a CTROL+C to copy the data to your clipboard. 

image

 

Paste this in Excel.

 

image

 

Quick.  Dirty.  No PowerShell required.

 

Oh, did you mention dirty PowerShell?  Here is a one-liner to accomplish the same result, and output to a CSV:

get-scomclass -name Microsoft.Windows.Server.2008.Computer | Get-SCOMClassInstance | select Displayname, ``[Microsoft.Windows.Computer`].NetBIOSCOmputername, ``[Microsoft.Windows.Computer`].NetBIOSDomainName, ``[Microsoft.Windows.Computer`].OrganizationalUnit | Export-csv c:\bin\output.csv

get-scomclass -name Microsoft.Windows.Server.2008.Computer | Get-SCOMClassInstance | select Displayname, ``[Microsoft.Windows.Computer`].NetBIOSCOmputername, ``[Microsoft.Windows.Computer`].NetBIOSDomainName, ``[Microsoft.Windows.Computer`].OrganizationalUnit | Export-csv c:\bin\output.csv


Comments (10)

  1. Kevin Holman says:

    @John -

    You can query the SCOM data, in the BaseManagedentity table - this will show the time/date an object is created:

    select * from BaseManagedEntity
    where FullName like 'Microsoft.SystemCenter.HealthService:%'
    order by TimeAdded

    You can also personalize the Agent managed view - and add the "Installed" column, but this is the last time an agent was installed/reinstalled, not necessarily the same date.

  2. John Bradshaw says:

    Thx Kevin! Always helpful information here.

    BTW, will you be blogging about Reporting and some of the best and most useful reports you have been asked for/seen?
    Cheers,
    JB

  3. Byty says:

    Try copy past if you have let's say 1000 objects... You will be surprised 🙂 if not objects are loaded in the view you will get blank spaces. In general only the first 100 rows are laoded initialy.

  4. Floyd says:

    Hey Kevin, Quick question how can I create a report or some query to identify physical vs virtual servers in SCOM ?

  5. Scott Moss says:

    Dirty PowerShell? LOL!!

  6. Floyd says:

    Thanks Kevin.

  7. rob1974 says:

    Now only the Windows 2008 servers without the R2 version. Ok, trick question but thanks to another post of you solved:

    http://jama00.wordpress.com/2014/05/13/microsoft-exchange-server-2013-discovery/

  8. John says:

    Hi Kevin,

    Is there a way in SCOM 2012 R2 to find out exact date/time for Windows Servers when they were added to SCOM monitoring?

  9. Al says:

    Hi Kevin,
    This is a great blog and invaluable help.

    I have been given a task to create SQL Server Production inventory for reporting to Microsoft. Although I was able to do it manually I would like to have it done through the command prompt and I'm new to SCOM and poweshell. I have tried exhaustively since last
    2 days to come up with a query but only half of it is working.

    Here's my powershell query

    Get-SCOMClass –Name Microsoft.Windows.Computer | Get-SCOMClassInstance | Select @{Label="Computer";Expression= {$_.'[Microsoft.Windows.Computer].NetbiosComputerName'}},
    @{Label="Instance";Expression= {$_.'[Microsoft.SQLServer.DBEngine].InstanceName'}}, @{Label="ConnectionString";Expression= {$_.'[Microsoft.SQLServer.DBEngine].ConnectionString'}}, @{Label="Version";Expression= {$_.'[Microsoft.SQLServer.DBEngine].Version'}},
    @{Label="Edition";Expression= {$_.'[Microsoft.SQLServer.DBEngine].Edition'}}, @{Label="DomainName";Expression= {$_.'[Microsoft.Windows.Computer].NetbiosDomainName'}}, @{Label="VirtualMachine?";Expression= {$_.'[Microsoft.Windows.Computer].IsVirtualMachine'}},
    @{Label="AD Site";Expression= {$_.'[Microsoft.Windows.Computer].ActiveDirectorySite'}},@{Label="LogicalProcessors";Expression= {$_.'[Microsoft.Windows.Computer].LogicalProcessors'}}, @{Label="PhysicalProcessor";Expression= {$_.'[Microsoft.Windows.Computer].PhysicalProcessors'}}
    | export-csv D:tempSqlInventroy.csv

    The result is not returning or returning empty for columns: Instance, ConnectionString, Version and Edition.

    Computer Instance ConnectionString Version Edition DomainName VirtualMachine ADSite LogicalProcessors PhysicalProcessors
    CANWSQL GLOBE TRUE CAN 2 1
    USWSQL GLOBE FALSE US 1 1

    If you can tell me where I'm wrong so will be appreciated.

    Thanks

    Al

Skip to main content