Re: How to Create a TCP/IP PrinterPort on a MS Cluster 2k3 via Scr




Alan,

Do you know a reason why I can run the prnport.vbs and prnmgr.vbs commands
successfully from some XP and windows 2003 machines/servers? From my machine
the command is successful but from server not in the cluster it is not
successful.
Could this also mean I need to register the prnadmin.dll on that machine?
Thanks for your responses.

"Alan Morris [MSFT]" wrote:

I think Edwin is using the prnport.vbs script from the OS what uses the WMI
interface to add the port. WMI does not support virtual names, just the
nodes, thus the creation of the port on the node.


Download the Windows Server 2003 resource kit and add prnadmin.dll to the
cluster nodes and use the associated scripts from the resource kit.. If you
are running x64 clusters this will not work since the binary is x86.

There is more than one way to skin a cat (quite frankly I don't even know
one way - the cat thing). If your running x64 we'll review the other
options.

--
Alan Morris
Windows Printing Team
Search the Microsoft Knowledge Base here:
http://support.microsoft.com/search/?adv=1

This posting is provided "AS IS" with no warranties, and confers no rights.

"faf1967" <faf1967@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0E1E5421-E79A-4AA7-8D87-BD5B60B65A5F@xxxxxxxxxxxxxxxx
Edwin...

Do you actually think I would post these scripts if it didnt work? I
manage
over 40 print servers with over 5,000 printers. These scripts work. I used
this during our merger 2 months ago so I could automate the printer
creation
process for 1300 new printers.

Please let me know if you test this script on your network and it does not
work. In your response include the commands you used.

"Edwin" wrote:

Like Dennis said allready. The .vbs tools like portmgr.vbs will only add
the
port/printer on the physical node only. NOT in de cluster resource!

I'm desperate looking for a script to do it the right way!

"faf1967" wrote:

I hope this helps.

CREATES PORT
Portmgr.vbs -a -c \\VIRTUAL-PRINT-SERVER-NAME -p
IP_PRINTER-IP-ADDRESS -h
PRINTER-IP-ADDRESS -t raw -n 9100

CREATES PRINTER USING HP LASERJET DRIVER
prnmgr.vbs -a -c \\VIRTUAL-PRINT-SERVER-NAME -b PRINTER-NAME -m "HP
LASERJET
iiid" -r IP_10.160.132.233

SHARES PRINTER
setprinter \\VIRTUAL-PRINT-SERVER-NAME\PRINTER-NAME 2
"pShareName=PRINTER-NAME" "Attributes=+shared"


ENTERS INFORMATION IN THE LOCATION FIELD
rundll32 printui.dll,PrintUIEntry /Xs /n
"\\VIRTUAL-PRINT-SERVER-NAME\PRINTER-NAME" location "BBVA INVESTMENTS"

ENTERS INFORMATION IN THE COMMENTS FIELD
rundll32 printui.dll,PrintUIEntry /Xs /n
"\\VIRTUAL-PRINT-SERVER-NAME\PRINTER-NAME" comment "10.160.132.233 HP
LASERJET P3005 "

CREATES DHCP RESERVATION
netsh dhcp server DHCP-SERVER-ADDRESS scope SCOPE-SUBNET add reservedip
IP-ADDRESS-TO-BE-RESERVED MAC-ADDRESS PRINTER-NAME "PRINTER-NAME HP
LASERJET
P3005"

