question

Kat21-6813 avatar image
0 Votes"
Kat21-6813 asked Castorix31 commented

Windows 10 Printer Drivers - for each driver installed is there a way of telling whether it was admin-installed or user-installed?

Window Printer Driver - for each driver installed is there a way of telling whether it was admin-installed or otherwise?

Could this be reg key, file permissions etc?

Essentially I would like to enumerate a list of the printer drivers installed on a device; where the driver is "user-installed", remove it and re-install with admin rights.

All related to the user requiring Admin rights to connect to point and print shares.

Regards,

K

windows-hardware-wdk
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Castorix31 avatar image
0 Votes"
Castorix31 answered Castorix31 commented

As Admin with SE_SECURITY_NAME privilege,
use
EnumPrinterDrivers
then
GetFileSecurity
GetSecurityDescriptorOwner
LookupAccountSid
to get the owner of pDriverPath of DRIVER_INFO_n structure


(tested on Windows 10 1909)






· 6
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for that! How would this be achieved using PowerShell; this looks like syntax that might be used in another scripting language..?


0 Votes 0 ·

I tested in C++, as you set the Tag "windows-hardware-wdk", which is rather for C/C++

0 Votes 0 ·

Ah, my bad - have re-tagged appropriately. Thanks though; hadn't realised.

0 Votes 0 ·
Show more comments