Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
Highlighted
eomolina Absent Member.
Absent Member.
2199 views

Install Printers as Bundles

Howdy! I have a situation. I have to install multiple TCPIP printers (not on a print server, just networked printers) in multiple locations using ZW. I know that 11.2 can do this using a Printer Policy, but we are running ZW 11.1a which does not (as far as I understand). We plan to upgrade to the latest version by the end of the year with a new box. For now, I'm OK creating a Bundle to install the printer on Windows 7 64-bit PCs. I have manage to do the install, but I can't see to set the printer as default or set the permissions. This is what I have done.... questions later. 😉


Create Bundle "Install Printer Test" and on the INSTALL Tab:
1) "Install MSI - subinacl" - Installs the subinacl.msi package (as default) in C:\Program Files (x86)\Windows Resource Kits\Tools

NOTE: The "SubInACL" is a free Microsoft command-line tool that enables administrators to obtain security information about files, registry keys, and services, and transfer this information from user to user, from local or global group to group, and from domain to domain. More info at Batch files - Manage permissions with SUBINACL


2) "Create/Delete Directory - MIS\Drivers" - Creates the "C:\MIS\Drivers"

3) "Copy Directory - Drivers to Local PC" - Copies the driver's directory on a server locally to "C:\MIS\Drivers"

4) "Run Script - Create Port" - It runs a DEFINED SCRIPT to create a Port on local PC for IP_10.5.6.17 as a DYNAMIC ADMINISTRATOR, that waits WHEN ACTION IS COMPLETED before next action.
cscript %WINDIR%\System32\Printing_Admin_Scripts\en-US\prnport.vbs -a -r IP_10.5.6.17 -h 10.5.6.17 -o raw

5) "Run Script - Install Driver" - It runs a DEFINED SCRIPT to install the driver on local PC as a DYNAMIC ADMINISTRATOR, that waits WHEN ACTION IS COMPLETED before next action.
cscript %WINDIR%\System32\Printing_Admin_Scripts\en-US\Prndrvr.vbs -a -m "HP Universal Printing PCL 5" -h "C:\MIS\Drivers\Printers\HP_Universal_Print_Driver_64bit" -i "C:\MIS\Drivers\Printers\HP_Universal_Print_Driver_64bit\hpcu130t.inf"

6) "Run Script - Install Printer" - It runs a DEFINED SCRIPT to install the printer on local PC (name "TEST PRINTER") as a DYNAMIC ADMINISTRATOR, that waits WHEN ACTION IS COMPLETED before next action.
cscript %WINDIR%\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs -a -p "TEST PRINTER" -r IP_10.5.6.17 -m "HP Universal Printing PCL 5"

7) "Run Script - Printer Permissions to Full Control" - It runs a DEFINED SCRIPT to set TEST PRINTER permissions to all Domain Users to Full Controll (using SubInACL) as a DYNAMIC ADMINISTRATOR, that waits WHEN ACTION IS COMPLETED before next action.
start C:\"Program Files (x86)"\"Windows Resource Kits"\Tools\SUBINACL.exe /verbose=1 /printer "TEST PRINTER" /grant="ALBEMARLE\Domain Users"=F

😎 "Run Script - Set as Default Printer" - It runs a DEFINED SCRIPT to set TEST PRINTER as Default Printer as a DYNAMIC ADMINISTRATOR, that waits WHEN ACTION IS COMPLETED before next action.
PRINTUI.EXE /y /q /n "TEST PRINTER"


Now for the comments and questions.
1) If I create a batch file with line 4 to 8, everything works (if the SubInACL was installed.)
2) Items #2 through #6 work fine. I can print test pages, and through Windows set as default. I can't change settings (see below).
3) Item #7 does not run. I need this because the printer installs but has no Owner, thus Users can't set any particular settings... critical when printing into copiers.
4) Item #8 does not run. I need this to setup classrooms, which have only one printer. It would be nice if I could force this printer to be default to any User that logs into the PC.
5) Notice that #7 and #8 are EXE (instead of vbs scripts), so I'm assuming I made a mistake in coding.
6) I know my code is ugly... can I combine #4, 5 and 6 into one RUN SCRIPT?

I'm still learning much about ZENworks... please be gentle and assume I know NOTHING. Clear instructions would help. Thanks for all your help!
Labels (2)
0 Likes
3 Replies
Micro Focus Expert
Micro Focus Expert

