Printer Distribution: CLAS - Printer IP/Hostname Swap
Log In or Register to download the BES file, and more.

0 Votes

Description

This task will prompt for the following:

  • Current IP Address of printer mapped to target machines
  • Current Hostname of printer

Please refer to this spreadsheet for more information.

This task will then replace the printer port's direct IP Address mapping to its Hostname instead.


Property Details

ID1382
TitlePrinter Distribution: CLAS - Printer IP/Hostname Swap
DomainBESC
CategoryWindows Printers
SourceInternal
Source Release Date11/21/2012 12:00:00 AM
KeywordsHostname Printer Address printer Distribution
Is TaskTrue
Added by on 1/15/2013 12:15:27 PM
Last Modified by on 1/15/2013 12:15:27 PM
Counters 2102 Views / 9 Downloads
User Rating 1 star 2 star 3 star 4 star 5 star * Average over 0 ratings. ** Log In or Register to add your rating.

Relevance

Used in 81 fixlets and 86 analyses   * Results in a true/false
Show indented relevance
true

Actions

Action 1 (default)

Action Link Click here to deploy this action.
Script Type BigFix Action Script
action parameter query "PrinterIP" with description "Please enter the printer's IP address:" with default ""
action parameter query "PrinterHostName" with description "Please enter the printer's Host Name:" with default ""
createfile until end
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
    Set colPrinters = objWMIService.ExecQuery _
     ("Select * From Win32_Printer Where PortName like '%{parameter "PrinterIP" of action}%'")
    Set objNewPort = objWMIService.Get _
     ("Win32_TCPIPPrinterPort").SpawnInstance_
    objNewPort.Name = "{parameter "PrinterHostName" of action}"
    objNewPort.Protocol = 1
    objNewPort.HostAddress = "{parameter "PrinterHostName" of action}"
    objNewPort.Put_
    For Each objPrinter in colPrinters
     objPrinter.PortName = "{parameter "PrinterHostName" of action}"
     objPrinter.Put_
    Next
end
delete PrinterInfoSwap.vbs
copy __createfile PrinterInfoSwap.vbs
waithidden cmd.exe /C PrinterInfoSwap.vbs
Success Criteria

This action will be considered successful when the applicability relevance evaluates to false.


Sharing

Social Media:
Share this page on Yammer

Comments

Log In or Register to leave comments!