burnsc
(Starting to like KiXtart)
2004-05-13 09:39 PM
Printer permissions

Has anyone written a script to check the "print" permissions to a printer. I want to use this in a login script to install all the printers that a user has permissions to.

Thanks


LonkeroAdministrator
(KiX Master Guru)
2004-05-13 09:46 PM
Re: Printer permissions

well, if you have XP, you need to also check if the user has rights to install printers on local system.

burnsc
(Starting to like KiXtart)
2004-05-13 09:52 PM
Re: Printer permissions

Right now we are on NT. Which right would I check for this?

So far delploying printers by login script has not been a problem, but I have only done this on a limited user set. If it proves to be a problem, then I will begin deploying useing our main application deployment system(it has a user on the network that has full local admin rights it uses). Deploying this by Kixtart is easier though.

The print server is a Windows 2000 Server machine.


NTDOCAdministrator
(KiX Master)
2004-05-14 02:38 AM
Re: Printer permissions

Depends on how you're limiting access to the printers.

If you're using NT Groups you could use an If InGroup call to see if the user has rights to the printers.



Les
(KiX Master)
2004-05-14 03:09 AM
Re: Printer permissions

Sounds like an odd request. Why would you not know who has permission to what printers? Why would you want to map to EVERY printer a user has access to? Setup an INI file and use one of the printer mapping UDFs that read from the INI.

If you tried to map to a printer the user has no access to, would it not return an error? Would that then not tell you what printer the user has access to?


burnsc
(Starting to like KiXtart)
2004-05-14 02:01 PM
Re: Printer permissions

My original layout was to map useing ingroup and set permissions to that group rather than the user. Since we are looking at more of a group centric achitecture. I already have this method working.
BUT, just in case rights gets added by user in addition, what I wanted to do was truthfully resolver the rights and see if the user in question has 'print' level rights to the printer. I wanted to use that as the 'ultimate' mapping mechanism.


LonkeroAdministrator
(KiX Master Guru)
2004-05-14 02:14 PM
Re: Printer permissions

well, adding all the printers, should only add those to which the user has rights to.
like said...

but I wonder, you must have just a few printers or you are doing something weird.
I wouldn't like to add all of my printers to users.
and if some printers have restrictions, I do it via resource-groups


burnsc
(Starting to like KiXtart)
2004-05-14 02:25 PM
Re: Printer permissions

Well I am also makeing sure that my acl rights are proper for the printers.
Most of my users have access to no more than 3 printers. Except for engineers, they have access to around 10 printers.
Where is this add all printers option?


LonkeroAdministrator
(KiX Master Guru)
2004-05-14 02:33 PM
Re: Printer permissions

what add all printers option?

burnsc
(Starting to like KiXtart)
2004-05-14 02:36 PM
Re: Printer permissions

"well, adding all the printers, should only add those to which the user has rights to."
I was refering to that line from your reply. I was not sure if this was truely an option or a function. I did a search in the manual for "All Printers" and found nothing.


LonkeroAdministrator
(KiX Master Guru)
2004-05-14 02:55 PM
Re: Printer permissions

obviously, if you have printers you want to connect to and you said in your first post all, I refer to that same all.
well, now it looks like you haven't thought this through.

you still need to have the code to connect the printers.
so,
for each $printer in $whole_organization
$nul=addprinterconnection($printer)
next


Kdyer
(KiX Supporter)
2004-05-14 02:58 PM
Re: Printer permissions

Couple of thoughts..

Maybe there is a switch in PrintMig.EXE?

Digging on MSDN, there maybe some light in Win32_Printer?

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_printer.asp

Looking under Status, we some some mention of users, under status.

HTH,

Kent


burnsc
(Starting to like KiXtart)
2004-05-14 03:05 PM
Re: Printer permissions

Ok. I was thinking you was referring to a function somewhere that could read all the printers. My Bad.

All of the printers I am looking at are housed on one server. That is an important part that I forgot earlier. Sorry.

This is (psudocode), more like:
for each $printer on $server
If Print_priv($Printer)
$ret = addPrinterConnection($Printer)
EndIf
Next


burnsc
(Starting to like KiXtart)
2004-05-14 03:18 PM
Re: Printer permissions

Hmmm... I dont remember if there is a WMI client for WinNT. I will have to check that out.

Still looking for PrintMig.exe currently.


LonkeroAdministrator
(KiX Master Guru)
2004-05-14 03:35 PM
Re: Printer permissions

well, my pseudocode was what I ment.
well, not just pseudo but actually all you need.

like said, if you don't have access to the printer, it does not add it.
thus the permission check is not needed at all.


burnsc
(Starting to like KiXtart)
2004-05-14 03:42 PM
Re: Printer permissions

So, If I tried to add all the printers and the user did not have "print" access to that printer it would not add it. That is nice to know.

Thanks


Kdyer
(KiX Supporter)
2004-05-14 06:33 PM
Re: Printer permissions

PrintMig.EXE is part of the Resource Kit.

WMINT4.EXE is available from Microsoft for download.

Kent


burnsc
(Starting to like KiXtart)
2004-05-14 07:08 PM
Re: Printer permissions

Which resource kit? Windows 2000/XP?


Thanks


Kdyer
(KiX Supporter)
2004-05-14 08:11 PM
Re: Printer permissions

I see it in both 2000/2k3 Resource Kits.

Kent


Sealeopard
(KiX Master)
2004-05-15 11:12 PM
Re: Printer permissions

Why even check the ACLs?

ADDPRINTERCONNECTION will fail if the user does not have access (e.g. print) rights on that printer, anyway.


Les
(KiX Master)
2004-05-16 01:54 AM
Re: Printer permissions

...which is pretty much what I said.
Quote:

If you tried to map to a printer the user has no access to, would it not return an error? Would that then not tell you what printer the user has access to?




LonkeroAdministrator
(KiX Master Guru)
2004-05-16 11:26 PM
Re: Printer permissions

ja, and I repeated that about 3-5 times.
so, wonder how many times it needs to be said.