Page 1 of 1 1
Topic Options
#137701 - 2005-04-12 07:52 AM [SCRIPT INSIDE] Made script for network printers based on AD
kingskawn Offline
Fresh Scripter

Registered: 2005-04-12
Posts: 5
Hello,

I've got the following problem. I made a script for users who uses network printers based on the OU in the Active Directory.
But in my script I've got all the commands and I'm missing one to read a second file where all the printers are in.

login.scr
Call "NetworkPrinters 998.scr"



Script 1;

Code:

DIM $PrinterServer

$PrinterServer = "S99808"


DIM $NbrTotal

;
;******************************************************
; Total number of printers
;******************************************************
;

$NbrTotal = 13

DIM $CptLocal
DIM $CptPrinter

DIM $NOLocal[$NbrTotal]
DIM $NbrPrinter[$NbrTotal]

DIM $NOSuite[4]

$NOSuite[0]= "A"
$NOSuite[1]= "B"
$NOSuite[2]= "C"
$NOSuite[3]= "D"







$CptLocal = 0
$CptPrinter = 0
WHILE $CptPrinter < ($NbrPrinter[$CptLocal])
ADDPRINTERCONNECTION ("\\$PrinterServer\P999" + $NOLocal[$CptLocal] + $NOSuite[$CptPrinter])
IF INGROUP("GG999_PRT" + $NOLocal[$CptLocal] + $NOSuite[$CptPrinter])
SETDEFAULTPRINTER ("\\$PrinterServer\P999" + $NOLocal[$CptLocal] + $NOSuite[$CptPrinter])
ENDIF
$CptPrinter = $CptPrinter + 1
LOOP
ENDIF
$CptLocal = $CptLocal + 1
LOOP




And the 2nd;



Code:

;
; Connection P999201
;

$PrinterServer = "S99808"


IF INGROUP("GG999_PRT201")
ADDPRINTERCONNECTION ("\\$PrinterServer\P999201")
ENDIF

;
; Connection P999211
;

IF INGROUP("GG999_PRT211")
ADDPRINTERCONNECTION ("\\$PrinterServer\P999211")
ENDIF

;
; Connection P999221
;

$PrinterServer = "S99808"


IF INGROUP("GG999_PRT221")
ADDPRINTERCONNECTION ("\\$PrinterServer\P999221")
ENDIF




So how I make this thing working. It's obvious that it's easy but I can't figure it out. My mind burned a bit the past days

Thanks if anybody could help me out!

Top
#137702 - 2005-04-12 08:25 AM Re: [SCRIPT INSIDE] Made script for network printers based on AD
kingskawn Offline
Fresh Scripter

Registered: 2005-04-12
Posts: 5
Nobody?
Top
#137703 - 2005-04-12 10:27 AM Re: [SCRIPT INSIDE] Made script for network printers based on AD
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Hmmm ... only thing that I see currently that stops the show is that you have 2 LOOP but only 1 WHILE in the first script
_________________________



Top
#137704 - 2005-04-12 10:28 AM Re: [SCRIPT INSIDE] Made script for network printers based on AD
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Whoops,

and check also the numbers of ENDIFs against the number of IFs in your first script
_________________________



Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Glenn Barnas) and 955 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.056 seconds in which 0.028 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org