Discussion:
[Samba] smbclient queue command issue
(too old to reply)
Eric Rowell
2010-06-22 20:00:01 UTC
Permalink
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 ***@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 ***@DOMAIN.COM:

cmd>klist
Ticket cache: FILE:/tmp/krb5cc_35102
Default principal: ***@DOMAIN.COM

Valid starting Expires Service principal
06/22/10 14:18:55 06/23/10 00:18:59 krbtgt/***@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

####################
# With Debug
####################
cmd>/opt/pware64/bin/smbclient "\\\\PRINTQUEUESRV\\PRINTER_GP42K2" -k -d10
INFO: Current debug levels:
all: True/10
tdb: False/0
printdrivers: False/0
lanman: False/0
smb: False/0
rpc_parse: False/0
rpc_srv: False/0
rpc_cli: False/0
passdb: False/0
sam: False/0
auth: False/0
winbind: False/0
vfs: False/0
idmap: False/0
quota: False/0
acls: False/0
locking: False/0
msdfs: False/0
dmapi: False/0
registry: False/0
lp_load_ex: refreshing parameters
Initialising global parameters
rlimit_max: rlimit_max (2000) below minimum Windows limit (16384)
params.c:pm_process() - Processing configuration file
"/opt/pware64/lib/smb.conf"
Processing section "[global]"
doing parameter workgroup = NVR
doing parameter lpq cache time = 0
doing parameter map to guest = Bad User
doing parameter include = /etc/samba/dhcp.conf
Can't find include file /etc/samba/dhcp.conf
doing parameter logon path = \\%L\profiles\.msprofile
doing parameter logon home = \\%L\%U\.9xprofile
doing parameter logon drive = P:
doing parameter usershare allow guests = No
doing parameter add machine script = /usr/sbin/useradd -c Machine -d
/var/lib/nobody -s /bin/false %m$
doing parameter domain logons = No
doing parameter domain master = No
doing parameter ldap delete dn = No
doing parameter ldap group suffix = ou=Groups
doing parameter ldap idmap suffix = ou=Idmap
doing parameter ldap machine suffix = ou=Machines
doing parameter ldap passwd sync = Yes
doing parameter ldap replication sleep = 1000
doing parameter ldap ssl = Start_tls
doing parameter ldap suffix = dc=DOMAIN,dc=com
doing parameter ldap timeout = 5
doing parameter ldap user suffix = ou=Users
doing parameter passdb backend = smbpasswd
doing parameter security = ADS
doing parameter wins server = 10.1.1.2
doing parameter wins support = No
doing parameter idmap gid = 10000-20000
doing parameter idmap uid = 10000-20000
doing parameter realm = DOMAIN.COM
doing parameter template homedir = /home/%D/%U
doing parameter template shell = /bin/bash
doing parameter usershare max shares = 100
doing parameter winbind refresh tickets = yes
pm_process() returned Yes
lp_servicenumber: couldn't find homes
set_server_role: role = ROLE_DOMAIN_MEMBER
Attempting to register new charset UCS-2LE
Registered charset UCS-2LE
Attempting to register new charset UTF-16LE
Registered charset UTF-16LE
Attempting to register new charset UCS-2BE
Registered charset UCS-2BE
Attempting to register new charset UTF-16BE
Registered charset UTF-16BE
Attempting to register new charset UTF8
Registered charset UTF8
Attempting to register new charset UTF-8
Registered charset UTF-8
Attempting to register new charset ASCII
Registered charset ASCII
Attempting to register new charset 646
Registered charset 646
Attempting to register new charset ISO-8859-1
Registered charset ISO-8859-1
Attempting to register new charset UCS2-HEX
Registered charset UCS2-HEX
Substituting charset 'ISO8859-1' for LOCALE
Substituting charset 'ISO8859-1' for LOCALE
Substituting charset 'ISO8859-1' for LOCALE
Substituting charset 'ISO8859-1' for LOCALE
Substituting charset 'ISO8859-1' for LOCALE
Substituting charset 'ISO8859-1' for LOCALE
Substituting charset 'ISO8859-1' for LOCALE
Substituting charset 'ISO8859-1' for LOCALE
Substituting charset 'ISO8859-1' for LOCALE
Substituting charset 'ISO8859-1' for LOCALE
Substituting charset 'ISO8859-1' for LOCALE
Substituting charset 'ISO8859-1' for LOCALE
Substituting charset 'ISO8859-1' for LOCALE
Substituting charset 'ISO8859-1' for LOCALE
added interface en4 ip=10.1.1.202 bcast=10.1.1.255 netmask=
added interface lo0 ip=127.0.0.1 bcast=127.255.255.255 netmask=
Netbios name list:-
my_netbios_names[0]="DCUCSAPP01PRD"
Client started (version 3.5.3).
Opening cache file at /opt/pware64/var/locks/gencache.tdb
Opening cache file at /opt/pware64/var/locks/gencache_notrans.tdb
tdb(unnamed): tdb_open_ex: could not open file
/opt/pware64/var/locks/gencache_notrans.tdb: Permission denied
Opening /opt/pware64/var/locks/gencache_notrans.tdb failed: Permission denied
sitename_fetch: No stored sitename for DOMAIN.COM
internal_resolve_name: looking up PRINTQUEUESRV#20 (sitename (null))
Opening cache file at /opt/pware64/var/locks/gencache.tdb
Opening cache file at /opt/pware64/var/locks/gencache_notrans.tdb
tdb(unnamed): tdb_open_ex: could not open file
/opt/pware64/var/locks/gencache_notrans.tdb: Permission denied
Opening /opt/pware64/var/locks/gencache_notrans.tdb failed: Permission denied
no entry for PRINTQUEUESRV#20 found.
resolve_lmhosts: Attempting lmhosts lookup for name PRINTQUEUESRV<0x20>
resolve_wins: Attempting wins lookup for name PRINTQUEUESRV<0x20>
Opening cache file at /opt/pware64/var/locks/gencache.tdb
Opening cache file at /opt/pware64/var/locks/gencache_notrans.tdb
tdb(unnamed): tdb_open_ex: could not open file
/opt/pware64/var/locks/gencache_notrans.tdb: Permission denied
Opening /opt/pware64/var/locks/gencache_notrans.tdb failed: Permission denied
wins_srv_is_dead: 10.1.1.2 is alive
Current wins server for tag '*' with source 0.0.0.0 is 10.1.1.2
Opening cache file at /opt/pware64/var/locks/gencache.tdb
Opening cache file at /opt/pware64/var/locks/gencache_notrans.tdb
tdb(unnamed): tdb_open_ex: could not open file
/opt/pware64/var/locks/gencache_notrans.tdb: Permission denied
Opening /opt/pware64/var/locks/gencache_notrans.tdb failed: Permission denied
wins_srv_is_dead: 10.1.1.2 is alive
resolve_wins: using WINS server 10.1.1.2 and tag '*'
bind succeeded on port 0
Sending a packet of len 50 to (10.1.1.2) on port 137
read_udp_v4_socket: ip 10.1.1.2 port 137 read: 62
parse_nmb: packet id = 4196
Received a packet of len 62 from (10.1.1.2) port 137
nmb packet from 10.1.1.2(137) header: id=4196 opcode=Query(0) response=Yes
header: flags: bcast=No rec_avail=Yes rec_des=Yes trunc=No auth=Yes
header: rcode=0 qdcount=0 ancount=1 nscount=0 arcount=0
answers: nmb_name=PRINTQUEUESRV<20> rr_type=32 rr_class=1 ttl=0
answers 0 char `..... hex 60000A0101F0
Got a positive name query response from 10.1.1.2 ( 10.1.1.240 )
remove_duplicate_addrs2: looking for duplicate address/port pairs
namecache_store: storing 1 address for PRINTQUEUESRV#20: 10.1.1.240
Opening cache file at /opt/pware64/var/locks/gencache.tdb
Opening cache file at /opt/pware64/var/locks/gencache_notrans.tdb
tdb(unnamed): tdb_open_ex: could not open file
/opt/pware64/var/locks/gencache_notrans.tdb: Permission denied
Opening /opt/pware64/var/locks/gencache_notrans.tdb failed: Permission denied
internal_resolve_name: returning 1 addresses: 10.1.1.240:0
Running timed event "tevent_req_timedout" 110088e40
Connecting to 10.1.1.240 at port 445
Socket options:
SO_KEEPALIVE = 0
SO_REUSEADDR = 0
SO_BROADCAST = 0
TCP_NODELAY = 4
TCP_KEEPCNT = 8
TCP_KEEPIDLE = 7200
TCP_KEEPINTVL = 75
IPTOS_LOWDELAY = 0
IPTOS_THROUGHPUT = 0
SO_REUSEPORT = 0
SO_SNDBUF = 131400
SO_RCVBUF = 65700
SO_SNDLOWAT = 4096
SO_RCVLOWAT = 1
SO_SNDTIMEO = 0
SO_RCVTIMEO = 0
session request ok
Substituting charset 'ISO8859-1' for LOCALE
Substituting charset 'ISO8859-1' for LOCALE
Substituting charset 'ISO8859-1' for LOCALE
Substituting charset 'ISO8859-1' for LOCALE
Substituting charset 'ISO8859-1' for LOCALE
Substituting charset 'ISO8859-1' for LOCALE
Substituting charset 'ISO8859-1' for LOCALE
Substituting charset 'ISO8859-1' for LOCALE
Substituting charset 'ISO8859-1' for LOCALE
Substituting charset 'ISO8859-1' for LOCALE
Substituting charset 'ISO8859-1' for LOCALE
Substituting charset 'ISO8859-1' for LOCALE
Substituting charset 'ISO8859-1' for LOCALE
Substituting charset 'ISO8859-1' for LOCALE
Doing spnego session setup (blob length=112)
got OID=1.2.840.48018.1.2.2
got OID=1.2.840.113554.1.2.2
got OID=1.2.840.113554.1.2.2.3
got OID=1.3.6.1.4.1.311.2.2.10
got principal=PRINTQUEUESRV$@DOMAIN.COM
Doing kerberos session setup
ads_cleanup_expired_creds: Ticket in ccache[FILE:/tmp/krb5cc_35102]
expiration Wed, 23 Jun 2010 00:18:59 EDT
ads_krb5_mk_req: Ticket (PRINTQUEUESRV$@DOMAIN.COM) in ccache
(FILE:/tmp/krb5cc_35102) is valid until: (Wed, 23 Jun 2010 00:18:59
EDT
- 1277266739)
Got KRB5 session key of length 8
cli_session_setup_blob: Remaining (0) sending (2582) current (2582)
write_socket(4,2668)
write_socket(4,2668) wrote 2668
got smb length of 209
size=209
smb_com=0x73
smb_rcls=0
smb_reh=0
smb_err=0
smb_flg=136
smb_flg2=51201
smb_tid=0
smb_pid=41030
smb_uid=16387
smb_mid=2
smt_wct=4
smb_vwv[ 0]= 255 (0xFF)
smb_vwv[ 1]= 209 (0xD1)
smb_vwv[ 2]= 0 (0x0)
smb_vwv[ 3]= 26 (0x1A)
smb_bcc=166
[0000] A1 18 30 16 A0 03 0A 01 00 A1 0B 06 09 2A 86 48 ..0..... .....*.H
[0010] 82 F7 12 01 02 02 A2 02 04 00 17 57 00 69 00 6E ........ ...W.i.n
[0020] 00 64 00 6F 00 77 00 73 00 20 00 53 00 65 00 72 .d.o.w.s . .S.e.r
[0030] 00 76 00 65 00 72 00 20 00 32 00 30 00 30 00 33 .v.e.r. .2.0.0.3
[0040] 00 20 00 52 00 32 00 20 00 33 00 37 00 39 00 30 . .R.2. .3.7.9.0
[0050] 00 20 00 53 00 65 00 72 00 76 00 69 00 63 00 65 . .S.e.r .v.i.c.e
[0060] 00 20 00 50 00 61 00 63 00 6B 00 20 00 32 00 00 . .P.a.c .k. .2..
[0070] 00 57 00 69 00 6E 00 64 00 6F 00 77 00 73 00 20 .W.i.n.d .o.w.s.
[0080] 00 53 00 65 00 72 00 76 00 65 00 72 00 20 00 32 .S.e.r.v .e.r. .2
[0090] 00 30 00 30 00 33 00 20 00 52 00 32 00 20 00 35 .0.0.3. .R.2. .5
[00A0] 00 2E 00 32 00 00 ...2..
size=209
smb_com=0x73
smb_rcls=0
smb_reh=0
smb_err=0
smb_flg=136
smb_flg2=51201
smb_tid=0
smb_pid=41030
smb_uid=16387
smb_mid=2
smt_wct=4
smb_vwv[ 0]= 255 (0xFF)
smb_vwv[ 1]= 209 (0xD1)
smb_vwv[ 2]= 0 (0x0)
smb_vwv[ 3]= 26 (0x1A)
smb_bcc=166
[0000] A1 18 30 16 A0 03 0A 01 00 A1 0B 06 09 2A 86 48 ..0..... .....*.H
[0010] 82 F7 12 01 02 02 A2 02 04 00 17 57 00 69 00 6E ........ ...W.i.n
[0020] 00 64 00 6F 00 77 00 73 00 20 00 53 00 65 00 72 .d.o.w.s . .S.e.r
[0030] 00 76 00 65 00 72 00 20 00 32 00 30 00 30 00 33 .v.e.r. .2.0.0.3
[0040] 00 20 00 52 00 32 00 20 00 33 00 37 00 39 00 30 . .R.2. .3.7.9.0
[0050] 00 20 00 53 00 65 00 72 00 76 00 69 00 63 00 65 . .S.e.r .v.i.c.e
[0060] 00 20 00 50 00 61 00 63 00 6B 00 20 00 32 00 00 . .P.a.c .k. .2..
[0070] 00 57 00 69 00 6E 00 64 00 6F 00 77 00 73 00 20 .W.i.n.d .o.w.s.
[0080] 00 53 00 65 00 72 00 76 00 65 00 72 00 20 00 32 .S.e.r.v .e.r. .2
[0090] 00 30 00 30 00 33 00 20 00 52 00 32 00 20 00 35 .0.0.3. .R.2. .5
[00A0] 00 2E 00 32 00 00 ...2..
cli_init_creds: user erowell domain NVR
OS=[Windows Server 2003 R2 3790 Service Pack 2] Server=[Windows Server
2003 R2 5.2]
session setup ok
size=120
smb_com=0x32
smb_rcls=0
smb_reh=0
smb_err=0
smb_flg=8
smb_flg2=51201
smb_tid=8199
smb_pid=41030
smb_uid=16387
smb_mid=4
smt_wct=15
smb_vwv[ 0]= 52 (0x34)
smb_vwv[ 1]= 0 (0x0)
smb_vwv[ 2]= 2 (0x2)
smb_vwv[ 3]=16644 (0x4104)
smb_vwv[ 4]= 0 (0x0)
smb_vwv[ 5]= 0 (0x0)
smb_vwv[ 6]= 0 (0x0)
smb_vwv[ 7]= 0 (0x0)
smb_vwv[ 8]= 0 (0x0)
smb_vwv[ 9]= 52 (0x34)
smb_vwv[10]= 68 (0x44)
smb_vwv[11]= 0 (0x0)
smb_vwv[12]= 120 (0x78)
smb_vwv[13]= 1 (0x1)
smb_vwv[14]= 16 (0x10)
smb_bcc=55
[0000] 00 44 20 03 00 5C 00 43 00 4F 00 52 00 50 00 50 .D ..\.C .O.R.P.P
[0010] 00 52 00 49 00 4E 00 54 00 53 00 52 00 56 00 5C .R.I.N.T .S.R.V.\
[0020] 00 41 00 43 00 43 00 5F 00 48 00 50 00 34 00 32 .A.C.C._ .H.P.4.2
[0030] 00 4B 00 32 00 00 00 .K.2...
write_socket(4,124)
write_socket(4,124) wrote 124
got smb length of 35
size=35
smb_com=0x32
smb_rcls=14
smb_reh=0
smb_err=49152
smb_flg=136
smb_flg2=51201
smb_tid=8199
smb_pid=41030
smb_uid=16387
smb_mid=4
smt_wct=0
smb_bcc=0
size=35
smb_com=0x32
smb_rcls=14
smb_reh=0
smb_err=49152
smb_flg=136
smb_flg2=51201
smb_tid=8199
smb_pid=41030
smb_uid=16387
smb_mid=4
smt_wct=0
smb_bcc=0
write_socket(4,39)
write_socket(4,39) wrote 39
got smb length of 35
size=35
smb_com=0x71
smb_rcls=0
smb_reh=0
smb_err=0
smb_flg=136
smb_flg2=51201
smb_tid=8199
smb_pid=41030
smb_uid=16387
smb_mid=5
smt_wct=0
smb_bcc=0
tconx ok
smb: \> queue
doing cli_print_queue for PRINTER_GP42K2
size=125
smb_com=0x25
smb_rcls=0
smb_reh=0
smb_err=0
smb_flg=8
smb_flg2=51201
smb_tid=10240
smb_pid=41030
smb_uid=16387
smb_mid=7
smt_wct=14
smb_vwv[ 0]= 35 (0x23)
smb_vwv[ 1]= 0 (0x0)
smb_vwv[ 2]= 1024 (0x400)
smb_vwv[ 3]=65535 (0xFFFF)
smb_vwv[ 4]= 0 (0x0)
smb_vwv[ 5]= 0 (0x0)
smb_vwv[ 6]= 0 (0x0)
smb_vwv[ 7]= 0 (0x0)
smb_vwv[ 8]= 0 (0x0)
smb_vwv[ 9]= 35 (0x23)
smb_vwv[10]= 90 (0x5A)
smb_vwv[11]= 0 (0x0)
smb_vwv[12]= 125 (0x7D)
smb_vwv[13]= 0 (0x0)
smb_bcc=62
[0000] 00 5C 00 50 00 49 00 50 00 45 00 5C 00 4C 00 41 .\.P.I.P .E.\.L.A
[0010] 00 4E 00 4D 00 41 00 4E 00 00 00 4C 00 7A 57 72 .N.M.A.N ...L.zWr
[0020] 4C 65 68 00 57 57 7A 57 57 44 44 7A 7A 00 41 43 Leh.WWzW WDDzz.AC
[0030] 43 5F 48 50 34 32 4B 32 00 02 00 E8 03 00 C_HP42K2 ......
write_socket(4,129)
write_socket(4,129) wrote 129
got smb length of 35
size=35
smb_com=0x25
smb_rcls=5
smb_reh=2
smb_err=49152
smb_flg=136
smb_flg2=51201
smb_tid=10240
smb_pid=41030
smb_uid=16387
smb_mid=7
smt_wct=0
smb_bcc=0
size=35
smb_com=0x25
smb_rcls=5
smb_reh=2
smb_err=49152
smb_flg=136
smb_flg2=51201
smb_tid=10240
smb_pid=41030
smb_uid=16387
smb_mid=7
smt_wct=0
smb_bcc=0
smb: \>
--
Eric B. Rowell
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba
Jeremy Allison
2010-06-22 20:30:02 UTC
Permalink
Post by Eric Rowell
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
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).
####################
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
cmd>klist
Ticket cache: FILE:/tmp/krb5cc_35102
Valid starting Expires Service principal
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
Eric Rowell
2010-06-22 21:30:02 UTC
Permalink
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
Post by Jeremy Allison
Post by Eric Rowell
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
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).
####################
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
cmd>klist
Ticket cache: FILE:/tmp/krb5cc_35102
Valid starting     Expires            Service principal
        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
Eric Rowell
2010-06-22 21:40:03 UTC
Permalink
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.
Post by Eric Rowell
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
Post by Jeremy Allison
Post by Eric Rowell
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
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).
####################
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
cmd>klist
Ticket cache: FILE:/tmp/krb5cc_35102
Valid starting     Expires            Service principal
        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
Jeremy Allison
2010-06-22 21:50:01 UTC
Permalink
Post by Eric Rowell
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
Jeremy Allison
2010-06-22 22:10:02 UTC
Permalink
Post by Jeremy Allison
Post by Eric Rowell
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 :-).
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.
Here's a patch (that applies to 3.5.x) that
makes this a little nicer to use.

Jeremy.
Eric Rowell
2010-06-23 12:00:02 UTC
Permalink
Thank you for the patch. This will help make it easier for others to
use this command set. Is there anything I can do to help get it into
the documentation for the man page for future people looking to use
this?

Eric B. Rowell
Post by Jeremy Allison
Post by Jeremy Allison
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 :-).
        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.
Here's a patch (that applies to 3.5.x) that
makes this a little nicer to use.
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
Jeremy Allison
2010-06-23 20:30:02 UTC
Permalink
Post by Eric Rowell
Thank you for the patch. This will help make it easier for others to
use this command set. Is there anything I can do to help get it into
the documentation for the man page for future people looking to use
this?
Err, yes. You could write the documentation for the "setjob"
command (which is missing right now).

Jeremy.
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba
Eric Rowell
2010-06-23 11:50:02 UTC
Permalink
Jeremy,
Thank you so much for your time on this. This is great, it worked.
I now can do what is currently required for listing and canceling
print jobs.

I'm good with using numeric job control codes. I'm going to be
embedding these program calls into a set of programs which will be
running these commands for the users. This will allows the values for
that field to be whatever is required. Man I have spent way too much
time trying to get the RAP versions working, guess I should have
posted more details a few weeks ago.

I hope the people who have asked me if anyone has got it this
working are reading. You have provided me and some other people out
there a great set of solutions. May not be where we expected but it
is solved. I never even looked at the rpcclient and it is very
powerful.

Eric B. Rowell
Post by Jeremy Allison
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 :-).
       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.
--
Eric B. Rowell
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba
Jeremy Allison
2010-06-22 21:40:03 UTC
Permalink
Post by Eric Rowell
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...
Post by Eric Rowell
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
Eric Rowell
2010-06-23 11:40:02 UTC
Permalink
I would agree with the thoughts on the suggests changes. But I also
understand the limited resources on making these changes. At least if
we can get these in the "net" command so they are in one common place.

I would suggest that the cancel should also go into the "net" command.
Just to have a common set of tools compared to the windows "net"
command. Makes it easier to have people find. But if it is in the
rpcclient command I'm OK with that too.

Eric
Post by Jeremy Allison
Post by Eric Rowell
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...
Post by Eric Rowell
   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.
--
Eric B. Rowell
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba
Loading...