Re: Install Printers as Bundles

#7 - Your quotes are messed up
start "C:\Program Files (x86)\Windows Resource Kits\Tools\SUBINACL.exe"
/verbose=1 /printer "TEST PRINTER" /grant="ALBEMARLE\Domain Users"=F

Still not sure if your syntax is fully correct.

#8 - No, you must set it for each user. You can perhaps set a
"rundll32.exe printui" command to run on user logon for each PC to make
sure it is set for each user. (Also can't use "DynAdmin". Use logged on
user.)

You could combine the 4-5-6, but it would require understanding each
individual script better, so just as ez to keep separate which also
makes tweaking less complex.


On 6/13/2013 11:06 AM, eomolina wrote:
>
> Howdy! I have a situation. I have to install multiple TCPIP printers
> (not on a print server, just networked printers) in multiple locations
> using ZW. I know that 11.2 can do this using a Printer Policy, but we
> are running ZW 11.1a which does not (as far as I understand). We plan to
> upgrade to the latest version by the end of the year with a new box. For
> now, I'm OK creating a Bundle to install the printer on Windows 7 64-bit
> PCs. I have manage to do the install, but I can't see to set the printer
> as default or set the permissions. This is what I have done....
> questions later. 😉
>
>
> Create Bundle "Install Printer Test" and on the INSTALL Tab:
> 1) "Install MSI - subinacl" - Installs the subinacl.msi package (as
> default) in C:\Program Files (x86)\Windows Resource Kits\Tools
>
>> *NOTE*: The "SubInACL" is a free Microsoft command-line tool that
>> enables administrators to obtain security information about files,
>> registry keys, and services, and transfer this information from user to
>> user, from local or global group to group, and from domain to domain.
>> More info at 'Batch files - Manage permissions with SUBINACL'
>> (http://www.robvanderwoude.com/subinacl.php)

>
> 2) "Create/Delete Directory - MIS\Drivers" - Creates the
> "C:\MIS\Drivers"
>
> 3) "Copy Directory - Drivers to Local PC" - Copies the driver's
> directory on a server locally to "C:\MIS\Drivers"
>
> 4) "Run Script - Create Port" - It runs a DEFINED SCRIPT to create a
> Port on local PC for IP_10.5.6.17 as a DYNAMIC ADMINISTRATOR, that waits
> WHEN ACTION IS COMPLETED before next action.
>
> Code:
> --------------------
> cscript %WINDIR%\System32\Printing_Admin_Scripts\en-US\prnport.vbs -a -r IP_10.5.6.17 -h 10.5.6.17 -o raw
> --------------------
>
> 5) "Run Script - Install Driver" - It runs a DEFINED SCRIPT to install
> the driver on local PC as a DYNAMIC ADMINISTRATOR, that waits WHEN
> ACTION IS COMPLETED before next action.
>
> Code:
> --------------------
> cscript %WINDIR%\System32\Printing_Admin_Scripts\en-US\Prndrvr.vbs -a -m "HP Universal Printing PCL 5" -h "C:\MIS\Drivers\Printers\HP_Universal_Print_Driver_64bit" -i "C:\MIS\Drivers\Printers\HP_Universal_Print_Driver_64bit\hpcu130t.inf"
> --------------------
>
> 6) "Run Script - Install Printer" - It runs a DEFINED SCRIPT to install
> the printer on local PC (name "TEST PRINTER") as a DYNAMIC
> ADMINISTRATOR, that waits WHEN ACTION IS COMPLETED before next action.
>
> Code:
> --------------------
> cscript %WINDIR%\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs -a -p "TEST PRINTER" -r IP_10.5.6.17 -m "HP Universal Printing PCL 5"
> --------------------
>
> 7) "Run Script - Printer Permissions to Full Control" - It runs a
> DEFINED SCRIPT to set TEST PRINTER permissions to all Domain Users to
> Full Controll (using SubInACL) as a DYNAMIC ADMINISTRATOR, that waits
> WHEN ACTION IS COMPLETED before next action.
>
> Code:
> --------------------
> start C:\"Program Files (x86)"\"Windows Resource Kits"\Tools\SUBINACL.exe /verbose=1 /printer "TEST PRINTER" /grant="ALBEMARLE\Domain Users"=F
> --------------------
>
> 😎 "Run Script - Set as Default Printer" - It runs a DEFINED SCRIPT to
> set TEST PRINTER as Default Printer as a DYNAMIC ADMINISTRATOR, that
> waits WHEN ACTION IS COMPLETED before next action.
>
> Code:
> --------------------
> PRINTUI.EXE /y /q /n "TEST PRINTER"
> --------------------
>
>
> Now for the comments and questions.
> 1) If I create a batch file with line 4 to 8, everything works (if the
> SubInACL was installed.)
> 2) Items #2 through #6 work fine. I can print test pages, and through
> Windows set as default. I can't change settings (see below).
> 3) Item #7 does not run. I need this because the printer installs but
> has no Owner, thus Users can't set any particular settings... critical
> when printing into copiers.
> 4) Item #8 does not run. I need this to setup classrooms, which have
> only one printer. It would be nice if I could force this printer to be
> default to any User that logs into the PC.
> 5) Notice that #7 and #8 are EXE (instead of vbs scripts), so I'm
> assuming I made a mistake in coding.
> 6) I know my code is ugly... can I combine #4, 5 and 6 into one RUN
> SCRIPT?
>
> I'm still learning much about ZENworks... please be gentle and assume I
> know NOTHING. Clear instructions would help. Thanks for all your help!
>
>



