Home All Groups Group Topic Archive Search About

dotNet Class for Printer ACL

Author
16 Feb 2007 4:46 AM
SteveYau
Hi there,

Knowing that .Net 2.0 has new System.Security.AccessControl namespace. I
read through the documentation but I cannot find a class that can manipulate
printer's ACL, e.g. Print, ManageDocument, ManagePrinters...

Basically, I've written a Windows Service that need to check a particular
printer's ACL and see if a document can be printed. Right now, I'm using
ADSI's ADsSecurityUtility, IADsAccessControlList and IADsAccessControlEntry
to read a printer's ACL.

What I would like to do is to see if "Everyone" have the "Print" permission
on that printer.

Can this be done solely in .NET Framework 2.0?

Thanks in advance.

Steve

Author
16 Feb 2007 2:13 PM
Ciaran O''Donnell
As far as I know there is no actual printer object in .NET which would
support this. You would need to use WMI or ADSI to get a printer object and
test the permissions. There is also bound to be a WindowsAPI call you could
make.

You can generate managed wrappers for WMI things in the Server Explorer in
Visual studio but if you have something working then its probably worth
leaving it.


Show quote
"SteveYau" wrote:

> Hi there,
>
> Knowing that .Net 2.0 has new System.Security.AccessControl namespace. I
> read through the documentation but I cannot find a class that can manipulate
> printer's ACL, e.g. Print, ManageDocument, ManagePrinters...
>
> Basically, I've written a Windows Service that need to check a particular
> printer's ACL and see if a document can be printed. Right now, I'm using
> ADSI's ADsSecurityUtility, IADsAccessControlList and IADsAccessControlEntry
> to read a printer's ACL.
>
> What I would like to do is to see if "Everyone" have the "Print" permission
> on that printer.
>
> Can this be done solely in .NET Framework 2.0?
>
> Thanks in advance.
>
> Steve

AddThis Social Bookmark Button