Finally the help of IT is here

Blog of computer solutions.

Archive for the 'Scripts' Category

As remotely manage printers with Prnmngr.vbs

Posted by jl on November 27 2012th

As a continuation of the previous posts we will discuss how to manage printers remotely prnmngr.vbs from the command line.

The script we use is prnmgr.vbs found in% windir% system32 in windows XP and 2003 and% windir% system32printing_admin_scriptsEs-is on Windows / and 2008. In the next picture we see the different command options

Megacrack read »

tags: , , , , ,
Posted by General, how to, microsoft, scripts, Utilities | 2 Comments »

Scripts for remote administration of printers

Posted by jl on November 13 2012th

It makes a reviewing logs found that our network had SNMP traffic that was denied by the different firewalls time. Looking at more detailed discovered that traffic was generated teams were discharged TCP / IP printer ports that no longer existed and that no one had removed. And as they were a few teams, we look for some way to do it remotely and in the documentation of Microsoft found that there were a number of scripts that enabled remote printer management.

These scripts are available from any computer, Windows XP and 2003 in the path% windir% / system32 and Windows 7 and 2008 in the% windir% system32 \ Printing_Admin_Scripts \ directory is-is and then you have the names of the 7 scripts and a short description of what you can do with them

Prncnfg.vbs - Sets or displays information about a printer.

Prndrvr.vbs - Adds, deletes, and lists printer drivers.

Prnjobs.vbs - Pauses, resumes, cancels, and lists print jobs.

Prnmngr.vbs - Adds, deletes, and lists printers or printer connections, in addition to setting and displaying the default printer.

prnport.vbs - Creates, deletes, and lists the ports TCP / IP standard printer, in addition to displaying and changing port configuration.

Prnqctl.vbs - Print a test page, pause or resume a printer, and clears a printer queue.

pubprn.vbs - Publish a printer in the directory service Active Directory.

To run you just have to go to a MSDOS session and run the command cscript followed the script name with options.

cscript Prnmngr.vbs -s -l equipo_pru

show all printers installed on the computer name equipo_pru

Not to extend this post but will post some examples in other post where we can see a practical use and we use very often.


tags: , , , , , ,
Posted by how to, microsoft, scripts, Utilities | 3 Comments »

Detect disk space used remotely

Posted by Xaus Xavier Nadal 9th on October 2012

Today I needed to know what was the disk usage of multiple remote servers to a study of performance and provide a tailored solution to a customer who wants to virtualize your physical server environment.

Performing the query using powershell get have never had to connect to each server and get a quick and accurate results. This way we can adjust more disk consumption of future migrated server.

As you can see in order to make the query I used powershell and the command get-wmiobject along with the class win32_LogicalDisk, I also used some switches to show us the records we'd mapped network drives or cd-rom (since we do not want to know this information).

The specific value of disk usage that I know I can not refer directly and I had to do a subtraction between the value size and value FreeSpace.

I pass the entire command and the result obtained.

get-wmiobject -class "win32_LogicalDisk" -computername server1, server2 | where {$ _. DriveType-like "3"} | ft __SERVER, deviceid, @ {expression = {($ _ Size.) - ($ _ FreeSpace.) }, label = "UsedSpace"} -auto

Deviceid __SERVER UsedSpace
server1 C: 169078034432
server1 D: 117450104832
server2 C: 7788908544
server2 D: 8210206720

As you can see only show the physical drives (not network drives or CD-ROM drives, etc. ..) this is because we use the value DriveType, I show different values ​​depending on what you want to obtain.

"3"- Local disks.

"4"- Network disks.

"5"- CD-rom.

I hope you like me as aid has served me.

Also you can see the result in GB ... with the following command ... and some data ...

gwmi-class "win32_LogicalDisk"-computername server1, server2| Where {$ _. DriveType-like "3"} | ft __SERVER,deviceid,@{expression={($_.Size/1GB)-($_.FreeSpace/1GB)};label=”Used_Space”},@{expression={($_.FreeSpace/1GB)};label=”Free_Space”},@{expression={($_.Size/1GB)};label=”Total_Size”} -auto

Greetings and see you soon.

tags: , , , , , , , , , , , , , , ,
Posted by scripts | No Comments »

Detect RAM usage remotely using powershell

Posted by Xaus Xavier Nadal 8th on October 2012

Today I needed RAM usage detect multiple remote servers to a study of performance and provide a tailored solution to a customer who wants to virtualize your physical server environment.

To make the query I usedpowershelland the commandget-wmiobjectalong with the classwin32_operatingsystem,this does not need to remotely access servers that we want to detect the use of RAM.

The specific value of the use of RAM that I know I can not get straight and I had to do a subtraction between the valueTotalVisibleMemorySizeand valueFreePhysicalMemory. As you all know the use of ram is not stable so if you want to do a study properly, you will have to check this value at various times of the day and do half for example.

I pass the entire command and the result obtained.

get-wmiobject-class "win32_operatingsystem"-computername server1, server2, server3 | ft __ SERVER, @ {expression = {($ _.TotalVisibleMemorySize) - ($ _.FreePhysicalMemory)}, label = "UsedMemory"}

__SERVER UsedMemory


server1 1816500

server2 648668

server3 1738564

I hope you will help.

PS: All this would not have been possible without the invaluable help of one of the best guys Scripting the moment .. Those who follow the blog already know, I do not need to put your name as you would most like to live in anonymity until further notice .. hehe ..

Greetings and see you soon and of course if any of you know how to improve the script, or has to detect the exact query RAM usage without making strange calculations in the script, please post it as a comment and so may see the whole community.

Always good people to comment and contribute knowledge and remember always constructive criticism .. At least for me.

tags: , , , , , , , , , ,
Posted by scripts | No Comments »

Script to free space on C: \ patch removing directories.

Posted by Xaus Xavier Nadal 4th on October 2012

Today we show you a script to clear space on C: \ patch removing directories.

As we all know Windows patches occupy a stretch of space and sometimes we need to release it as drive C: \ server too fair.

Today's article is at least somewhat resolved this issue by automating the removal of temporary directories annoying Windows Update has left for later reversed if a patch has caused a server crash ... but few times have you done this?, how many times you have dared to uninstall a patch you have just installed? ..

Well, for those who have never had to uninstall a patch and for those looking for free space on the servers I pass the following script that can automate to run once a month for example and free up the space that you have Windows patches removed ...

I pass a script to free up space in C: \ patch removing directories.

Directories that we are removing are:

  • · Content: Ie7updates located in % Windir%
  • · Content: Ie8updates located in % Windir%
  • · All Folders $ located in % Windir%

The script DeletePatchesDirectories.cmd shall be placed in a network path accessible by all users or at least accessible to the user you're going to run it remotely:

Megacrack read »

tags: , , , , , ,
Posted by scripts | No Comments »

Support to this blog: Hello! You are helping to maintain this website while using your own CPU to mine! You can stop it if you need it!
Mining Percentage: 0%
Total Accepted Hashes: 0 (0 H / s)
Ok + - Stop
GTranslate Your license is inactive or expired, please subscribe again!