Finally the help of IT is here

Blog of computer solutions.

How to manage TCP / IP printer ports remotely

Posted by jl on November 16 2012th

Continuing the previous article on Scripts for remote administration of printers let's see how we can remotely manage TCP / IP printers through a simple script that we have available in our operating systems and certainly neither knew each.

The script we use here is prnport.vbs which as already mentioned is in the route % Windir% \ system32 operating systems Windows XP and Windows 2003 and in the following path % Windir% \ system32printing_admin_scripts \ is-is in Windows 7 and 2008 onwards Windows Server operating systems.

Among the different actions you can perform with this command, is to obtain information from the ports configured on a computer or add and delete server printer ports.

In the next picture we see the different command options Megacrack read »

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

Scripts for remote administration of printers

Posted by jl on November 13 2012th

Hace un tiempo revisando logs descubrimos que en nuestra red había trafico snmp que se estaba denegando por los diferentes firewalls. Mirando mas en detalle descubrimos que era tráfico que generaban equipos que tenían dados de alta puertos TCP/IP de impresoras que ya no existían y que nadie había eliminado. Y como eran unos cuantos equipos, buscamos alguna forma de hacerlo remotamente y en la documentación de Microsoft encontramos que existían una serie de scripts que permitían la gestión remota de impresoras.

Estos scripts se encuentran disponibles en cualquier equipo, en Windows XP y 2003 en la ruta %windir%/system32 y en Windows 7 y 2008 en el directorio %windir%system32\printing_admin_scripts\Es-es y a continuacion teneis los nombres de los 7 scripts y una breve descripcion de lo que se puede hacer con ellos

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.

Para ejecutarlos simplemente hay que ir a una sesión de MSDOS y ejecutar el comando cscript seguido del nombre del script con las opciones correspondientes.

cscript prnmngr.vbs -l -s 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.

Greetings.

tags: , , , , , ,
Posted by how to, microsoft, scripts, Utilities | 3 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 »

Event viewer detecting errors from Powershell

Posted by Xaus Xavier Nadal 13th on May 2012

Good.

Today we put some powershell.

This article explains how to remotely collect event viewer windows event of a team or group of computers from a Powershell command line and also in Onliner, hehe as I like ..

Remember Article https://www.megacrack.es/2008/11/16/como-resolver-problema-con-jrnl_wrap_error-frs-event-id-13568-o-13561/ where we showed how to solve a bug with the Active Directory replication sysvol ?, because this script we can remotely detect such errors without having to wait for a user to tell us your script does not work because not detected, or a domain policy is not being applied that does not exist in a site, etc ..

What we do with this script is to check the last 2 days of logs in the event viewer the "File Replication Service" as source "NtFrs" and type "Error" and we force we only show errors type "13568" and we only show the newest to adjust to the preferences error detecting active directory replication (you will be able to put whatever you want such as detect if Exchange databases have been turned off because of that the transaction log is filled) With the following values:

Type: Error

Event ID: 9518

Source: MSExchangeIS

But for now what we will find we are the problems with the FRS and we are looking for the following:

Type: Error

Event ID: 13568

Source: NtFrs

We will do this:

get-eventlog -newest 1 -despues de (get-date) .AddDays (-2) -computername <ComputerName> -Logname "File Replication Service" -Source "NtFrs" -entrytype "Error" | Where{. $ _ Eq EventId '13568'} | select machinename, source | ft -autosize

The result if sensing that there has been an error in the last 2 days in the File Replication Service section with NtFrs source, Error type and code 13568 event would be:

MachineName Source

---- -

MegaDC1 NtFrs

From there we can solve the problem because the following article for example: https://www.megacrack.es/2008/11/16/como-resolver-problema-con-jrnl_wrap_error-frs-event-id-13568-o-13561/

But if what you want is to detect this same on all domain controllers in the domain will have to change -computername <ComputerName> to:

-computername (get-qadcomputer -searchroot "<Domain> Domain Controllers" -dudip | Select-Object -ExpandProperty Yam)

Care that this last change will on all domain controllers you have, and take a lot, (You will have to have tools installed Quest Active Roles Management) Think that we do not use remotely and process strands (This will show you and other members of the blog which is more than I Powershell expert) to see if you dare .. Albert !!!!!, you want to read in MegaCracks ...

You can also run the command on each server daily and you send an email with the results to an e-mail or send it to a file that will be collected by an IIS and displayed in a web like a monitor centralized event it were, or what you offer your imagination ... the world of powershell is impressive, but it is when you unite with automation, displays, websites, etc ..

If you have any questions about this we will be happy to give you support from the comments of the bog.

Until next time.

tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Posted by Error, Exchange, PowerShell, powershell | 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!