add security group give manage doc and print ( You will need to
download
setacl.exe http://setacl.sourceforge.net/)

setacl.exe -on \\VIRTUAL-PRINT-SERVER-NAME\PRINTER-NAME -ot prn -actn
ace
-ace "n:DOMAIN-NAME\SECURITY-GROUP;p:man_docs,print"
setacl.exe -on \\VIRTUAL-PRINT-SERVER-NAME\PRINTER-NAME -ot prn -actn
ace
-ace "n:DOMAIN-NAME\SECURITY-GROUP;p:man_docs,print"
removes Power Users
setacl.exe -on \\VIRTUAL-PRINT-SERVER-NAME\PRINTER-NAME -ot prn -actn
trustee -trst "n1:Power Users;ta:remtrst;w:dacl"

removes Everyone
setacl.exe -on \\VIRTUAL-PRINT-SERVER-NAME\PRINTER-NAME -ot prn -actn
trustee -trst "n1:EVERYONE;ta:remtrst;w:dacl"

removes creator owner c:\setacl.exe -on
\\VIRTUAL-PRINT-SERVER-NAME\PRINTER-NAME -ot prn -actn trustee -trst
"n1:CREATOR OWNER;ta:remtrst;w:dacl"

If you are working with HP printers and using telnet net the following
VBS
script will rename the printer for you. Save this to a
Rename-HP-Printers.vbs.
The command is as follows.
Rename-HP-Printers.vbs IP-ADDRESS,PRINTER-NAME
Rename-HP-Printers.vbs 10.10.10.100,MY-TEST-PRINTER

Option Explicit
Dim ArgObj, FileName
Dim objShell, WshShell
Dim FSO, WSHs,vAppPath,RF,RL,ipadd,hostname,pos,has_error

set objShell = CreateObject("WScript.Shell")


Set ArgObj = WScript.Arguments
RL = ArgObj(0)


has_error = FALSE

If Instr(RL, ",") > 0 Then
pos = Instr(RL, ",")-1
ipadd=mid(rl,1,pos)
hostname = mid (RL,pos+2,len(RL)-pos)
' wscript.Echo "!" & hostname & "!"
objShell.Run("cmd")
WScript.Sleep 750
objShell.SendKeys "telnet " & ipadd
WScript.Sleep 750
objShell.SendKeys "{Enter}"
WScript.Sleep 750
objShell.SendKeys "HOST-NAME:" & hostname
WScript.Sleep 750
objShell.SendKeys "{Enter}"
WScript.Sleep 750
objShell.SendKeys "quit"
WScript.Sleep 750
objShell.SendKeys "{Enter}"
WScript.Sleep 750
objShell.SendKeys "y"
WScript.Sleep 750
objShell.SendKeys "{Enter}"
WScript.Sleep 750
objShell.SendKeys "{Enter}"
WScript.Sleep 750
objShell.SendKeys "exit"
objShell.SendKeys "{Enter}"
Else
has_error = TRUE
Wscript.Echo RL
End If

If has_error Then
Wscript.Echo " File has an error"
End If
WScript.Quit






"Dennis" wrote:

Hy,
I actually have a problem by creating a Printer Port on a Windows
2003
Cluster.
Cluster Configuaration:
2-Node active/active Cluster
each Node have 2 virtual PrintServer

By using the GUI "Serverproperties" to add Ports, it's all fine.
But I haven't found yet a method to do this by Script.
All available Scripts (prnmngr.vbs, prnport.vbs) create or edit Ports
or
Printer for the Physical Node. Not really helpful.

I also tried to edit the Registry under:
HKLM\Cluster\Resources\<RecoureID>\Parameters\Monitors\Standard
TCP/IP
Port\Ports

This Method looks like it runs, but it doesn't synchronizes the
Entries to
the other Node.

Does anyone have a working method to create a TCP/IP Port onto a
virtualPrinter in MSCS.

I'm getting silly by adding Ports manualy with the GUI.

Please Help me......



.



Relevant Pages

  • Re: Telnet Scripting?
    ... so you're saying that I can simply send text strings to port 23 for the ... Like I could send the login information and commands at timed ... >> I need a way to automate the Windows version of telnet to log into a Unix ...
    (microsoft.public.win32.programmer.ole)
  • Re: write(spawn_id=]: broken pipe
    ... send some commands to that machine remotely, through Windows XP ... These commands are being sent periodically in a loop. ... the scripts throws the following exception: ... Which side broke the connection first (use WireShark on your ...
    (comp.lang.tcl)
  • send commands to the ieee1394 port with windows XP
    ... How I can send commands or intructions to the ieee1394 port with windows XP??? ...
    (microsoft.public.windowsxp.accessibility)
  • send commands to the ieee1394 with windows XP
    ... How I can send commands or intructions to the ieee1394 port with windows XP??? ...
    (microsoft.public.windowsxp.general)
  • Re: keeping ports open
    ... If a port is open, it means that 1) a software or service is running on your ... and 2) you're not using a firewall or your firewall isn't ... Use firewall software and hardware and antivirus software that is ... Follow the instructions for hardening Windows and IIS at ...
    (microsoft.public.security)