I consider myself an intermediate to advanced kixtart scripter, but I'm struggling with coming up with the most efficient way to tackle an upcoming challenge. At our school district we have really just started rolling out Windows 7 computers within the past year. Up until then we have been manually adding the network printers and then copying the printers to the default/other user profiles as needed. With windows 7 that is no longer possible. Up until now we have been using the work around of adding network printers as local printers that point to a server\share on the port. With an upcoming deployment we want to start doing it the "proper" way-- adding them on the fly at login. I'd like to avoid having to use active directory as I feel like that would be more of a burden then doing it via kix. Our users (teachers and students) float around to computers all over the building and to other buildings so all printers must be added by computer name / geographical location and not by users themselves.

We have around 3000 computers (not all of which will need to have specific default printers recorded, but lets say they do) spread out over 10 buildings, with about 10-20 network printers at each building. Each machine in a particular building would typically get all network printers installed with one of them set as the default.

So, with that long explanation out of the way, what would be the most efficient solution to my dilemma? Doing a bunch of searches turned up basically three methods: arrays, ini file, and AD group membership. The INI files seems to be the most efficient and this is my idea as of now--

One INI file called "printers_default.ini" and another called "printers_building.ini". In the default one would be a list of machines in sections with a default printer and possibly any extra special printers.

In the default ini would be something like--

 Code:
[wrkstn-1]
default=\\server\printer
extra1=\\server\printer2

[wrkstn-2]
default=\\server\printer


This the the thing I am most worried about as this file will end up being very large. Our largest building has about 137 computers that would need to be in there, so I suppose what would be a little more efficient is to break the list up by building as well, e.g. printers_default_domainname.ini and then have specific domain computers and defaults in there. It would still be a little ugly as it would require manual searching / sorting / entry by technicians.

And then in the printers_building.ini (the file containing a list of printers that get added to every machine regardless) I would have--

 Code:
[domainname]
printer1=\\server\printer1
printer2=\\server\printer2
printer2=\\server\printer2

[otherdomain]
printer1=\\server2\printer1
printer2=\\server2\printer2
printer2=\\server2\printer2


And then the kix code would be something along the lines of...

 Code:
$dp = ReadProfileString("printers_default_" + @DOMAIN + ".ini", @WKSTA, "default")
IF @ERROR = 0 AND $dp <> ""
	FOR EACH $key In Split(ReadProfileString("printers_default_" + @DOMAIN + ".ini", @WKSTA, ""), Chr(10))
		IF $key <> ""
			$addprinter = ReadProfileString("printers_default_" + @DOMAIN + ".ini", @WKSTA, $key)
			IF $addprinter <> "" $ret = ADDPRINTERCONNECTION($addprinter) ENDIF
		ENDIF
	NEXT
	FOR EACH $key In Split(ReadProfileString("printers_buildings.ini", @DOMAIN, ""), Chr(10))
		IF $key <> ""
			$addprinter = ReadProfileString("printers_buildings.ini", @DOMAIN, $key)
			IF $addprinter <> "" $ret = ADDPRINTERCONNECTION($addprinter) ENDIF
		ENDIF
	NEXT
	$ret = SETDEFAULTPRINTER($dp)
ENDIF


... Thoughts?