Labels
Printer Driver not installed / Mapping not done properly
Printer Driver Mapping
1. Install the Driver on one Server.
2. After adding a driver on a server we must do this:
Open the Citrix Management Console, right-click the Printer Management icon and select the Update printer and Driver information option. Now it lists drivers we manually install individually on any server.
3. Update Printer and Driver Information by right clicking on Printer Management in the console as well as Refresh Printer Management. (The “Refresh Drivers” option does not produce the intended results. We have to do that after replicating printer drivers to other servers. Sometimes it appears in the list and sometimes it doesn't until I force it too.)
Just in case if you want to know more then find it below
Being around Citrix for a while, one of the things that you’ll notice and continues to hold true is that printing is still one of the biggest challenges. With each release, Citrix touts that printing is better. However, reality sets in and you soon find out that you’re in the same boat again and you’re forced back to old school printing configurations.
Don’t be mistaken, the EMF printing model of Citrix Presentation Server 4 is a good move. It has given back your server’s horsepower from the days of when a single logon or print job would spike your processors, or even worse, clog the user’s virtual channel. Most of the problems occur when administrators expect that printing will work out-of-the-box and are unfamiliar with how to properly set it up. Further, many of the helpful printing sites seemed to have ventured off topic, adding additional content and making it difficult to find a clear, concise, guided approach in how to set up printing.
Once again, if you’ve been around Citrix for a while, you should know these best practices and how to set up printing, but a re-fresher never hurts. This guide is mainly written for the new Citrix administrator either setting up an environment or even trying to fix an existing one. Although you can debate some these recommendations, they have been successfully deployed in environments with 50,000 named users.
Before you start the journey of setting up Citrix printing, you need to know what makes up the system and how they work together.
Printing Components
Basically, there are six main areas or components that you need to be concerned about. These are:
- Server Side Printers, which includes print drivers that are installed on the Citrix server.
- Client Side Printers are printers that are both locally attached and network attached that are defined on each client workstation.
- Management Console Settings are configurations that are made in the Presentation Server Java Console. These include Citrix policies and driver mappings.
- Wtsprnt.inf is a text file that resides on each Citrix Presentation Server that contains the re-mapped printers for the farm.
- Wtsuprn.inf is a legacy text file equivalent of the wtsprnt.inf file. This may still exist if the servers have been upgraded from previous Citrix releases. Unlike the wtsprnt.inf, this file can vary from server to server.
- NTPrint.inf is a configuration file that has information about all drivers that shipped with the server operating system that can be loaded.
Printer Auto-Creation
Now that you’re a little more familiar with the components, it’s time to look at how they interact with each other. When a client first connects, Citrix initiates a sequence to auto create the necessary server side printers. For it to be successful, these printers need to correspond with the client side ones and the printer driver name on the client must match (exactly) a printer that is defined in either the registry or one of the .inf files. It parses these files, listed below (in order):
- wtsuprn.inf (if it exists)
- wtsprnt.inf
- The registry
- ntprint.inf
If a match is found, it bails out of the sequence. There are several other sub-steps, but they’re really not that important, nor is it necessary that you know them. It should also be noted that:
- The process is done for each printer defined on the client.
- For the most part, locally attached client printers auto-create faster than the network ones.
- The first printer that connects, even though it may not be defined as the user’s default, becomes the temporary default in the session until the actual default is mapped.
Best Practices
Seeing the components and the process Citrix uses to connect printers, it’s still a challenge to have consistent and reliable printing. Yes, EMF performance enhancements have been great, but it’s consistency, or lack there of, that generates the most support calls (which, without a doubt, is the bane of the Citrix admin’s existence). It’s usually easier in a controlled environment, however, in an environment where a strict printing standard can’t be adopted, it’s a nightmare. Properly setting up your environment is a must and regardless of how it’s done, it needs to include the following:
- Avoid loading third-party print drivers--especially drivers that are not specifically documented to be compatible with terminal services. This has, was, and still is the number one cardinal rule. Back in the NT 4.0 TSE days, third-party drivers accounted for most of the BSoDs. These days, the “good” news is that it may only cause your spooler to tank out.
- Remove all version-2 drivers. These types of drivers run in kernel mode and cause serious issues with the servers. Stick with Version-3 drivers which operate in "user mode."
- Use native Windows 2000 or Windows 2003 OS drivers for all printers, even if some functionality is lost. This includes using them over the Universal Print Driver.
- If additional functionality is really needed, map the client driver to another Windows 2000 or Windows 2003 OS driver that offers similar functionality. This isn’t always possible, but most users are satisfied with just being able to print and don’t mind killing an extra tree or two because duplex printing isn’t available.
- Disable the loading of drivers on demand and/or importation of drivers from the client. This is important in keeping your environment clean and free of third-party drivers or other unwanted drivers.
- Keep the combination of drivers and/or re-mapped drivers to minimum. The more places to parse during printer auto-creation, the longer the logon may take.
- Ensure users have write access to %systemroot%\system32\spool on the server. Problems usually occur with overzealous, Sarbanes-Oxley compliant lock-down admins applying security settings.
- If possible, print directly to the printer or print server and not through the virtual channel. Sorry, Citrix is meant to be thin--why clog the pipe with a print job if you don’t have to?
- Old print jobs in the spooler should be cleaned up periodically. This should be done through a common maintenance script.
- Do not load Hotfixes because they are available. Ensure it fixes something that is actually broke. Basically, if it ain’t broke, don’t fix it.
Step by Step
Using all of this information, it’s time to put it to together and build a solution around it. Working under the assumption that you’re setting up a new environment and a have clean slate. Start by:
- Setting up your policy
- Installing your drivers
- Re-mapping your printers
Create Your Farm Print Policy
Your farm’s print policies will vary in your particular environment and will always be dictated through the needs of your user base. The following settings seem to be the sweet spot for most farms that have users coming in from the Internet on untrusted clients. It uses native drivers over the UPD, and is applied to all servers as a default.
| Printing | Setting | Configuration |
| Client Printers/Auto-creation | Enabled | Auto-create all client printers |
| Client Printers/Legacy client printers | Enabled | Create old-style client printers |
| Client Printers/Printer properties retention | Enabled | Held in profile only if not saved on client |
| Client Printers/Print job routing | Enabled | Always connect indirectly as a client printer |
| Client Printers/Turn off client printer mapping | Not Configured | |
| Drivers/Native printer driver auto-install | Enabled | Do not automatically install drivers |
| Drivers/Universal driver | Enabled | Use universal driver only if requested driver is unavailable |
Drivers
Remarkably, you can run your entire farm with less than 25 drivers and all third-party drivers can and should be removed. These drivers ship with the operating system and serve as a good base for any environment.
- Canon Bubble-Jet BJC-210
- Canon Bubble-Jet BJC-4000
- Generic / Text Only
- Epson Stylus COLOR ESC/P 2
- HP Color LaserJet
- HP Color LaserJet 4500
- HP DeskJet
- HP DeskJet 550C
- HP DeskJet 850C
- HP DeskJet 855C
- HP LaserJet
- HP LaserJet Series II
- HP LaserJet 1100 (MS)
- HP LaserJet 2100
- HP LaserJet 4
- HP LaserJet 5
- HP LaserJet 6P
- HP LaserJet 4000 Series PCL
- HP LaserJet 8100 Series PCL
- HP OfficeJet
- Lexmark Optra
- Lexmark 1020 Color Jetprinter
The easiest way to load these is to simply walk through the “Add a printer” wizard one-by-one. You can get creative and write a script however you only need to do this once because they can be replicated. The drivers can also be integrated into your Citrix base build.
So that additional drivers don’t accidentally get installed, it’s also a best practice that you rename %systemroot%\inf\ntprint.inf to ntprint.old.
Replicating Drivers
Using Citrix’s print driver replication feature, the drivers can be loaded on one of your servers and then replicated to all of the servers in the farm. In larger Citrix Farms, replicating drivers can cause performance issues, so you may want to create a print package that can be redistributed.
Creating a package is a simple process:
- Start with a clean, freshly installed server
- Copy the directories and files from %systemroot%\system32\spool\drivers
- Export HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows NT x86\Drivers\Version-3
- Write a wrapper script similar to:
REM Backup Files and Registry
@IF NOT EXIST MD c:\temp\printback
@XCOPY /E /H /Y %systemroot%\system32\spool\drivers c:\temp\printback\
@REG EXPORT "HKLM\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows NT x86\Drivers\Version-3" c:\temp\printback\printers.reg
REM Removing Print Drivers
@REG DELETE "HKLM\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows NT x86\Drivers\Version-3" /F
@RD /S /Q %systemroot%\system32\spool\drivers\color
@RD /S /Q %systemroot%\system32\spool\drivers\w32x86
REM Installing New Print Drivers
@XCOPY /E /H /Y color %systemroot%\system32\spool\drivers\color
@XCOPY /E /H /Y w32x86 %systemroot%\system32\spool\drivers\w32x86
@REG IMPORT PrintDrivers.reg
REM Restore
REM @XCOPY /E /H /Y c:\temp\printback\color %systemroot%\system32\spool\drivers\color
REM @XCOPY /E /H /Y c:\temp\printback\w32x86 %systemroot%\system32\spool\drivers\w32x86
REM @REG IMPORT c:\temp\printback\printers.reg
@NET START SPOOLER
- Bundle it all together as a self executing zip file. InstallShield Packager for the Web (if you can still find it) is a great utility for this type of work.
Re-Mapped Drivers
Now that you have a good driver base, it’s time to re-map to them. You can do this a couple of different ways. Downloading and importing somebody else’s remapping file isn’t necessarily the best since your environment is more than likely unique. You’re bound to get a number of unnecessary re-mappings, thus violating best practice #6. Under that premise, the easiest approach is to use Doug Brown’s Advanced Print Manger (APM) from http://www.dabcc.com/apm . If you get the answer “it’s not in the budget,” then the re-mappings will have to be done manually using two different processes:
Manual Process #1
- Filter the event view for printer failures – 1106 and 1007 messages
- Parse through it and just grab the printer name.
- Look up the printer at www.printingsupport.com and find a comparable driver
- Create a text/inf file and manipulate so it resembles a wtsprnt.inf.
- Import using qprinter /IMPRMAPPING C:\MyMappings.INF
Manual Process #2
- Dump the event view for printer failures – 1106 and 1007 messages
- Look up the printer at www.printingsupport.com and find a comparable driver
- Re-map them one-by-one in the CMC.
Six out of Seven Citrix Admins agree: stick with APM. It’s easier to use and you’ll be done in half the time. It polls the event logs for failed mappings and displays them in a consolidated, readable format along with a suggested re-mapping.
If a recommendation isn’t available, the following table can be used as a simple guide or starting point for re-mappings. Of course you’ll need to test them to ensure they work. Further, since support is being added for a printer that is currently unavailable to the user, adding these mappings during production hours is a minimal risk.
| Printer Type | Remaps to |
| Default | HP LaserJet |
| Amyuni | HP LaserJet 5 |
| Brother | HP LaserJet 4 |
| Canon Bubble-Jets | Canon Bubble-Jet BJC-210 |
| Epson | HP LaserJet 4 |
| Epson Stylus | Epson Stylus COLOR ESC/P 2 |
| HP DeskJet Series | HP DeskJet |
| HP LaserJet Series | HP LaserJet |
| HP LaserJet 1000 series | HP LaserJet 1100 (MS) |
| HP LaserJet 2000 series | HP LaserJet 2100 |
| HP LaserJet PCL Series | HP LaserJet 4000 Series PCL |
| HP OfficeJet Series | HP OfficeJet |
| Lanier | HP LaserJet 4000 Series PCL |
| Konica | HP LaserJet 4 |
| Lexmark Default | HP LaserJet 4 |
| Lexmark Jetprinter series | Lexmark 1020 Color Jetprinter |
| Lexmark T Series | HP LaserJet 4 |
| Lexmark Z Series | UPD |
| Lexmark Optra Series | Lexmark Optra |
| Ricoh | HP LaserJet 4 |
| Color Printers | HP Color LaserJet |
| PDF Writers | HP LaserJet 5 |
| Fax Printers | Generic / Text Only |
References :-
1. SSL issues; Security issues with IE; Citrix Client not connecting
If it is Single User
- Citrix Client not installed
- IE not configured properly
- User does not have access to Citrix Site
If it is multiple users then
- SSL certificate expiry or Mis-configuration
- Root Certificate Validity
- SSL and Root Certificate Binding
- Firewall port issue (https:443 port)
- Secure gateway certificate issuing issue
you can Ask if you stuck somewhere to me by adding comments
Connect the SSP image like below or copy the SSP pakage on the Server
Click Apply
Run the Setup from the %drive%hp/swpakages/Setup.exe
Click on Start inventory
Build inventory from the location of %drive%hp/swpakages
Select local host for checking installation check list![]()
A similar screen will appear when you have software inventory
Uncheck the option listed below
Then click on install
Once after the installation – Reboot the server and monitor the reboot process from ILO
create a TXT file by Name Servers with the list of Servers you wanted to check. It will automatically created a Output
SCRIPT STARTS FROM BELOW
'==========================================================================
Option Explicit
On Error Resume Next
Dim strComputer, objWMIService, colOperatingSystems, objOS, intSystemUptime, Question
Question = ""
Do Until Question = vbNo
strComputer = InputBox("Please enter servername")
If strComputer <> "" Then
GetTime
Else
Question = MsgBox ("Please try again and enter a valid server name" & vbCrLf & "Try again?", vbYesNo)
If Question = vbNo Then
WScript.Quit
End If
End If
Loop
'===========================================================================
' Sub Procedures
'===========================================================================
Sub GetTime
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("Select * From Win32_PerfFormattedData_PerfOS_System")
For Each objOS in colOperatingSystems
intSystemUptime = SplitSec(objOS.SystemUpTime)
'intSystemUptime = Int(objOS.SystemUpTime / 60)
MsgBox "The server has been up for " & intSystemUptime
Question = vbNo
Next
End Sub
Function SplitSec(pNumSec)
Dim d, h, m, s
Dim h1, m1
d = int(pNumSec/86400)
h1 = pNumSec - (d * 86400)
h = int(h1/3600)
m1 = h1 - (h * 3600)
m = int(m1/60)
s = m1 - (m * 60)
SplitSec = cStr(d) & " Days, " & cStr(h) & " Hours, " & cStr(m) & " Minutes, " & cStr(s) & " Seconds."
End Function
Applies for 2003,2008
Few things to Note :
* this script query’s to registry (marked in Blue)of the patch so you need add the Registry key to which it need to query( you can get that details in the download site
*You need to Very particular about the location,Best Classification would be Like this
**location : D drive
**Patch Location : Better if you can save it with MS article number
ex : MS06-017
so the location classification can be \\Server\d$\Ms06-017 this can locate your patches easily
************************************************************************
set inst= Location
echo ***** Hotfix MS06-017 Vulnerability in Microsoft FrontPage Server Extensions Could Allow Cross-Site Scripting (917627) *****
REM ***** Date of added*****
%windir%\reg.exe query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows Server 2003\SP2\KB908981\File list"
IF ERRORLEVEL 1 GOTO INSTALLMS06-017
IF ERRORLEVEL 0 GOTO PASSMS06-017
:INSTALLMS06-017
echo Installing Hotfix MS06-017 Vulnerability in Microsoft FrontPage Server Extensions...
%inst%\MS06-017\WindowsServer2003-KB908981-x86-ENU.exe /passive /norestart /log:%inst%\MS06-017\
ECHO Install Complete.
goto ENDMS06-017
:PASSMS06-017
echo Hotfix MS06-017 Vulnerability in Microsoft FrontPage Server Extensions is already installed.
goto ENDMS06-017
:ENDMS06-017
echo.
REM ***** End of Hotfix MS06-017 Vulnerability in Microsoft FrontPage Server Extensions Could Allow Cross-Site Scripting (917627) *****
You can run below script in IIS for cleaning the logs
***************************************************************************
Dim fso, folder, file, filecollection, dir, days_in, days_dif, filesplit
'Dim WshShell
'Set WshShell = WScript.CreateObject("WScript.Shell")
'WScript.Echo WshShell.CurrentDirectory
If ((Wscript.Arguments.Count < 3) or (Wscript.Arguments.Count > 3)) then
Wscript.echo "Script requires 3 parameters"
Wscript.echo "cscript log_clean (directory) (days) (extension)"
Wscript.echo "cscript log_clean c:\ 30 log"
Wscript.echo "(directory) is folder to delete logs out of"
Wscript.echo "(days) sets the age for a file delete, if file older then (days), it is deleted"
Wscript.echo "(extension) sets which files the tool will look at)"
Wscript.Quit 3
end if
dir = Wscript.Arguments.Item(0)
days_in = Wscript.Arguments.Item(1)
ext = Wscript.Arguments.Item(2)
set fso = CreateObject("Scripting.FileSystemObject")
set folder = fso.GetFolder(dir)
set filecollection = folder.files
For Each file in filecollection
filesplit = Split(file.name, ".")
If (Ucase(filesplit(UBound(filesplit))) = Ucase(ext)) then
days_dif = DateDiff("d", file.DateLastModified, date)
if ((cint(days_dif)) > (cint(days_in))) then
wscript.echo file.name&" is "&DateDiff("d", file.DateLastModified, date)&" days old"
wscript.echo "Will delete "&file.name
file.Delete[(force)]
else
wscript.echo file.name&" is "&DateDiff("d", file.DateLastModified, date)&" days old"
wscript.echo "Will keep "&file.name
end if
end if
Next
strComputer = "." ' use "." for local computer
Const HKLM = &H80000002
'On Error Resume Next
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSettings = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
' get general info about the OS
' Caption value for different OS:
' Microsoft Windows 2000 ...
' Microsoft Windows XP ...
' Microsoft(R) Windows(R) Server 2003, ..... Edition
For Each objOperatingSystem in colSettings
strOSCaption = objOperatingSystem.Caption
Select Case True
Case InStr(1, strOSCaption, "windows 2000", vbTextCompare) > 0
strOS = "Windows 2000"
Case InStr(1, strOSCaption, "windows xp", vbTextCompare) > 0
strOS = "Windows XP"
Case InStr(1, strOSCaption, "windows(r) server 2003", vbTextCompare) > 0
strOS = "Windows Server 2003"
End Select
intOSLang = objOperatingSystem.OSLanguage
strOSLangHex = Right("000" & Hex(intOSLang), 4)
strOSServicePack = objOperatingSystem.CSDVersion
Next
Set objReg = GetObject("WinMgmts:{impersonationLevel=impersonate}!//" _
& strComputer & "/root/default:StdRegProv")
strOSLanguage = "Unknown" ' Init value
strKeyPath = "SOFTWARE\Classes\MIME\Database\Rfc1766"
strValueName = strOSLangHex
objReg.GetStringValue HKLM, strKeyPath, strValueName, strOSLanguage
' remove unnecessary stuff
arrOSLanguage = Split(strOSLanguage, ";")
strOSLanguage = arrOSLanguage(UBound(arrOSLanguage))
If Instr(strOSLanguage, "(") > 0 Then
arrOSLanguage = Split(strOSLanguage, "(")
strOSLanguage = Trim(arrOSLanguage(0))
End If
Wscript.Echo "OS version: " & strOSCaption
Wscript.Echo "SP version: " & strOSServicePack
Wscript.Echo "OS language: " & strOSLanguage
' start enumeration of hotfixes
Wscript.Echo vbCrLf & "Hotfixes Identified:"
strRegBaseUpdate = "SOFTWARE\Microsoft\Updates\" & strOS
Set colItems = objWMIService.ExecQuery _
("Select * from Win32_QuickFixEngineering",,48)
For Each objItem in colItems
If objItem.HotFixID <> "File 1" Then
Wscript.Echo "HotFixID: " & objItem.HotFixID
Wscript.Echo "Description: " & objItem.Description
Wscript.Echo "InstalledBy: " & objItem.InstalledBy
strInstallDate = Null ' init value
If objItem.ServicePackInEffect <> "" Then
strRegKey = strRegBaseUpdate & "\" & objItem.ServicePackInEffect _
& "\" & objItem.HotFixID
objReg.GetStringValue HKLM, strRegKey, _
"InstalledDate", strInstallDate
End If
If IsNull(strInstallDate) Then
strInstallDate = "(none found)"
End If
Wscript.Echo "InstallDate: " & strInstallDate
Wscript.Echo ' blank line
End If
Next
* for checking the update
** gives you the complete list of installed update on the servers
*******************************************************************************
If you need a script then find it below
*******************************************************************************
@echo on
wmic /node: Server name qfe GET description,FixComments,hotfixid,installedby,installedon > %temp%\UpdateList.txt
notepad %temp%\UpdateList.txt
*******************************************************************************
note if you need any other output format then replace the blue marked files to the HTML|CSV
'--------------------8<----------------------
' Script that reports installed updates that are
' installed with Windows Update v5 technology
'
' Result will be written to %temp%\UpdateHistory.txt
' and then launched in Notepad
'
' Author: Aslam Latheef Shaik
' Date 2012-08-11
'
Option Explicit
Const OverwriteIfExist = -1
Const OpenAsASCII = 0
Dim oWU, iTHCount, colUpdate, oUpdate, sStatus, iTotal
Dim iSuccess, iFailed, iAborted, iUnknown, sErrorCode
Dim oFSO, oShell, sFile, f
On Error Resume Next
Set oWU = CreateObject("Microsoft.Update.Searcher")
If Err.Number <> 0 Then
MsgBox "WU5 programming interface does not exist.", _
vbInformation + vbSystemModal, "Update history"
WScript.Quit
End If
On Error Goto 0
iTHCount = oWU.GetTotalHistoryCount
If iTHCount > 0 Then
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oShell = CreateObject("Wscript.Shell")
sFile = oShell.ExpandEnvironmentStrings("%TEMP%") & "\UpdateHistory.txt"
Set f = oFSO.CreateTextFile(sFile, _
OverwriteIfExist, OpenAsASCII)
iTotal = 0
iSuccess = 0
iFailed = 0
iAborted = 0
iUnknown = 0
f.WriteLine "Report run at " & Now
f.WriteLine "---------------------------------" _
& "---------------------------------"
Set colUpdate = oWU.QueryHistory(0, iTHCount)
For Each oUpdate In colUpdate
f.WriteLine "Title:" & vbTab & vbTab & vbTab & oUpdate.Title
f.WriteLine "Description:" & vbTab & vbTab & oUpdate.Description
f.WriteLine "Date/Time in GMT:" & vbTab & oUpdate.Date
f.WriteLine "Install mechanism:" & vbTab & oUpdate.ClientApplicationID
sErrorCode = ""
Select Case oUpdate.ResultCode
Case 2
sStatus = "Succeeded"
iSuccess = iSuccess + 1
Case 4
sStatus = "Failed"
iFailed = iFailed + 1
sErrorCode = oUpdate.UnmappedResultCode
Case 5
sStatus = "Aborted"
iAborted = iAborted + 1
Case Else
sStatus = "Unknown"
iUnknown = iUnknown + 1
End Select
If sStatus = "Failed" Then
f.WriteLine "Install error:" & vbTab & vbTab & sErrorCode
End If
f.WriteLine "Install status:" & vbTab & vbTab & sStatus
f.WriteLine "---------------------------------" _
& "---------------------------------"
iTotal = iTotal + 1
Next
f.WriteLine
f.WriteLine "Total number of updates found: " & iTotal
f.WriteLine "Number of updates succeeded: " & iSuccess
f.WriteLine "Number of updates failed: " & iFailed
f.WriteLine "Number of updates aborted: " & iAborted
f.Close
oShell.Run "notepad.exe " & """" & sFile & """", 1, False
Else
MsgBox "No entries found in Update History.", _
vbInformation + vbSystemModal, "Update history"
End If