cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
dteague
Engaged Sweeper III
I'm looking for a simple script to just display what computers have multiple monitors attached to it. Does someone have a simple script that will do this for me?

Thanks!
9 REPLIES 9
mfugaro
Engaged Sweeper
Fantastic. Thanks to all for the help
taeratrin
Champion Sweeper
Did the results include computers with more than two monitors listed? This is the only case I can think of that it would still pass the 'Not Found' results. Anyways, glad it worked for you. It was a bit tricky to figure out.
taeratrin
Champion Sweeper
SELECT computers.[Computer],computers.Username ,monitors.[MonitorModel]
FROM [lansweeperdb].[dbo].[tblMonitor] as monitors Inner Join
[lansweeperdb] .[dbo] .[tblComputers] as computers on monitors .Computername = Computers .Computername where
(select COUNT(*) from (SELECT * FROM [lansweeperdb].[dbo].[tblMonitor] WHERE tblMonitor .MonitorModel <> 'Not Found') as m2 where m2.Computername =monitors .Computername)>1
76012
Engaged Sweeper II
taeratrin wrote:
SELECT computers.[Computer],computers.Username ,monitors.[MonitorModel]
FROM [lansweeperdb].[dbo].[tblMonitor] as monitors Inner Join
[lansweeperdb] .[dbo] .[tblComputers] as computers on monitors .Computername = Computers .Computername where
(select COUNT(*) from (SELECT * FROM [lansweeperdb].[dbo].[tblMonitor] WHERE tblMonitor .MonitorModel <> 'Not Found') as m2 where m2.Computername =monitors .Computername)>1



Nice! Your query ignores the Not Found when counting, but I had to add this to the end of your query to hide the Not Found monitors from the final result:

and monitors.[MonitorModel] <> 'Not Found'

Very helpful script!
mfugaro
Engaged Sweeper
Thanks. That is great. It almost gives me what I need. Just one problem though. It seems to be returning results for some computers/users where the second monitor Model shows as "Not Found"
I think these are computers that are actually laptops with a docking station and an external monitor, and therefore it picks up the external monitor connected to the docking station, but also picks up the actual laptop screen as a second monitor but it doesn't know what the model of it is.
Is there a way we can edit this query to exclude from the results any monitors that have a model of "Not Found"?

Thanks
taeratrin
Champion Sweeper
Try the following :
SELECT computers.[Computer],computers.Username ,monitors.[MonitorModel]
FROM [lansweeperdb].[dbo].[tblMonitor] as monitors Inner Join
[lansweeperdb] .[dbo] .[tblComputers] as computers on monitors .Computername = Computers .Computername where
(select COUNT(*) from lansweeperdb .dbo.tblMonitor as m2 where m2.Computername =monitors .Computername )>1
mfugaro
Engaged Sweeper
I can see the info about the monitors in this table but I need some help writing the query on how to get a list of computer names (user names would be even more helpful) which have more than one monitor and what the monitor model is. Can someone help with this
Hemoco
Lansweeper Alumni
Beta 4 has this information in table tblmonitors.
mfugaro
Engaged Sweeper
I also would like this information. Has anyone found this yet?