Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unique printer question 1

Status
Not open for further replies.

agrappe

IS-IT--Management
Apr 2, 2003
88
US
I need the default printer through Citrix to be set by workstation. I have 184 networked printers connected to a central print server(non-Citrix) and we are phasing in quasi-thin clients(mini PCs with stripped-down WinXP) to replace our 900 PC workstations. My users move from room to room and need to be able to print in the room they are in without sorting through a list of 184 printers to find their room number. We have considered setting up the printer on the thin clients, but this would defeat our purpose of having identical equipment for ease of replacement. I have been looking for several weeks and have yet to find a solution to this problem.

I would greatly appreciate any advice anyone could provide.
 
Do you have the printer installed as default on the client workstation? If so, upon logon to terminal services or citrix, the printer should auto client create and set itself as default if you have the correct options set.

If you do not want to install the printer and set it as default on the workstation, there are other options that will require more work. Just let us know which route you choose and we can guide you.
 
I am trying not to modify the clients so that they can be replaced without customization. I have several campuses and want to be able to just drop one off if the current one breaks.
 
This can be done, but with lots of work and troubleshooting (I'm no programming expert, sawwy).

I need to know if this solution is ok with you:

You would assign a script to any and all users of these PCs in question.

When the user logs onto that PC, the script will look to see if this PC is on your list of PC that will need a default printer mapped.

If it is, it will map the appropriate printer and set it as default - right on the PC. Then, when the user logs into Citrix, the printer will auto - client create.

Now, keep in mind, even if the user does NOT log onto Citrix, if the computer he/she is at is on the list of computer names in our script, the user will still be mapped to a default printer according to the script.

Is this a problem??
 
This is exactly what I'm trying to get. I have created a login script (we use Kixtart)that connects the printers that are in the same subnet as the user. The only problem is the script is grabbing the Nfuse server's IP address instead of the client machine's. Does anyone know of a macro or variable(hope i'm using the right terms, i'm not a progammer either) that points to the workstation's IP address instead of the Nfuse server's?
 
If you wouldn't mind doing this by printer name, here's a script that might help you, but don't forget to save the file as type .vbs (example: script.vbs):

Option Explicit
Dim oNetwork, sPrintPath, pcname, objSysInfo, comPos

Set objSysInfo = CreateObject("ADSystemInfo")
pcname=objSysInfo.ComputerName

'find position of the comma in the computername string
comPos = InStr(pcname, ",")

'trim leading chars and ending chars of the returned computername for use in script
pcname = Mid(pcname,4,comPos-4)

'Decide whether to run script by evaluating the computername
If pcname = "JAMORIM" Then

Set oNetwork = CreateObject("WScript.Network")
sPrintPath = "\\osfs\omni_laser"
oNetwork.AddWindowsPrinterConnection sPrintPath
oNetwork.SetDefaultPrinter sPrintPath
Set oNetwork = NOTHING
Set sPrintPath = NOTHING

ElseIf pcname = "DEV" Then

Set oNetwork = CreateObject("WScript.Network")
sPrintPath = "\\osfs\omni_laser"
oNetwork.AddWindowsPrinterConnection sPrintPath
oNetwork.SetDefaultPrinter sPrintPath
Set oNetwork = NOTHING
Set sPrintPath = NOTHING

Else

End If


One more note: the last portion that says Else...., you can replace that with an alternate printer mapping if the pc name is not found or leave it blank. You can copy and paste as many elseifs as you like. Keep in mind this script is for win2k. I know we can make a batch file like this that would run on any windows machine, but I don't know enough about it to write a script.

 
Thanks, but our thin client machines are autonamed which prevents me from using PC names. My only choice is it's IP subnet address.

This is how my KIXscript is set up. It connects the 6 to 8 printers that are in each worstation's subnet. It works beautifully when used as a straight login script for XP, but the @IPADDRESS0 returns the IP address of the Nfuse server instead of the thin client when accessed from the browser.


$address=@IPADDRESS0
;Assign the third octet of IP address to $subnet
$subnet=SubStr($address,9,3)

Select
;Connect the printers in the workstations subnet
Case $subnet="101"
AddPrinterConnection("\\ServerName\PrintShare1")
AddPrinterConnection("\\ServerName\PrintShare2")
AddPrinterConnection("\\ServerName\PrintShare3")
AddPrinterConnection("\\ServerName\PrintShare4")
Case $subnet="102"
AddPrinterConnection("\\ServerName\PrintShare5")
AddPrinterConnection("\\ServerName\PrintShare6")
AddPrinterConnection("\\ServerName\PrintShare7")
AddPrinterConnection("\\ServerName\PrintShare8")
AddPrinterConnection("\\ServerName\PrintShare9")
Case $subnet="104"
AddPrinterConnection("\\ServerName\PrintShare10")
AddPrinterConnection("\\ServerName\PrintShare11")
AddPrinterConnection("\\ServerName\PrintShare12")
AddPrinterConnection("\\ServerName\PrintShare13")
AddPrinterConnection("\\ServerName\PrintShare14")
AddPrinterConnection("\\ServerName\PrintShare15")
**********************************************************
Shortened for forum purposes
**********************************************************

Case 1

EndSelect

If Citrix had a macro that KIX would recognize, I could substitute it for the @IPADDRESS0. I'm not sure where to look for this. Any ideas?
 
agrappe,

we use the utilitie clientnfo.exe downloadable from...

The information from this is piped to an ini file in the users's temp directory in the format


[WFClientNFO]
WFClientName=USERS_P_CNAME
WFClientAddress=xx.xx.xx.xx
WFApplicationName=#Published_App_Name


from this information we can get the user Subnet
Then find the printers available in that area from a list of an ini file which has all the printers available in that particular subnet


[Subnet1]
\\Server1\PrinterA
\\Server2\PrinterB

[Subnet2]
\\Server1\PrinterD
\\Server2\PrinterE


If your prefered scripting language is KIX I would stick with that but I have this done in a VBScript which I will post here if I get the chance, I will need to strip it from the logon script that I have written

We use this for several Subnets, 58 at last count, with success

Hope this helps in some way
Brian


B-)
 
Sounds interesting. I'll check it out. Thanks!
 
It worked! Thanks a million!

Here's what I ended up with if anyone wants to see the final solution.


*********************************
Batch file that runs kix32
*********************************
if "%OS%"=="Windows_NT" goto :WNT
if not "%OS%"=="Windows_NT goto :W9x

:WNT
echo Copying Required files local...
if not exist %windir%\ifmember.exe copy ifmember.exe %windir%\*.*
if not exist %windir%\kix32.exe copy kix32.exe %windir%\*.*

Clientnfo.exe > %temp%\clntnfo.tmp
"%windir%\kix32.exe" "scriptfile.kix"

*********************************
Kix script
*********************************
$file="%temp%\clntnfo.tmp"
$address=ReadProfileString($file,"WFClientNFO","WFClientAddress")
$subnet=SubStr($address,9,3)
Select
Case $subnet="101"
AddPrinterConnection("\\PrintServer\PrintShare")
AddPrinterConnection("\\PrintServer\PrintShare")
AddPrinterConnection("\\PrintServer\PrintShare")
AddPrinterConnection("\\PrintServer\PrintShare")

Case $subnet="102"
AddPrinterConnection("\\PrintServer\PrintShare")
AddPrinterConnection("\\PrintServer\PrintShare")
AddPrinterConnection("\\PrintServer\PrintShare")
AddPrinterConnection("\\PrintServer\PrintShare")
AddPrinterConnection("\\PrintServer\PrintShare")


Case 1
 
One tip though....

Put something in your kix script that deletes the printers that user has mapped already then delete them.

Coz if you have like we have users moving round multiple sites having a long list of printers mapped they get more confused than having to map the printers themelves.

I don't know how to do this in KIX but I found this for you on another site, This should help you along your way in KIX

Then delete the printers that they have mapped then map the new ones using the script you have created above,

Anyway as time goes by way you should find out what is better for your situation,

Again hope this helps,
Brian






B-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top