Sign in to follow this  
Followers 0
Guest Jaap

Print as a different user

9 posts in this topic

#1 ·  Posted (edited)

This is the problem,

I have been using AutoIt for a few weeks now but having a major problem.

When users log in the network they are no administrator on the local workstation but some application require such, therefore I'm using AutoIt.

It works great but when I want to print from the application the application wants to print as the user administrator and sinds the local administrator has no rights to print to an network printer the system ask the user to login again.

This would not be a problem (make administrator account on the network something like so) but the users who print has to pay for this and they are charged by there user name. You can see why this is a problem for me.

What i want is that the printer is redirected back to the originale user who is logged on to the workstation, so the print is charged to the user who is logged in.

Does anyone have any idea on how to fix this issue.

GReeTings Jaap

Edited by Jaap

Share this post


Link to post
Share on other sites



This is the problem,

I have been using AutoIt for a few weeks now but having a major problem.

When users log in the network they are no administrator on the local workstation but some application require such, therefore I'm using AutoIt.

It works great but when I want to print from the application the application wants to print as the user administrator and sinds the local administrator has no rights to print to an network printer the system ask the user to login again.

This would not be a problem (make administrator account on the network something like so) but the users who print has to pay for this and they are charged by there user name. You can see why this is a problem for me.

What i want is that the printer is redirected back to the originale user who is logged on to the workstation, so the print is charged to the user who is logged in.

Does anyone have any idea on how to fix this issue.

GReeTings Jaap

<{POST_SNAPBACK}>

Surely the easiest solution would be to make the users local administrators for the workstation that they use. The only other option that I can think of would be to print to file and they send it to the printer from outside the application.


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

Surely the easiest solution would be to make the users local administrators for the workstation that they use. The only other option that I can think of would be to print to file and they send it to the printer from outside the application.

<{POST_SNAPBACK}>

The problem is that we don't want them to be administrators, they are students.

Share this post


Link to post
Share on other sites

This is the problem,

I have been using AutoIt for a few weeks now but having a major problem.

When users log in the network they are no administrator on the local workstation but some application require such, therefore I'm using AutoIt.

It works great but when I want to print from the application the application wants to print as the user administrator and sinds the local administrator has no rights to print to an network printer the system ask the user to login again.

This would not be a problem (make administrator account on the network something like so) but the users who print has to pay for this and they are charged by there user name. You can see why this is a problem for me.

What i want is that the printer is redirected back to the originale user who is logged on to the workstation, so the print is charged to the user who is logged in.

Does anyone have any idea on how to fix this issue.

GReeTings Jaap

<{POST_SNAPBACK}>

why not just have the script print using a network admin as you say would be easy, but then also track the printing with their username, like

_FileWriteLog("\\server\private folder\PRINTLOG.LOG",@UserName & "," & @ComputerName)

and you could of course add the filename being printed, or the file size etc, and then just bill from the log file per username, even if they're all printing as administrator.


1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

why not just have the script print using a network admin as you say would be easy, but then also track the printing with their username, like

_FileWriteLog("\\server\private folder\PRINTLOG.LOG",@UserName & "," & @ComputerName)

and you could of course add the filename being printed, or the file size etc, and then just bill from the log file per username, even if they're all printing as administrator.

<{POST_SNAPBACK}>

We are working with pcounter and billing is beeing done based on wich username gives a print order.

If I would bill from log files this would cause delay and users wil print above there limit. Also the administrative task we would have is huge (talking about 7.500 students on one location only).

Share this post


Link to post
Share on other sites

Simple solution: After starting the script as Administrator you need to reconnect the printers as the real user. Something like that:

If not IsAdmin() Then
    RunAsSet('Administrator', '', 'Password')
    Exit RunWait('"' & @ScriptFullPath & '" ' & @Username)
Endif
DriveMapAdd('', '\\server\printer', 8, $CmdLine[1])
RunWait('program_that_needs_to_print.exe')

It's pseudocode, so you need to check it for errors, but that's the way it should work.

I'm not sure DriveMapAdd works for printers, if it doesn't, you have to use "net use".

Share this post


Link to post
Share on other sites

We are working with pcounter and billing is beeing done based on wich username gives a print order.

If I would bill from log files this would cause delay and users wil print above there limit. Also the administrative task we would have is huge (talking about 7.500 students on one location only).

<{POST_SNAPBACK}>

Back to my original idea, print to file and get the script to copy the file to the printer port as the user.


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

The problem is that we don't want them to be administrators, they are students.

<{POST_SNAPBACK}>

Can't you give students printing rights on the printers themselves? Are they networked printers or locally connected to a parallel/usb port? We give students printing rights to all printers except the color printers. Those are usually used only on the local machine. The printer/copier in the special ed department is only available to people in the "sped" active directory group, etc...

...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format

Share this post


Link to post
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
Sign in to follow this  
Followers 0