Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Report computers that do not have installed CDROMDrive

$
0
0

Using powershell I am attempting to get a report based on a predefined list of computers that shows which do not have a CDROMDrive.

Here is a sample of how I was attempting to generate the report. The problem is that if a computer does not have a CDROMDrive there is not output.

$computers = Import-Csv c:\garb\9010-13.csv

$computers | foreach-object {
 Get-WmiObject -computername $_.computername win32_cdromdrive | Select-Object pscomputername, caption, drive}

My current code is working in that it's output shows the CDROMDrives available on each computer.

The code is not working in that it returns no information if a computer does not have any CDROMDrives available. I need the output to show computers that do not have CDROMDrives specifically.  



Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>