Skip to main content

Posts

Showing posts from November, 2015

PowerShell list printers of remote computers

How to print installed printers on remote computers? With and PowerShell WMIC it can be don easily. PowerShell command to list installed printers of a remote PC. Invoke-command -ComputerName PC0100 -ScriptBlock { wmic printer get name} Command above needs appropriate privileges to execute successfully and remote computers should be configured to accept remote WMI   commands. Sample output:                     Send To OneNote 2010                     Microsoft XPS Document Writer            Microsoft Office Document Image Writer       To list the printers via command line:  http://quickbytesstuff.blogspot.sg/2014/11/wmic-list-printers.html  Cheers..hope it helps.. ================== Free Android Apps: Click on links below to find out more: https://play.google.com/store/apps/details?id=soulrefresh.beautiful.prayer Catholic Rosary Guide  for Android: Pray the Rosary every day, countless blessings will be showered upon

Set IP Address using Netsh and PowerShell

How to set IP Address of the remote computer using PowerShell? How to set DNS IP Address of the remote computer using PowerShell? How to set static IP and DNS address in local or remote computer via PowerShell? Script below will set local IP or set remote IP Address using PowerShell with the help of Netsh command. For the script to work Winrm or Windows Remote Management must be enabled either on the local PC or remote computer or server. The script of course needs to run at an elevated mode with the proper rights or privileges or in simple words the script will work only if you have the administrator rights. Here’s the script: #=============================== $set_IP = { netsh interface ip set address "Wi-Fi" static 192.168.1.107 255.255.255.0 192.168.1.254 } $set_DNS1 = { netsh interface ip add dns "Wi-Fi" 8.8.8.8 } $SET_DNS2 = { netsh interface ip add dns "Wi-Fi" 4.2.2.2 index

Sign out or set Windows 10 to sleep mode

How to sign out from Windows 10? How to set Windows 10 to sleep mode? Just right click on Windows 10 logo, select shutdown or sign out. Then click in sign out or sleep or select other options provided. To do it via command line check out this link: http://quickbytesstuff.blogspot.sg/2014/12/shutdown-network-computer-using-command.html See screen shot below:

PowerShell get network adapter Speed

How to check network adapter speed installed on a computer using PowerShell? Code snippet below will get the name of all the network adapter installed on a computer and also the speed. To use the script on a remote computer supply the computer name and run the script with appropriate privileges to get the data on the remote computer. #=========================== $computer_name = "." $Net_adapter = gwmi   -class Win32_NetworkAdapter -namespace "root\CIMV2" ` -computername $computer_name foreach ( $objItem in $Net_adapter ) { "Adapter is: " + $objItem . name + " -- " + "Adapter Speed is: " + [ math ]:: truncate( $objItem . speed / 1MB ) + " MB" } #=========================== Change the 1MB to 1GB if you need the output in GB. Sample Output: Adapter is: Teredo Tunneling Pseudo-Interface -- Adapter Speed is: 0 MB Adapter is: Microsoft ISATAP Adapter #3 -- Adap

Ping whole subnet via command line

How to ping the whole subnet using a batch file? script Or command line? If you just inherited a network or just embark on a new job and no proper documentation is on the table, then pinging the whole subnet is a good start to know the network. How to shut down the PC if it responds to ping request? Batch file script below pings the whole subnet and logs the status whether the IP Address is online or offline. This can be set on the task scheduler and run at interval hours if needed. #===================================== FOR /L %I IN (1,0,254) DO   ping 192.168.1.%I -n 2 | for /f "delims=" %a in ('find /C "TTL"') do @set foobar=%a |  IF %a==2 ( echo "192.168.1.%I is online" >>d:\pingx.txt) else ( echo "192.168.1.%I is offine" >>d:\pingx.txt) #===================================== Sample output:                                                   "192.168.1.1 is offine"   "192

Ping range of IP Address via command line

How to ping range of IP Address via command line? Ping a range of IP Address via command line, quite useful in a server core environment or set to task scheduler and run at specific time and day. Batch files still does it wonder. Below is a command line that can be save as a batch file and set via task scheduler to automatically run at a specified time or day. Batch file script to ping a range of IP and save to notepad the result. ====================================== FOR /L %I IN (100,1,220) DO   echo %date%   %time% 2 >> d:\pingx.txt   & ping 192.168.1.%I -n 2 >> d:\pingx.txt ====================================== The command will ping   iP range 192.168.1.100 to 192.168.1.220 and send 2 echo request. Results of the ping is save on drive d at a file named pingx.txt. Copy the command to notepad and save it as a batch file with extension of “.bat” or “.cmd”. Sample output: Wed 11/11/2015   17:31:15.05 2    Pinging 192.1

PowerShell check video driver

Get the details of the video card such as driver, version and the video card name. A simple script to get the details of the video card, script will get the driver and version to check whether a new driver needs to be installed or updated. To check remote computers, replace the dot with the name of the remote computer to be checked. Here’s the script: #============================== $computer_name = "." $video_details = gwmi   -class Win32_VideoController   -computername $computer_name "Video Name : " + $video_details . Name "Video Description : " + $video_details . Description "Video Driver Date : " + $video_details . DriverDate "Video Version : " + $video_details . DriverVersion "Video Processor :" + $video_details . VideoProcessor "Video Drivers : " + $video_details . InstalledDisplayDrivers #============================== Sample output: Vid

PowerShell get installed software on remote computers

How to get or list installed softwares on remote computers? Check installed programs or softwares on remote computers using PowerShell. PowerShell can do the task easily to get software installed on remote computer provided the script is run with proper privileges Here’s the script below on how to list of installed software on remote PCs. #===================================================== $computer_name = "." $get_progs = gwmi   -class Win32_product   -computername $computer_name | where-object { $_ . name -match "^Roxio" } #$$get_progs=gwmi  -class Win32_product | where-object {$_.vendor -match "^Roxio" } $get_progs #===================================================== Sample output:                                                               IdentifyingNumber : {1F54DAFA-9261-4A62-B59D-6C9F26B48FE4} Name              : Roxio Creator Tools Vendor            : Roxio Version           : 3.8.