--
Craig Wilson - MCNE, MCSE, CCNA
Novell Knowledge Partner

Novell does not officially monitor these forums.

Suggestions/Opinions/Statements made by me are solely my own.
These thoughts may not be shared by either Novell or any rational human.
--
Please give a hearty thumbs up to any post you find helpful!
To find articles by Craig Wilson simply follow the link: Craig Wilson's Tips!
0 Likes
sgardiner Absent Member.
Absent Member.

Re: Install Printers as Bundles

We have used this script since ZFD4 days

REM Create Port
regedit /s "c:\printers\c280\w2k.reg"
REM Stop Restart Print Spooler Service to add printer
NET STOP "Print Spooler"
NET START "Print Spooler"
REM Create Printer
rundll32 printui.dll,PrintUIEntry /if /b "Utility room 2 Konica C280" /f "c:\Printers\C280\MF220\PCL\Win_x86\KOAZ8JA_.INF" /r "IP_x.x.x.x" /m "Generic 36C-1SeriesPCL" /z

Where the reg key is

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port\Ports\IP_x.x.x.x]
"Protocol"=dword:00000002
"Version"=dword:00000001
"HostName"=""
"IPAddress"="x.x.x.x"
"HWAddress"=""
"PortNumber"=dword:00000203
"SNMP Community"="public"
"SNMP Enabled"=dword:00000000
"SNMP Index"=dword:00000001
"Queue"="Print"
"Double Spool"=dword:00000000

How to generate registry, just install the TCPIP printer on one machine then export registry section.

We have tweaked for ZCM
1 - Registry
2 - Stop Process Print Spooler
3 - Start Process Print Spooler
4 - Copy drivers
5 - Run last line of batch file "rundll" section as a script file in ZCM

We have used this in ZfD4, ZCM 10 and ZCM 11

This is working across XP, Win7 32 and 64bit.

Steve
0 Likes
eomolina Absent Member.
Absent Member.

Re: Install Printers as Bundles

Thanks for the response! Sorry it took so long to reply, but I had Friday off. 😉

:@: craig_wilson
QUOTES[\b]\
Insightful! I will try the quotes fix, but the code works perfectly (even with the weird quotes) if all the lines are applied as a batch file locally. At first I could not make sense of it, but when I tried the weird quoting, it worked! I was blown out of the water. But I will check the quotes for ZENworks. THANKS!

PRINTUI.EXE[\b]\
Windows 7 replaced the "RUNDLL32 PRINTUI.DLL,PrintUIEntry" command with just "PRINTUI.EXE". Again, I can confirm this when running a batch locally. Check Command Line Printer Control for more info. I think the problem maybe what you mentioned about running as Dynamic Admin. I will try your suggestion. THANKS!

COMBINING LINES[\b]\
Thinking about it, I guess you are right. I can change one thing at a glance if needed in the future. But is a pain to create, especially since I have several dozen classrooms in multiple campuses. Ohhh, well... elbow grease!


:@: sgardiner:
Interesting twist! If I stumble, I may have to try your approach. Thanks for sharing!


I will try few things and report back. 😉
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.