From: Jeremy Allison on
On Tue, Jun 22, 2010 at 02:57:52PM -0400, Eric Rowell wrote:
> Help or suggestions please:
>
> When using smbclient to handle printing from a AIX system to a windows
> print queue somethings work and others do not. I have been able to
> print without issues to the windows print queue. But I cannot get a
> listing of the print jobs in a print queue. This is important so the
> UNIX users can take action on thier print jobs.
>
> I'm not sure which why to turn at this point as it appears to be an
> error but it is too generic to easly solve. I'm going to be working
> with my windows addmistrators but I need a direction to go.
>
> The following is the configuration, commands, and debug for this problem.
>
> Running Samba 3.5.3 on AIX - pware64
> Domain controller is Windows 2003
> Printer Server is Windows 2003
>
>
> The AIX server had joined the domain successfully using "net ads join
> -U someadministrator(a)DOMAIN.COM
> The "net printer info PRINTER_GP42K2 -S PRINTQUEUESRV" will provide
> details about the print queue.
> I have given the test user account full access to windows print queue.
> This hasn't changed the issue.
>
> This has been tried using the Kerberos ticket as well as password
> challenge. Neither work for the queue command (both can print).
>
> Windows Client Command works using same account:
> ####################
> C:\>net print \\CORPPRINTSRV\ITD_HP4250
> Printers at \\CORPPRINTSRV
> Name Job # Size Status
> -------------------------------------------------------------------------------
> ITD_HP4250 Queue 3 jobs *Printer error*
> testacct 404 85200 Error
> testacct 601 37340 Waiting
> ERowell 1735 9905 Waiting
> The command completed successfully.
> ####################
>
> The following is the commands and a debug 10.
>
> cmd>export PATH=/opt/pware64/bin:/opt/pware64/sbin:/usr/bin:/bin:/etc:/usr/bin:/usr/etc:/usr/lib:/usr/local/bin:.:/usr/local/bin:/usr/vac/bin://bin:/usr/bin/X11:/sbin:/usr/informix/bin://bin:.
>
> cmd>kinit
> Password for erowell(a)DOMAIN.COM:
>
> cmd>klist
> Ticket cache: FILE:/tmp/krb5cc_35102
> Default principal: erowell(a)DOMAIN.COM
>
> Valid starting Expires Service principal
> 06/22/10 14:18:55 06/23/10 00:18:59 krbtgt/DOMAIN.COM(a)DOMAIN.COM
> renew until 06/23/10 00:18:55
>
> unset LIBPATH
>
> ####################
> # Without Debug
> ####################
> cmd>/opt/pware64/bin/smbclient "\\\\PRINTQUEUESRV\\PRINTER_GP42K2" -k
> OS=[Windows Server 2003 R2 3790 Service Pack 2] Server=[Windows Server
> 2003 R2 5.2]
> smb: \> queue
> smb: \> exit

Hmmm. Looks like the Windows server isn't replying to the
old RAP method of enumerating a print queue. Try using rpcclient
instead, with the "enumjobs <printer>" command. That uses the
more modern DCE-RPC interface into the printer subsystem.

Jeremy.
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba
From: Eric Rowell on
Jeremy,
WoW. It worked just as expected;
rpcclient -c "enumjobs printer" -U user printserver

