Jump to content

Recommended Posts

Posted

Hi, i'm trying to add a printer with RunAs credentials in a domain environment.
I'm loged on as a local user, and in the startupscript it says:

runas("administrator","domain","******",1,runwait("rundll32 printui.dll,PrintUIEntry /in /n" & "\\printserver\printername" & " /q"))

It will not connect to the domain, and therefor will not install printer.

 

Posted (edited)

I have tried:

runas("administrator","domain","******",0,runwait("rundll32 printui.dll,PrintUIEntry /in /n" & "\\printserver\printername" & " /q"))
runas("administrator","domain","******",1,runwait("rundll32 printui.dll,PrintUIEntry /in /n" & "\\printserver\printername" & " /q"))
runas("administrator","domain","******",2,runwait("rundll32 printui.dll,PrintUIEntry /in /n" & "\\printserver\printername" & " /q"))

EDIT1:
0 - Interactive logon with no profile.
1 - Interactive logon with profile.
2 - Network credentials only.

EDIT2:

Yes, the secondary logon service is running, if i add the printer manually as the user i define in the code, it works.. but not with this code...

Edited by lansti

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
×
×
  • Create New...