#163040 - 2006-06-07 01:41 PM
Printer Location Tracking
|
Sypher
Fresh Scripter
Registered: 2005-11-18
Posts: 9
|
Hello,
I am running a couple of Win2k3 (Enterprise) servers. One of this server is hosting all the printers (100 to be exact). These 100 printers all have names like AMS-PR1 to AMS-PR188 (only the uneven numbers are on this server).
All the printers have a department in their Location (Sales, Development etc..), and the Locationname in the Descripting (Amsterdam)
I'm using KiX as a logon script, but now theres a thing i can't seem to fix.
What i want to do is adding a printer to a user, but only a printer in his own group (e.g. Sales).. One of the random printers in the department..
Is there a way to do this with KiX?
I hope to hear from you soon, Thanks in advance!
|
|
Top
|
|
|
|
#163042 - 2006-06-08 10:34 AM
Re: Printer Location Tracking
|
Sypher
Fresh Scripter
Registered: 2005-11-18
Posts: 9
|
Hello, First of all, thanks for the reply. I am running the latest version of KiX (as always). My workstations are all running under Windows XP SP2.
Here's a picture of my network: - 2 Fileservers with printers spread (uneven = FS1, even = FS2) - 100 printers per fileserver - 10 departments (Administration, Aftersales, Transport, Management, Communication, Development, Sales, Marketing, Helpdesk, Sysop)
- All the printers have a location (the departmentname)
Now i have to connect the closest printer, thus one in the office of the department, e.g. Sales..
I hope this clears up any questions 
-- Edit:
I guess theres also another "quick 'n dirty" solution, to check what group the user is in, and then add a random printer out the scope (For example: AMS-PR155 - AMS-PR165) but i'd like to use the Location-field)
Edited by Sypher (2006-06-08 10:38 AM)
|
|
Top
|
|
|
|
#163043 - 2006-06-12 08:51 AM
Re: Printer Location Tracking
|
Sypher
Fresh Scripter
Registered: 2005-11-18
Posts: 9
|
Any suggestions?
|
|
Top
|
|
|
|
#163046 - 2006-06-12 11:05 AM
Re: Printer Location Tracking
|
Sypher
Fresh Scripter
Registered: 2005-11-18
Posts: 9
|
I used kix before, but im not that experienced.. Some examples (especially the WMI stuff) are very welcome 
Edit: I found some code like: Code:
Option Explicit Dim objWMIService, objItem, colItems, strComputer, intPrinters
strComputer ="." intPrinters = 1
Set objWMIService = GetObject _ ("winmgmts:\\" & strComputer & "\root\CIMV2") Set colItems = objWMIService.ExecQuery _ ("SELECT * FROM Win32_Printer")
Call Wait() ' Goto Sub Routine at the end
' On Error Resume Next For Each objItem In colItems WScript.Echo "Location: " & objItem.Location & " Shared as: \\" & objItem.ShareName intPrinters = intPrinters + 1 Next
sub Wait() If strComputer = "." then strComputer = "Local Host" else strComputer = strComputer end if
End Sub
WScript.Quit
But how can this be ported to KiX?
Edited by Sypher (2006-06-12 12:54 PM)
|
|
Top
|
|
|
|
#163047 - 2006-06-15 12:56 PM
Re: Printer Location Tracking
|
Sypher
Fresh Scripter
Registered: 2005-11-18
Posts: 9
|
Sorry to bump this topic, i really need this
|
|
Top
|
|
|
|
#163051 - 2006-06-15 02:21 PM
Re: Printer Location Tracking
|
Sypher
Fresh Scripter
Registered: 2005-11-18
Posts: 9
|
Well checking groups isn't the problem, checking the printer properties is.. I've searched the forum but i couldn't find any printer querying.
I do have a VBscript (as you can see a few posts up) that gives the location of the printer and the sharename...
|
|
Top
|
|
|
|
#163052 - 2006-06-23 04:21 PM
Re: Printer Location Tracking
|
Sypher
Fresh Scripter
Registered: 2005-11-18
Posts: 9
|
^^ kick ^^
Please?
|
|
Top
|
|
|
|
#163053 - 2006-06-23 04:52 PM
Re: Printer Location Tracking
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Sypher,
Does this help? Code:
Dim $objWMIService, $objItem, $colItems, $strComputer, $intPrinters $strComputer="." $intPrinters=1
$objWMIService=GetObject("winmgmts:\\"+$strComputer+"\root\CIMV2") $colItems=$objWMIService.ExecQuery("SELECT * FROM Win32_Printer")
?"Looking at Printers installed on: "+@wksta For Each $objItem In $colItems IF LEN($objItem.Location)>3 ?"Location: "+$objItem.Location+" Shared as: \\"+$objItem.ShareName $intPrinters=$intPrinters+1 ENDIF Next ?'Process is complete' get $
Kent
|
|
Top
|
|
|
|
#163054 - 2006-06-23 04:58 PM
Re: Printer Location Tracking
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Well, a fairly direct translation losing the wooly bits is: Code:
Dim $objWMIService, $objItem, $colItems, $strComputer $strComputer ="." $objWMIService = GetObject("winmgmts:\\" + $strComputer + "\root\CIMV2") $colItems = $objWMIService.ExecQuery ("SELECT * FROM Win32_Printer") For Each $objItem In $colItems "Location: '" + $objItem.Location + "' shared as: \\" + $objItem.ShareName+@CRLF Next Exit 0
|
|
Top
|
|
|
|
#163055 - 2006-06-26 10:31 PM
Re: Printer Location Tracking
|
Sypher
Fresh Scripter
Registered: 2005-11-18
Posts: 9
|
Well as far as i can understand it, it looks like it'll work. Now the point is to randomly select one of the printers that match the user group (which is named G_Groupname) and bind it to the user...
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1046 anonymous users online.
|
|
|