This worked great to get the list of the jobs on the print queue.
(too bad the "net" command doesn't support this)

Now if I could just get the delete/cancel job command I would be
golden. I didn't see a command equivalent on the list of options for
the rpcclient command. Since the option from "net" and smbclient
don't work for the same reason.

Thank you for all the help you have already given,

Eric B. Rowell


On Tue, Jun 22, 2010 at 4:29 PM, Jeremy Allison <jra(a)samba.org> wrote:
> On Tue, Jun 22, 2010 at 02:57:52PM -0400, Eric Rowell wrote:
>> Help or suggestions please:
>>
>> When using smbclient to handle printing from a AIX system to a windows
>> print queue somethings work and others do not.  I have been able to
>> print without issues to the windows print queue.  But I cannot get a
>> listing of the print jobs in a print queue.  This is important so the
>> UNIX users can take action on thier print jobs.
>>
>> I'm not sure which why to turn at this point as it appears to be an
>> error but it is too generic to easly solve.  I'm going to be working
>> with my windows addmistrators but I need a direction to go.
>>
>> The following is the configuration, commands, and debug for this problem.
>>
>> Running Samba 3.5.3 on AIX - pware64
>> Domain controller is Windows 2003
>> Printer Server is Windows 2003
>>
>>
>> The AIX server had joined the domain successfully using "net ads join
>> -U someadministrator(a)DOMAIN.COM
>> The "net printer info PRINTER_GP42K2 -S PRINTQUEUESRV" will provide
>> details about the print queue.
>> I have given the test user account full access to windows print queue.
>>  This hasn't changed the issue.
>>
>> This has been tried using the Kerberos ticket as well as password
>> challenge.  Neither work for the queue command (both can print).
>>
>> Windows Client Command works using same account:
>> ####################
>> C:\>net print \\CORPPRINTSRV\ITD_HP4250
>> Printers at \\CORPPRINTSRV
>> Name                         Job #      Size            Status
>> -------------------------------------------------------------------------------
>> ITD_HP4250 Queue            3 jobs                      *Printer error*
>>      testacct                    404     85200            Error
>>      testacct                    601     37340            Waiting
>>      ERowell                  1735      9905            Waiting
>> The command completed successfully.
>> ####################
>>
>> The following is the commands and a debug 10.
>>
>> cmd>export PATH=/opt/pware64/bin:/opt/pware64/sbin:/usr/bin:/bin:/etc:/usr/bin:/usr/etc:/usr/lib:/usr/local/bin:.:/usr/local/bin:/usr/vac/bin://bin:/usr/bin/X11:/sbin:/usr/informix/bin://bin:.
>>
>> cmd>kinit
>> Password for erowell(a)DOMAIN.COM:
>>
>> cmd>klist
>> Ticket cache: FILE:/tmp/krb5cc_35102
>> Default principal: erowell(a)DOMAIN.COM
>>
>> Valid starting     Expires            Service principal
>> 06/22/10 14:18:55  06/23/10 00:18:59  krbtgt/DOMAIN.COM(a)DOMAIN.COM
>>         renew until 06/23/10 00:18:55
>>
>> unset LIBPATH
>>
>> ####################
>> # Without Debug
>> ####################
>> cmd>/opt/pware64/bin/smbclient "\\\\PRINTQUEUESRV\\PRINTER_GP42K2" -k
>> OS=[Windows Server 2003 R2 3790 Service Pack 2] Server=[Windows Server
>> 2003 R2 5.2]
>> smb: \> queue
>> smb: \> exit
>
> Hmmm. Looks like the Windows server isn't replying to the
> old RAP method of enumerating a print queue. Try using rpcclient
> instead, with the "enumjobs <printer>" command. That uses the
> more modern DCE-RPC interface into the printer subsystem.
>
> Jeremy.
>



--
Eric B. Rowell
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba
From: Jeremy Allison on
On Tue, Jun 22, 2010 at 05:21:22PM -0400, Eric Rowell wrote:
> Jeremy,
> WoW. It worked just as expected;
> rpcclient -c "enumjobs printer" -U user printserver
>
> This worked great to get the list of the jobs on the print queue.
> (too bad the "net" command doesn't support this)

Ok, I should fix the smbclient and net binaries to use
this instead.. Internally it's the cli_print_queue()
function. Maybe I should add a cli_print_queue2()
to keep backwards compatibility with old servers
that only support RAP printing, and change smbclient
and net to use cli_print_queue2() by default, and
then fall back to cli_print_queue() if that fails...


> Now if I could just get the delete/cancel job command I would be
> golden. I didn't see a command equivalent on the list of options for
> the rpcclient command. Since the option from "net" and smbclient
> don't work for the same reason.

Adding delete and cancel to rpcclient shouldn't
be too hard. We have all the infrastructure
for this. Probably will be in 3.6.0 and above though.

Jeremy.
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba
From: Eric Rowell on
Tried the following after poking around:

rpcclient -c "setjob printer 1340 job_control_cancel" -U username PrinterServer

rpcclient -c "setjob printer 1340 job_control_delete" -U username PrinterServer

It doesn't error but it didn't cancel or delete the job.


On Tue, Jun 22, 2010 at 5:21 PM, Eric Rowell <erowell(a)gmail.com> wrote:
> Jeremy,
>    WoW.  It worked just as expected;
>            rpcclient -c "enumjobs printer" -U user printserver
>
>   This worked great to get the list of the jobs on the print queue.
> (too bad the "net" command doesn't support this)
>
>   Now if I could just get the delete/cancel job command I would be
> golden.  I didn't see a command equivalent on the list of options for
> the rpcclient command.  Since the option from "net" and smbclient
> don't work for the same reason.
>
>   Thank you for all the help you have already given,
>
> Eric B. Rowell
>
>
> On Tue, Jun 22, 2010 at 4:29 PM, Jeremy Allison <jra(a)samba.org> wrote:
>> On Tue, Jun 22, 2010 at 02:57:52PM -0400, Eric Rowell wrote:
>>> Help or suggestions please:
>>>
>>> When using smbclient to handle printing from a AIX system to a windows
>>> print queue somethings work and others do not.  I have been able to
>>> print without issues to the windows print queue.  But I cannot get a
>>> listing of the print jobs in a print queue.  This is important so the
>>> UNIX users can take action on thier print jobs.
>>>
>>> I'm not sure which why to turn at this point as it appears to be an
>>> error but it is too generic to easly solve.  I'm going to be working
>>> with my windows addmistrators but I need a direction to go.
>>>
>>> The following is the configuration, commands, and debug for this problem.
>>>
>>> Running Samba 3.5.3 on AIX - pware64
>>> Domain controller is Windows 2003
>>> Printer Server is Windows 2003
>>>
>>>
>>> The AIX server had joined the domain successfully using "net ads join
>>> -U someadministrator(a)DOMAIN.COM
>>> The "net printer info PRINTER_GP42K2 -S PRINTQUEUESRV" will provide
>>> details about the print queue.
>>> I have given the test user account full access to windows print queue.
>>>  This hasn't changed the issue.
>>>
>>> This has been tried using the Kerberos ticket as well as password
>>> challenge.  Neither work for the queue command (both can print).
>>>
>>> Windows Client Command works using same account:
>>> ####################
>>> C:\>net print \\CORPPRINTSRV\ITD_HP4250
>>> Printers at \\CORPPRINTSRV
>>> Name                         Job #      Size            Status
>>> -------------------------------------------------------------------------------
>>> ITD_HP4250 Queue            3 jobs                      *Printer error*
>>>      testacct                    404     85200            Error
>>>      testacct                    601     37340            Waiting
>>>      ERowell                  1735      9905            Waiting
>>> The command completed successfully.
>>> ####################
>>>
>>> The following is the commands and a debug 10.
>>>
>>> cmd>export PATH=/opt/pware64/bin:/opt/pware64/sbin:/usr/bin:/bin:/etc:/usr/bin:/usr/etc:/usr/lib:/usr/local/bin:.:/usr/local/bin:/usr/vac/bin://bin:/usr/bin/X11:/sbin:/usr/informix/bin://bin:.
>>>
>>> cmd>kinit
>>> Password for erowell(a)DOMAIN.COM:
>>>
>>> cmd>klist
>>> Ticket cache: FILE:/tmp/krb5cc_35102
>>> Default principal: erowell(a)DOMAIN.COM
>>>
>>> Valid starting     Expires            Service principal
>>> 06/22/10 14:18:55  06/23/10 00:18:59  krbtgt/DOMAIN.COM(a)DOMAIN.COM
>>>         renew until 06/23/10 00:18:55
>>>
>>> unset LIBPATH
>>>
>>> ####################
>>> # Without Debug
>>> ####################
>>> cmd>/opt/pware64/bin/smbclient "\\\\PRINTQUEUESRV\\PRINTER_GP42K2" -k
>>> OS=[Windows Server 2003 R2 3790 Service Pack 2] Server=[Windows Server
>>> 2003 R2 5.2]
>>> smb: \> queue
>>> smb: \> exit
>>
>> Hmmm. Looks like the Windows server isn't replying to the
>> old RAP method of enumerating a print queue. Try using rpcclient
>> instead, with the "enumjobs <printer>" command. That uses the
>> more modern DCE-RPC interface into the printer subsystem.
>>
>> Jeremy.
>>
>
>
>
> --
> Eric B. Rowell
>



--
Eric B. Rowell
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba
From: Jeremy Allison on
On Tue, Jun 22, 2010 at 05:37:08PM -0400, Eric Rowell wrote:
> Tried the following after poking around:
>
> rpcclient -c "setjob printer 1340 job_control_cancel" -U username PrinterServer
>
> rpcclient -c "setjob printer 1340 job_control_delete" -U username PrinterServer
>
> It doesn't error but it didn't cancel or delete the job.

The "setjob" function uses a numeric job control code
(which sucks, I know :-).

So you need to do the following :

SPOOLSS_JOB_CONTROL_PAUSE=(int)(1),
SPOOLSS_JOB_CONTROL_RESUME=(int)(2),
SPOOLSS_JOB_CONTROL_CANCEL=(int)(3),
SPOOLSS_JOB_CONTROL_RESTART=(int)(4),
SPOOLSS_JOB_CONTROL_DELETE=(int)(5),
SPOOLSS_JOB_CONTROL_SEND_TO_PRINTER=(int)(6),
SPOOLSS_JOB_CONTROL_LAST_PAGE_EJECTED=(int)(7),
SPOOLSS_JOB_CONTROL_RETAIN=(int)(8),
SPOOLSS_JOB_CONTROL_RELEASE=(int)(9)

rpcclient -c "setjob printer 1340 5" -U username PrinterServer

for job control delete.
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba