Hi All,

I'm running in to an issue where a small group of our users get "Errorcode: 10 : The environment is incorrect" when mapping printers through our printer mapping script.

We run VMWare and most of the users are on one pool so they basically all have the same configuration and still printer mapping will fail for some.

We run Kix 4.66 on Windows 7.
Our printer mapping script uses an array to define individual printers and an array to define default printers. In addition to setting the individual printers, users get printers mapped based on group membership.
Below is a code snippet for the individual printer mapping:

 Code:
; Individual printer mapping -------------------------------------------------------------------------------------
For Each $row In $IPrinters
  for each $element in $row
	if @USERID = $element
;		"Map " + $row[0] + " FOR " + @USERID ?
		$MyPrinter=$row[0]
		addprinterconnection ($MyPrinter)
			If AddPrinterConnection ($MyPrinter) = 0
;				"Added printer connection to $MyPrinter...." ?
				If RedirectOutput($LogFile) = 0 ;log success to log file
					"@DATE,@TIME,@MSECS,@USERID,Mapped printer $MyPrinter" ?
				EndIf
				RedirectOutput("") ;Redirect output back to screen
			Else
				$errorcode=@Error ;store error code
				$errordes=@SERROR ;store error description
;				"Printer connection to $MyPrinter failed!" ?;show failed
;				"Error code: " + @ERROR + " : " + @SERROR ?;show error code and description
				If RedirectOutput($LogFile) = 0 ;log failure to log file
					"@DATE,@TIME,@MSECS,@USERID,Printer connection to $MyPrinter failed!" ?
					"@DATE,@TIME,@MSECS,@USERID,Errorcode: $errorcode : $errordes" ?
				EndIf
				RedirectOutput("") ; Redirect output back to screen
			EndIf
	endif
  Next
Next


To add to the confusion, we will see Errorcode: 10 in the log for some users but they can still print.

Thanks for any advise,

Sjaak