Jump to content

Microsoft printer question


Bert
 Share

Recommended Posts

Here is my question, and I hope someone with wisdom can answer this:

You have a windows print server.

There are 200 printers installed on the server

They are all shared

To be able to print, you can do one of 2 methods:

1. Logged on as the user: Start>Run>\\printserver\printer1

This will connect to the share on a PROFILE level. In other words, if someone else logs in, they will not be connected to the printer. It doesn't even show up in the list of printers. Only the user who did this will be connected, and see the printer listed in the printers folder.

2. Use command line like this: RunWait("rundll32 printui.dll,PrintUIEntry /in /q /n" & $ret)

This installs the printer on a MACHINE level. In other words, no matter who logs in, you get connected to the share.

My question is this: If you are logged on as a admin, how do you delete any printer shares that the user is connected to on a PROFILE level? I want to make a tool that does this. I currently have a tool that will detect any printers installed, but only under the user name I'm currently logged on as. I suspect (though have no idea how) the registry is involved.

Thoughts?

Link to comment
Share on other sites

I think you would have to open that user's NTUSER.DAT, which is their HKCU (HKEY_CURRENT_USER) hive when they are logged in, and change it there.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Thats the problem. If they are not logged in, how do I get it? I need to be able to delete the connection to the share so that when they log in again, the printers are mapped where I need them to be. I can't do anything with login scripts. I'm not allowed.

Link to comment
Share on other sites

Thats the problem. If they are not logged in, how do I get it? I need to be able to delete the connection to the share so that when they log in again, the printers are mapped where I need them to be. I can't do anything with login scripts. I'm not allowed.

Well, from AutoIt, I'm not sure you can. In RegEdt32.exe you can load the hive (the user's NTUser.DAT file), edit, and then unload the hive.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

oops - again a missing Larry post -

http://www.autoitscript.com/forum/index.ph...st&p=382209

RegLoadHive here - ~Jap

Ooh... good link.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...