how come i can't print to a network printer from inside my activex dll? i
load this dll in an asp page. the dll just loads a page into a webbrowser
control and then trys to print it. i can call my dll from a normal vb app
and it works fine. my guess is that when IIS loads the dll it is running as
SYSTEM. thats why i tried to use the Impersonate user code as well. i guess
system can't access my network resources like my printers. any one have any
ideas?

'here is my dll code:

Public Function SendPrintJob() As String
On Error GoTo ErrorSub

' navigate to a Web site for testing purposes.
frmPrintOrder.WebBrowser1.Navigate ("http://www.google.com")


Do While (frmPrintOrder.WebBrowser1.QueryStatusWB(OLECMDID_PRINT) And
OLECMDF_ENABLED) = 0
DoEvents
Loop

' print the contents of the Web Browser control.
Call frmPrintOrder.WebBrowser1.ExecWB(OLECMDID_PRINT,
OLECMDEXECOPT_DONTPROMPTUSER, 0, 0)

SendPrintJob = "NoErrors"
Exit Function

ErrorSub:
SendPrintJob = "Error #: " & Err.Number & " Desc: " & Err.Description

End Function
<%
'here is my asp code:
Option Explicit
Dim objLogon
dim objPrintOrder
Set objLogon = Server.CreateObject("LoginAdmin.ImpersonateUser")
objLogon.Logon "user", "password", "domain"
set objPrintOrder = server.CreateObject("jdpPrintOrder.clsPrintOrder")
Response.write objPrintOrder.SendPrintJob
set objPrintOrder = nothing
objLogon.Logoff
Set objLogon = Nothing
%>
--
5khzgjf9e001@sneakemail.com

Re: iis user security problem i think. by Tom

Tom
Wed Mar 03 13:37:21 CST 2004

"James" <See.My.Sig@The.Bottom.com> wrote in message
news:LTp1c.6866$Hg4.2130@chiapp18.algx.net...
> how come i can't print to a network printer from inside my activex dll?

Because of http://support.microsoft.com/?kbid=184291.

--
Tom Kaminski IIS MVP
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
http://mvp.support.microsoft.com/
http://www.microsoft.com/windowsserver2003/community/centers/iis/




Re: iis user security problem i think. by James

James
Wed Mar 03 15:38:37 CST 2004

yeah i did that before and it still doesn't work. i can enumerate thru my
printers collection and see a list of all installed printers. when i shell
out and run Notepad.exe it shows up in the task manager under the user:
IWAM_MACHINENAME as calling the notepad.exe. so IWAM_MACHINENAME. i have
added this user to my admins group and it still can't print. any ideas?




"Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
news:c25bnk$rld20@kcweb01.netnews.att.com...
> "James" <See.My.Sig@The.Bottom.com> wrote in message
> news:LTp1c.6866$Hg4.2130@chiapp18.algx.net...
> > how come i can't print to a network printer from inside my activex dll?
>
> Because of http://support.microsoft.com/?kbid=184291.
>
> --
> Tom Kaminski IIS MVP
> http://www.iistoolshed.com/ - tools, scripts, and utilities for running
IIS
> http://mvp.support.microsoft.com/
> http://www.microsoft.com/windowsserver2003/community/centers/iis/
>
>
>



Re: iis user security problem i think. by James

James
Wed Mar 03 16:17:06 CST 2004

i also can't do a simple thing like DIR(\\secondmachine\sharename)
its like that IWAM_MACHINENAME won't connect to a network resource even tho
i explicity give it permision.


"James" <See.My.Sig@The.Bottom.com> wrote in message
news:xfs1c.6917$Hg4.299@chiapp18.algx.net...
> yeah i did that before and it still doesn't work. i can enumerate thru my
> printers collection and see a list of all installed printers. when i shell
> out and run Notepad.exe it shows up in the task manager under the user:
> IWAM_MACHINENAME as calling the notepad.exe. so IWAM_MACHINENAME. i have
> added this user to my admins group and it still can't print. any ideas?
>
>
>
>
> "Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
> news:c25bnk$rld20@kcweb01.netnews.att.com...
> > "James" <See.My.Sig@The.Bottom.com> wrote in message
> > news:LTp1c.6866$Hg4.2130@chiapp18.algx.net...
> > > how come i can't print to a network printer from inside my activex
dll?
> >
> > Because of http://support.microsoft.com/?kbid=184291.
> >
> > --
> > Tom Kaminski IIS MVP
> > http://www.iistoolshed.com/ - tools, scripts, and utilities for running
> IIS
> > http://mvp.support.microsoft.com/
> > http://www.microsoft.com/windowsserver2003/community/centers/iis/
> >
> >
> >
>
>



Re: iis user security problem i think. by Tom

Tom
Thu Mar 04 07:26:47 CST 2004

"James" <See.My.Sig@The.Bottom.com> wrote in message
news:xfs1c.6917$Hg4.299@chiapp18.algx.net...
> yeah i did that before and it still doesn't work. i can enumerate thru my
> printers collection and see a list of all installed printers. when i shell
> out and run Notepad.exe it shows up in the task manager under the user:
> IWAM_MACHINENAME as calling the notepad.exe. so IWAM_MACHINENAME. i have
> added this user to my admins group and it still can't print. any ideas?

IWAM is a local account - is it being denied permission to the network
printer?

