aslandk
asked on
copy default printer from remote machine
Hello Experts
I am haven trouble finding a way to copy a default printer from one machine to another. When a user log on to the machine the default printer from a remote machine should be added and set to default printer on the users machine.
Can somebody help me?
I am haven trouble finding a way to copy a default printer from one machine to another. When a user log on to the machine the default printer from a remote machine should be added and set to default printer on the users machine.
Can somebody help me?
ASKER
hehe i know the quaetion is a bit confusion....
The user logges on to citrix and need the deafault printer to be mapped to the profile on the citirx server....it is roaming profile.
Is that more clear?:)
The user logges on to citrix and need the deafault printer to be mapped to the profile on the citirx server....it is roaming profile.
Is that more clear?:)
ASKER
isent it possible to use the add printer function:
Set WshNetwork = CreateObject("WScript.Netw ork")
WshNetwork.AddWindowsPrint erConnecti on "\\PrintServer1\Xerox300"
WshNetwork.SetDefaultPrint er "\\PrintServer1\Xerox300"
but make the printername variable to fit the default printer on the local machine?
Set WshNetwork = CreateObject("WScript.Netw
WshNetwork.AddWindowsPrint
WshNetwork.SetDefaultPrint
but make the printername variable to fit the default printer on the local machine?
Oic - what you want to do is pick up the default printer of the client where the user is connecting to citrix from and then set that default printer on the Citrix / Terminal Server box?
Interesting, one of our products manages profiles and printers in a Citrix environment - but I am not going to discuss that here - ee ethics and all ;)
What I am going to say is if this is what you want to do then we have done exactly this for one of our clients as a freeware solution (sort of a teaser for the main product if you will). If you are interested let me know and I will post a link.
Interesting, one of our products manages profiles and printers in a Citrix environment - but I am not going to discuss that here - ee ethics and all ;)
What I am going to say is if this is what you want to do then we have done exactly this for one of our clients as a freeware solution (sort of a teaser for the main product if you will). If you are interested let me know and I will post a link.
ASKER
of course i am interested...waiting for more info form you:):)
Ok,
Here is the URL
http://www.managedprofile.com/downloads/mpdefprn.zip
The file contains a working executable that will set the default printer on the TS to the value set on the client. The file also contains the C/C++ source for doing this should you wish to modify it.
HTH
Here is the URL
http://www.managedprofile.com/downloads/mpdefprn.zip
The file contains a working executable that will set the default printer on the TS to the value set on the client. The file also contains the C/C++ source for doing this should you wish to modify it.
HTH
ASKER
i have downloade the code...but there is not any "readme.txt" or installation/user guide.
Do you have a guide i can use?
Do you have a guide i can use?
Oops - my apologies - very simple utility - just run it in the user Citrix / Terminal server session. It does not require installation or command line parameters - just need to run it.
The source code should be included so you can take a look at what it is doing - if you have problems with the C++ let me know I will see what I can do about posting a VB version.
Julian
The source code should be included so you can take a look at what it is doing - if you have problems with the C++ let me know I will see what I can do about posting a VB version.
Julian
ASKER
if you have the code in vb i would prefere it...it looks very interesing:)
Don't have it yet - but let me see what I can do.
ASKER
perfect:):)
Done,
That was not a lot of fun - quite frankly I prefer the C/C++ implementation - a lot simplier.
Anyway here it is
http://www.managedprofile.com/downloads/mpdefprnVB.zip
The archive contains a VB version of the mpdefprn.exe and the source code to create it.
As with the C/C++ version it is a command line utility you run in the TS session you want to set the default printer for.
Let me know how you get along.
Julian
That was not a lot of fun - quite frankly I prefer the C/C++ implementation - a lot simplier.
Anyway here it is
http://www.managedprofile.com/downloads/mpdefprnVB.zip
The archive contains a VB version of the mpdefprn.exe and the source code to create it.
As with the C/C++ version it is a command line utility you run in the TS session you want to set the default printer for.
Let me know how you get along.
Julian
ASKER
thanks...going home from work now....will look at it tomorrow....do the user need to run it everytime the user is logging on to citrix?
Yes, probably - it depends how your profiles are set-up but I would recommend you run it at login (login script or startup director or Run key) or give the user an icon to run it. Remember this is a simple utility to demonstrate the functionality - if you want something a little more fancy you will need to modify it to suite your needs.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Unless the user that you want to copy from is logged into the remote machine you are not going to find what you are looking for on that machine. You will find the default printer information in the user registry. But this could get tricky because you first have to figure out if the user is using local or roaming profiles and then figure out where their profile is stored before opening it and browsing to
<profile>\Software\Microso
Once you have the printer name the rest is easy: Use the SetDefaultPrinter API call and bingo.