Kindly help me on this ASAP.

Answer Summary:
$comp = $env:computername $file = "c:\temp\test.txt" $printer= get-wmiobject win32_printer|format-list name|out-string $ip= get-wmiobject -query "Select IPAddress From Win32_NetworkAdapterConfiguration Where IPEnabled = True"| format-list IPaddress|out-string $wireless = NETSH WLAN SHOW INTERFACE $var=("Computer Name: $comp" + " Printers: $printer" + "IP: $ip" + "Wireless Info: $wireless") | out-file $file
Cancel
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Community Chosen Answer

2

Just curious....

How would a machine know it's location?

By WIFI signal info do you mean SSID?

I'm assuming since you are looking for wireless you want the wireless IP not the wired?

What format of script are you looking for?

 

This will get you started in Powershell.

$comp = $env:computername
$file = "c:\temp\test.txt"
$printer= get-wmiobject win32_printer|format-list name|out-string
$ip= get-wmiobject -query "Select IPAddress From Win32_NetworkAdapterConfiguration Where IPEnabled = True"| format-list IPaddress|out-string
$var=("Computer Name: $comp"  +
    "
    
Printers: $printer" + "IP: $ip") | out-file $file
 
NETSH WLAN SHOW INTERFACE should work for the SSID and signal strength, but since my laptop is at home I cannot test that. This would include this info (not tested).
 
$comp = $env:computername
$file = "c:\temp\test.txt"
$printer= get-wmiobject win32_printer|format-list name|out-string
$ip= get-wmiobject -query "Select IPAddress From Win32_NetworkAdapterConfiguration Where IPEnabled = True"| format-list IPaddress|out-string
$wireless = NETSH WLAN SHOW INTERFACE
$var=("Computer Name: $comp"  +
    "
    
Printers: $printer" + "IP: $ip" + "Wireless Info:
 
$wireless") | out-file $file
Answered 07/24/2012 by: dugullett
Red Belt

  • i wrote 2 VB scripts that will show installed printer and check system info
Please log in to comment

Answers

0


' Display error number and description if applicable
If Err Then ShowError

' Query installed printers' properties
Set colItems = objWMIService.ExecQuery("Select * from Win32_Printer",,48)

' Display error number and description if applicable
If Err Then ShowError

' Format output for display
For Each objItem in colItems
 strMsg = strMsg & vbCrLf _
        & "Printer Name :  " & objItem.Name & vbCrLf _
        & "Port Name    :  " & objItem.PortName & vbCrLf _
        & "Driver Name  :  " & objItem.DriverName & vbCrLf _
        & "Server Name  :  " & objItem.ServerName & vbCrLf _
        & "Share Name   :  " & objItem.ShareName & vbCrLf
Next

' Display the results
WScript.Echo strMsg

'Done
WScript.Quit(0)


Sub ShowError()
 strMsg = vbCrLf & "Error # " & Err.Number & vbCrLf & _
          Err.Description & vbCrLf & vbCrLf
 Syntax
End Sub


Sub Syntax()
 strMsg = strMsg & vbCrLf _
        & "ShowPRN.vbs,  Version 1.00" & vbCrLf _
        & "Display installed printers properties for " _
        & "any computer on the network" & vbCrLf & vbCrLf _
        & "Usage:  CSCRIPT  //NOLOGO  SHOWPRN.VBS  " _
        & "[ computer_name ]" & vbCrLf & vbCrLf _
        & "Where:  " & Chr(34) & "computer_name" & Chr(34) _
        & " is the optional name of a remote" & vbCrLf _
        & "        computer (default is local computer " _
        & "name)" & vbCrLf & vbCrLf _
        & "Written by Rob van der Woude" & vbCrLf _
        & "http://www.robvanderwoude.com" & vbCrLf & vbCrLf _
        & "Created with Microsoft's Scriptomatic tool" & vbCrLf _
        & "http://www.microsoft.com/technet/treeview/default.asp" _
        & "?url=/technet/scriptcenter/WMImatic.asp" & vbCrLf
 WScript.Echo strMsg
 WScript.Quit(1)
End Sub

Answered 07/24/2012 by: brighstarcuit
Seventh Degree Black Belt

  • This content is currently hidden from public view.
    Reason: Removed by user request
    For more information, visit our FAQ's.
Please log in to comment
0

@echo off

ver | find "2003" > nul
if %ERRORLEVEL% == 0 goto ver_2003

ver | find "XP" > nul
if %ERRORLEVEL% == 0 goto ver_xp

ver | find "2000" > nul
if %ERRORLEVEL% == 0 goto ver_2000

ver | find "NT" > nul
if %ERRORLEVEL% == 0 goto ver_nt

if not exist %SystemRoot%\system32\systeminfo.exe goto warnthenexit

systeminfo | find "OS Name" > %TEMP%\osname.txt
FOR /F "usebackq delims=: tokens=2" %%i IN (%TEMP%\osname.txt) DO set vers=%%i

echo %vers% | find "Windows 7" > nul
if %ERRORLEVEL% == 0 goto ver_7

echo %vers% | find "Windows Server 2008" > nul
if %ERRORLEVEL% == 0 goto ver_2008

echo %vers% | find "Windows Vista" > nul
if %ERRORLEVEL% == 0 goto ver_vista

goto warnthenexit

:ver_7
:Run Windows 7 specific commands here.
echo Windows 7
goto exit

:ver_2008
:Run Windows Server 2008 specific commands here.
echo Windows Server 2008
goto exit

:ver_vista
:Run Windows Vista specific commands here.
echo Windows Vista
goto exit

:ver_2003
:Run Windows Server 2003 specific commands here.
echo Windows Server 2003
goto exit

:ver_xp
:Run Windows XP specific commands here.
echo Windows XP
goto exit

:ver_2000
:Run Windows 2000 specific commands here.
echo Windows 2000
goto exit

:ver_nt
:Run Windows NT specific commands here.
echo Windows NT
goto exit

:warnthenexit
echo Machine undetermined.

:exit

Answered 07/24/2012 by: brighstarcuit
Seventh Degree Black Belt

  • This would just get the OS. That wasn't one he was looking for.
Please log in to comment
0

You will most likely need a 3rd party tool if you want any details about the wifi around a computer

Answered 07/24/2012 by: SMal.tmcc
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity
Admin Script Editor
Admin Script Editor is an integrated scripting environment available free here at ITNinja
Five Steps for Easier- and More Effective- IT Inventorying
Having an accurate inventory of all your IT assets is critical to ensuring that users are productive and that every dollar is well spent. This white paper outlines five steps that improve inventorying both hardware and software.

Share