Most printers only visible when impersonated user logged in

R

Rik Hemsley

Hi,

Our web application impersonates a domain user when it runs. Usually,
the printers visible to the application are the same as those visible to
the domain user.

At one installation, the list of printers is reduced to only the
'document image writer' - unless the impersonated user is logged on to
the machine, in which case the full list is visible.

We can't leave the impersonated user logged on to the terminal
permanently, of course!

We have tried adding a new printer to the machine while logged in as the
impersonated user, but this, too, is not visible.

It has been suggested that a domain policy could be to blame, but it's
difficult to guess which one might be the culprit - especially as this
isn't our network.

Any ideas what we should look for, or how we might be able to get more
information as to why the list is restricted?

Thanks,
Rik
 
P

Patrice

It looks like a user profile issue (the profile is loaded if the user is
logged, making the printers available).

I'm not sure what is the best option :
- on other servers it looks like the profile is loaded (because the account
have the appropriate permission, ie. log on locally, don't logon as a
service ? try to spot the difference)
- another option I see would be to add printers to the default user profile
- you could also not depend on this and add what you need programmatically ?

Hopefully someone else will provide better help (you may want to try a
Windows administration group)...

Hope it helps

- --
Patrice
 
D

Damien

Patrice said:
It looks like a user profile issue (the profile is loaded if the user is
logged, making the printers available).

I'd agree. I got a sense of deja-vu reading this question. Looking back
through Google Groups, I found my answer from October 2005:

--Start copy and Paste
I suspect this is related to the fact that when you impersonate a user,

their profile isn't loaded. Some (all?) printers are associated with
users rather than the machine. If you need the full profile available,
welcome to a whole world of P/Invoke.

For starters, check whether a call to LoadUserProfile() helps you?
--End copy and paste

Unfortunately, the person with the problem then didn't bother to post
back any success or otherwise, so I don't know if it's the right
advice.

Damien
 
R

Rik Hemsley

Patrice said:
It looks like a user profile issue (the profile is loaded if the user is
logged, making the printers available).

I'm not sure what is the best option :
- on other servers it looks like the profile is loaded (because the account
have the appropriate permission, ie. log on locally, don't logon as a
service ? try to spot the difference)

Will do.
- another option I see would be to add printers to the default user profile
- you could also not depend on this and add what you need programmatically ?

I didn't know either of these were possible, so I'll try both.
Hopefully someone else will provide better help (you may want to try a
Windows administration group)...

Thanks for the advice. Will let you know how it goes.

Rik
 
R

Rik Hemsley

Damien said:
their profile isn't loaded. Some (all?) printers are associated with
users rather than the machine. If you need the full profile available,
welcome to a whole world of P/Invoke.

This implies it's possible to load the profile - if I get stuck with
Patrice's suggestion I'll have a go at this, too.

Cheers,
Rik
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,832
Latest member
GlennSmall

Latest Threads

Top