lansti Posted December 11, 2013 Share Posted December 11, 2013 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. Link to comment Share on other sites More sharing options...
gruntydatsun Posted December 11, 2013 Share Posted December 11, 2013 (edited) is the 4th argument right? also do you have the Secondary Logon service running? Edited December 11, 2013 by gruntydatsun Link to comment Share on other sites More sharing options...
lansti Posted December 11, 2013 Author Share Posted December 11, 2013 (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 December 11, 2013 by lansti Link to comment Share on other sites More sharing options...
gruntydatsun Posted December 11, 2013 Share Posted December 11, 2013 Does this help? http://stackoverflow.com/questions/4703635/rundll32-exe-equivalent-for-64-bit-dlls Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now