--
Tom Kaminski IIS MVP
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
http://mvp.support.microsoft.com/
http://www.microsoft.com/windowsserver2003/community/centers/iis/




Re: iis user security problem i think. by Tom

Tom
Thu Mar 04 07:27:37 CST 2004

"James" <See.My.Sig@The.Bottom.com> wrote in message
news:CPs1c.6928$Hg4.6075@chiapp18.algx.net...
> i also can't do a simple thing like DIR(\\secondmachine\sharename)
> its like that IWAM_MACHINENAME won't connect to a network resource even
tho
> i explicity give it permision.

Since it's a local account, how are you giving it permission?

--
Tom Kaminski IIS MVP
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
http://mvp.support.microsoft.com/
http://www.microsoft.com/windowsserver2003/community/centers/iis/




Re: iis user security problem i think. by James

James
Thu Mar 04 11:51:36 CST 2004

i was just adding it to the security tab on the printer driver.


"Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
news:c27acr$rld25@kcweb01.netnews.att.com...
> "James" <See.My.Sig@The.Bottom.com> wrote in message
> news:xfs1c.6917$Hg4.299@chiapp18.algx.net...
> > yeah i did that before and it still doesn't work. i can enumerate thru
my
> > printers collection and see a list of all installed printers. when i
shell
> > out and run Notepad.exe it shows up in the task manager under the user:
> > IWAM_MACHINENAME as calling the notepad.exe. so IWAM_MACHINENAME. i have
> > added this user to my admins group and it still can't print. any ideas?
>
> IWAM is a local account - is it being denied permission to the network
> printer?
>
> --
> Tom Kaminski IIS MVP
> http://www.iistoolshed.com/ - tools, scripts, and utilities for running
IIS
> http://mvp.support.microsoft.com/
> http://www.microsoft.com/windowsserver2003/community/centers/iis/
>
>
>



Re: iis user security problem i think. by James

James
Thu Mar 04 15:38:19 CST 2004

is there a way to tell iis to use a differnt use than IWAM?


"James" <See.My.Sig@The.Bottom.com> wrote in message
news:I0K1c.7182$Hg4.2173@chiapp18.algx.net...
> i was just adding it to the security tab on the printer driver.
>
>
> "Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
> news:c27acr$rld25@kcweb01.netnews.att.com...
> > "James" <See.My.Sig@The.Bottom.com> wrote in message
> > news:xfs1c.6917$Hg4.299@chiapp18.algx.net...
> > > yeah i did that before and it still doesn't work. i can enumerate thru
> my
> > > printers collection and see a list of all installed printers. when i
> shell
> > > out and run Notepad.exe it shows up in the task manager under the
user:
> > > IWAM_MACHINENAME as calling the notepad.exe. so IWAM_MACHINENAME. i
have
> > > added this user to my admins group and it still can't print. any
ideas?
> >
> > IWAM is a local account - is it being denied permission to the network
> > printer?
> >
> > --
> > Tom Kaminski IIS MVP
> > http://www.iistoolshed.com/ - tools, scripts, and utilities for running
> IIS
> > http://mvp.support.microsoft.com/
> > http://www.microsoft.com/windowsserver2003/community/centers/iis/
> >
> >
> >
>
>



Re: iis user security problem i think. by Tom

Tom
Fri Mar 05 07:03:33 CST 2004

"James" <See.My.Sig@The.Bottom.com> wrote in message
news:flN1c.7255$Hg4.5158@chiapp18.algx.net...
> is there a way to tell iis to use a differnt use than IWAM?

A better way would be to register your DLL in COM+ and set its identity to
whatever is appropriate.

--
Tom Kaminski IIS MVP
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
http://mvp.support.microsoft.com/
http://www.microsoft.com/windowsserver2003/community/centers/iis/




Re: iis user security problem i think. by James

James
Fri Mar 05 15:42:56 CST 2004

how do i do that off hand? i tried use regsrv32 but that just makes it
avalable. i have read about com+ servers. do i have to make one or can i
load my dll with a inhernt windows one.



"Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
news:c29td3$rld35@kcweb01.netnews.att.com...
> "James" <See.My.Sig@The.Bottom.com> wrote in message
> news:flN1c.7255$Hg4.5158@chiapp18.algx.net...
> > is there a way to tell iis to use a differnt use than IWAM?
>
> A better way would be to register your DLL in COM+ and set its identity to
> whatever is appropriate.
>
> --
> Tom Kaminski IIS MVP
> http://www.iistoolshed.com/ - tools, scripts, and utilities for running
IIS
> http://mvp.support.microsoft.com/
> http://www.microsoft.com/windowsserver2003/community/centers/iis/
>
>
>



Re: iis user security problem i think. by Tom

Tom
Fri Mar 05 15:46:05 CST 2004

"James" <See.My.Sig@The.Bottom.com> wrote in message
news:Av62c.7602$Hg4.2227@chiapp18.algx.net...
> how do i do that off hand? i tried use regsrv32 but that just makes it
> avalable. i have read about com+ servers. do i have to make one or can i
> load my dll with a inhernt windows one.

Sorry, what I meant was component services.

--
Tom Kaminski IIS MVP
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
http://mvp.support.microsoft.com/
http://www.microsoft.com/windowsserver2003/community/centers/iis/