Zoney...Since there doesn't seem to be any takers on this one, I'll tell you how we solved the roaming profile / printer problem. It ain't elegant but it's simple and it works great!
As part of our commissioning (setup) process for new workstations, we run a custom built UI that among other things, ask for the path of the nearest network printer for that workstation. The UI then data-fills it into a custom registry key/value as follows...
code:
hkey_local_machine\software\companyname\printer\nearest = "host\share"
The KiX logon script then queries the value, connects and assigns it as default ...
code:
$printer = readvalue ( "hkey_local_machine\software\companyname\printer", "nearest" )if $printer <> ""
if addprinterconnection ( "$printer" )
?"AddPrinterConnection: @serror"
else
if setdefaultprinter ( $printer )
?"SetDefaultPrinter: @serror"
endif
endif
else
?"Default printer not defined"
endif
exit
You can manually enter this key/value into each workstation locally or remotely as the domain administrator. A lot would depend on how many workstations you have, etc.
The other approach we played around with was to maintain a list of domain printers and
do some sort of lookup when a user logs on. This list would be kept on the domain controllers and queried with KiX... For example, do a readprofilestring() lookup of a network file called printers.ini based on workstation ip subnet...
File printers.ini contains...
code:
[142.121]
printer = \\hostname\floor12_hp4
[142.122]
printer = \\hostname\floor23_hp4
[142.123]
printer = \\hostname\floor24_hp4
And some Kix code like ...
code:
$subnet = substr("@IPADDRESS0",1,7)
$printer = readprofilestring ( "%logonserver%\netlogon\printers.ini", "$subnet", "printer" )
; add and set printer default, etc, blah blah blah ...
It would be nice to have some sort of automatic discovery mechanism through the registry or over the network though ! Anyone ?
Hope this helps !
Shawn.