[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Find all computers in the network where sound is not enabled and installed

Posted on 2007-07-21
19
Medium Priority
?
352 Views
Last Modified: 2010-03-05
Hi,

I need to Find all computers in the network where sound is not enabled and not installed.

Regards
Sharath
0
Comment
Question by:bsharath
19 Comments
 
LVL 43

Expert Comment

by:Rob
ID: 19542366
I haven't done this per se but have a look at the windows scripting object model: http://msdn2.microsoft.com/En-US/library/a74hyyw0.aspx

You should be able to use this to find devices that are not installed.
0
 
LVL 11

Author Comment

by:bsharath
ID: 19554856
Any help with a script...
0
 
LVL 14

Expert Comment

by:canali
ID: 19556393
@echo off
:: Get sound info on "switched on" computers found in the list c:\computers.txt
::
::
setlocal ENABLEDELAYEDEXPANSION
for /f %%c in ('type computers.txt') do (
  set t=
  (ping -n 1 -w 999 %%c|find /i "TTL" >nul)&&  call:_GETsound %%c
  (ping -n 1 -w 999 %%c|find /i "TTL" >nul) ||echo %%c:  switched off
)
goto :_END
:_GETsound
for /f "skip=1 delims=/" %%a in ('WMIC.EXE /Node:%1  Path Win32_SoundDevice   get Description^,Status') do  echo %1: %%a
goto :_EOF
:_END
:_EOF

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 11

Author Comment

by:bsharath
ID: 19556755
Still the same message.
0
 
LVL 11

Author Comment

by:bsharath
ID: 19556757
Sorry wrong message
0
 
LVL 11

Author Comment

by:bsharath
ID: 19556784
I get this.

C:\>findsound.bat
No Instance(s) Available.
indiasophos:
Invalid Global Switch.
Invalid Global Switch.
0
 
LVL 14

Expert Comment

by:canali
ID: 19557731
try it on a xp computer
0
 
LVL 11

Author Comment

by:bsharath
ID: 19557782
I checked with an Xp machine and ran from a xp machine too.
0
 
LVL 11

Author Comment

by:bsharath
ID: 19557792
Same error. An even get as switched off even though the machines are pinging...
0
 
LVL 14

Expert Comment

by:canali
ID: 19559913
You can give me the output of this command
WMIC.EXE /?|find /i "sound"
0
 
LVL 11

Author Comment

by:bsharath
ID: 19562255
I get this.

C:\>WMIC.EXE /?|find /i "sound"
SOUNDDEV                 - Sound Device management.
0
 
LVL 26

Expert Comment

by:Farhan Kazi
ID: 19562937
Add double quotes with machine name.
Like:
WMIC.EXE /Node:"%1" Path Win32_SoundDevice get Description^,Status

@echo off
:: Get sound info on "switched on" computers found in the list c:\computers.txt
::
::
setlocal ENABLEDELAYEDEXPANSION
for /f %%c in ('type computers.txt') do (
  set t=
  (ping -n 1 -w 999 %%c|find /i "TTL" >nul)&&  call:_GETsound %%c
  (ping -n 1 -w 999 %%c|find /i "TTL" >nul) ||echo %%c:  switched off
)
goto :_END
:_GETsound
for /f "skip=1 delims=/" %%a in ('WMIC.EXE /Node:"%1" Path Win32_SoundDevice get Description^,Status') do  echo %1: %%a
goto :_EOF
:_END
:_EOF
0
 
LVL 11

Author Comment

by:bsharath
ID: 19562963
I get this.


C:\>Findsound.bat
dev-chen-mrd100: Microsoft UAA Function Driver for High Definition Audio - Adi 1
986  OK
dev-chen-mrd100:
dev-chen-pc1014: SoundMAX Integrated Digital Audio  OK
dev-chen-pc1014:
No Instance(s) Available.
dev-chen-srv401:
C:\>
0
 
LVL 14

Expert Comment

by:canali
ID: 19563502
@echo off
:: GetSound.cmd
:: Get sound info on "switched on" computers found in the list c:\computers.txt
:: just a little be better
::
setlocal
for /f %%c in ('type c:\computers.txt') do (
  ((ping -n 1 -w 500 %%c|find /i "TTL" >nul)&&  call:_GETsound %%c 2>nul) ||echo %%c:  switched off)
goto :_END
:_GETsound
for /f "skip=1 delims=/" %%a in ('WMIC.EXE /Node:"%1" Path Win32_SoundDevice get Description^,Status ') do echo %1: %%a
goto :_EOF
:_END
:_EOF

0
 
LVL 11

Author Comment

by:bsharath
ID: 19563530
Canali.

I think now its working fine.


C:\>Findsound.bat
dev-chen-pc1000: Realtek AC'97 Audio  OK
dev-chen-pc1000:
dev-chen-mrd100: Microsoft UAA Function Driver for High Definition Audio - Adi 1
986  OK
dev-chen-mrd100:
dev-chen-nas01:
dev-chen-pc5000: SoundMAX Integrated Digital Audio  OK
dev-chen-pc5000:
dev-chen-pc5001: SoundMAX Integrated Digital HD Audio  OK
dev-chen-pc5001:
C:\>
Why is the name being repeated.?
0
 
LVL 14

Expert Comment

by:canali
ID: 19563756
something wrong in computers.txt?
give me some line of it
0
 
LVL 11

Author Comment

by:bsharath
ID: 19563868
i have

dev-chen-mrd100
dev-chen-pc1000
dev-chen-nas01
dev-chen-pc5000
dev-chen-pc5001
in the text file
0
 
LVL 11

Author Comment

by:bsharath
ID: 19587783
ANY HELP...
0
 
LVL 14

Accepted Solution

by:
canali earned 2000 total points
ID: 19589355
'
' get-sound-all-PCs.vbs
' read the computer computers list from the file c:\computers.txt
' for get output on file run:
' cscript //nologo get-sound-all-PCs.vbs >result.txt
'
'
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\Computers.txt", ForReading)
do while not objFile.AtEndOfStream
    PC = objFile.ReadLine
    Getsound (PC)
loop
objFile.Close
sub Getsound(strComputer)
  soundinfo="SoundCard not found"
  On Error Resume Next
  Set objWMIService = GetObject( "winmgmts://" & strComputer & "/root/CIMV2" )
  Set colInstances = objWMIService.ExecQuery( "SELECT Description,status FROM Win32_SoundDevice", "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly )
  If Err.Number = 0 then
    For Each objInstance In colInstances
          soundinfo=objInstance.Description &" " & objInstance.Status
    Next
  else
    soundinfo="Error computer not found"
    err.clear
  end if
  WScript.echo strComputer & space(20-len(strComputer)) &": " & soundinfo
end sub
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you upgrade from Windows 8 to 8.1 or to Windows 10 or if you are like me you are on the Insider Program you may find yourself with many 450MB recovery partitions.  With a traditional disk that may not be a problem but with relatively smaller SS…
Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question