Page 1 of 1 1
Topic Options
#169640 - 2006-10-20 01:12 AM Cannot Add printer connections
cabal10 Offline
Fresh Scripter

Registered: 2006-08-03
Posts: 13
I have a windows 2003 R2 server running Kix 2001. I Place wkix32 and loginscript.cmd in the netlogon dir. Under user properties profile-loginscript I enter in loginscript.cmd-->(start "LogonScript" /min /B wkix32 logonscript.kix /i)

I am trying to map printers by group but it will not work. example:

IF INGROUP ("OKIC5200-SERVICE1")
ADDPRINTERCONNECTION ("\\al-winslow\OKI-C5200N-SERVICE1")
ENDIF

For some strange reason it will not work. The drive mappings work fine, but they are not done by group. Does anyone have any ideas? Should I use the latest version of Kix???

Thanks in advance for your help.

Top
#169641 - 2006-10-20 01:27 AM Re: Cannot Add printer connections
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
If you do an ENUMGROUP, is the group list correct?

Thanks,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#169642 - 2006-10-20 02:18 AM Re: Cannot Add printer connections
cabal10 Offline
Fresh Scripter

Registered: 2006-08-03
Posts: 13
I never did that before. I will try. What should I put in my script? What is the syntax?

Thank you.

Top
#169643 - 2006-10-20 03:07 AM Re: Cannot Add printer connections
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
www.kixtart.org/manual

http://www.kixtart.org/manual/Functions/EnumGroup.htm

Top
#169644 - 2006-10-23 02:44 PM Re: Cannot Add printer connections
cabal10 Offline
Fresh Scripter

Registered: 2006-08-03
Posts: 13
Thanks for the advice. Here is what I found. When I run the script with the addprinterconnection without using if ingroup it maps the printer just fine. Is there a problem with group names like this: OKIC5200-RECON ??

Thanks for you help..

Top
#169645 - 2006-10-23 02:59 PM Re: Cannot Add printer connections
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Are you sure the user is in the group? Did you rename the group at some point? Check the user's group token cache in the reg. Try flushing the cache.
Top
#169646 - 2006-10-23 03:16 PM Re: Cannot Add printer connections
cabal10 Offline
Fresh Scripter

Registered: 2006-08-03
Posts: 13
The groups are new they were just created. I have a windows 2003 R2 server. I inserted the new server into an existing W2K domain (did adprep). Don't think that should be an issue. I am not sure how to check the users group token cache??
Top
#169647 - 2006-10-23 03:29 PM Re: Cannot Add printer connections
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
token cache - under HKEY_CURRENT_USER\Software\KiXtart\

My tip is to simply do a gpresult and check the output if the groups really are there as well.

second, is the files replicated ok everywere?

Top
#169648 - 2006-10-23 03:57 PM Re: Cannot Add printer connections
cabal10 Offline
Fresh Scripter

Registered: 2006-08-03
Posts: 13
Thank you for quick responses.
I checked the token cache and it showed the correct groups. I also did a gpresult and that showed the user was in the correct groups. As I said it something group related, because it works without IF INGROUP?? I am stumped..

Top
#169649 - 2006-10-23 04:00 PM Re: Cannot Add printer connections
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Try deleting the cache just for fun.
Top
#169650 - 2006-10-23 04:13 PM Re: Cannot Add printer connections
cabal10 Offline
Fresh Scripter

Registered: 2006-08-03
Posts: 13
Just tried that and no luck. I did add all my printers to the main login script withou the groups just to make sure they would map and they did. They all mapped. I don't get this, because I have always used kix scripts to map my printers by group and it always works. This is very puzzling to me...
Top
#169651 - 2006-10-23 05:27 PM Re: Cannot Add printer connections
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
check out other if-statements if they are broken in your script.
Top
#169652 - 2006-10-23 05:39 PM Re: Cannot Add printer connections
cabal10 Offline
Fresh Scripter

Registered: 2006-08-03
Posts: 13
Yes, they do. I have one for mapping shares.

here is a part of the script.

IF INGROUP ("WISETRACK")
use M: "\\VOORHEES-SERVER\PUBLIC"
use U: "\\SERVER_SOUTH\SHARE"
use K: "\\SERVER_NORTH\SHARE"
use L: "\\LAKEWOOD-SERVER\SHARE"
ENDIF


IF INGROUP ("HP4250-RECON")
ADDPRINTERCONNECTION ("\\AL-WINSLOW\HP-4250-RECON")
;SetDefaultPrinter ("\\AL-WINSLOW\HP-4250-RECON")
ENDIF

IF INGROUP ("OKIC5200-RECON")
ADDPRINTERCONNECTION ("\\AL-WINSLOW\OKI-C5200N-RECON")
ENDIF


What the heck could it be??

Top
#169653 - 2006-10-23 05:42 PM Re: Cannot Add printer connections
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
please place your code between code tags, then post you entire script so that we can better help you.
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#169654 - 2006-10-23 06:12 PM Re: Cannot Add printer connections
cabal10 Offline
Fresh Scripter

Registered: 2006-08-03
Posts: 13
Sorry I am such a newb, but I don't know what you mean by code tags. I just want to know why my script won't map printers with IF INGROUP?
Top
#169655 - 2006-10-23 06:19 PM Re: Cannot Add printer connections
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
when you reply to a post, under 'Instant UUB Code' is the word 'Code', click it and paste your code between.
Code:
 place code here 

_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#169656 - 2006-10-23 06:34 PM Re: Cannot Add printer connections
cabal10 Offline
Fresh Scripter

Registered: 2006-08-03
Posts: 13
Here is the code. PLease let me know if you see anything that would cause me a problem with the ADDPRINTERCONNECTION statements. The users are in there groups respective groups.

Code:
  
SETTIME "\\AL-WINSLOW"

; *********************** COMMON NETWORK DRIVE MAPPING FOR ALL USERS **************

USE Y: /delete
USE Y: "\\AL-WINSLOW\SHARE"
USE S: /delete
USE S: "\\AL-WINSLOW\SHARE"
USE P: /delete
USE P: "\\AL-WINSLOW\AUTOLENDERS"
USE O: /delete
USE O: "\\AL-WINSLOW\HPSCAN"


; ************************END OF DRIVE MAPPING FOR ALL USERS***********************

; ************************DRIVE MAPPING FOR BUSINESS GROUPS************************


IF INGROUP ("WISETRACK")
use M: "\\VOORHEES-SERVER\PUBLIC"
use U: "\\SERVER_SOUTH\SHARE"
use K: "\\SERVER_NORTH\SHARE"
use L: "\\LAKEWOOD-SERVER\SHARE"
ENDIF


IF INGROUP ("HP4250-RECON")
ADDPRINTERCONNECTION ("\\AL-WINSLOW\HP-4250-RECON")
;SetDefaultPrinter ("\\AL-WINSLOW\HP-4250-RECON")
ENDIF

IF INGROUP ("OKIC5200-RECON")
ADDPRINTERCONNECTION ("\\AL-WINSLOW\OKI-C5200N-RECON")
ENDIF

IF INGROUP ("HP4345-ADMIN")
ADDPRINTERCONNECTION ("\\AL-WINSLOW\HP-4345MFP-2NDFLOOR")
END IF

IF INGROUP ("OKIC5200-SERVICE1")
AddPrinterConnection ("\\al-winslow\OKI-C5200N-SERVICE1")
END IF

IF INGROUP ("OKIC5200-SERVICE2")
ADDPRINTERCONNECTION ("\\al-winslow\oki-c5200n-service2")
END IF

IF INGROUP ("DELLW5300-INVENTORY")
ADDPRINTERCONNECTION ("\\AL-WINSLOW\DELL-W5300-INVENTORY")
;SetDefaultPrinter ("\\AL-WINSLOW\DELL-W5300-INVENTORY")
END IF

IF INGROUP ("all_prn")
ADDPRINTERCONNECTION ("\\al-winslow\DELL-W5300-INVENTORY")
ADDPRINTERCONNECTION ("\\AL-WINSLOW\OKI-C5200N-SERVICE1")
ADDPRINTERCONNECTION ("\\AL-WINSLOW\OKI-C5200N-SERVICE2")
ADDPRINTERCONNECTION ("\\AL-WINSLOW\HP-4345MFP-2NDFLOOR")
ADDPRINTERCONNECTION ("\\AL-WINSLOW\OKI-C5200N-RECON")
ADDPRINTERCONNECTION ("\\AL-WINSLOW\HP-4250-RECON")
END IF


; ************************************************ END ****************************

exit



Top
#169657 - 2006-10-23 07:11 PM Re: Cannot Add printer connections
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11628
Loc: CA
There is no such thing as END IF with KiXtart.
That is VB style coding.

It is EndIf

Top
#169658 - 2006-10-23 08:25 PM Re: Cannot Add printer connections
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11628
Loc: CA
Here is an updated script with some comments
Hope this helps.

 
If Not @LogonMode
Break On
Else
Break Off
EndIf
Dim $SO
$SO=SetOption('Explicit','On')
$SO=SetOption('NoVarsInStrings','On')
$SO=SetOption('NoMacrosInStrings','On')
$SO=SetOption('WrapAtEOL','On')


Dim $Nul


;NOTE: SETTIME (unless it's an application written by you) is an invalid
;command. For the old NT systems there was NET TIME
;but even that - the user needs to be a local admin or the command would fail
;On 2000/2003 Active Directory it is no longer used as they now use W32Time
;SETTIME is a function in C++ from what I can tell
;How to configure an authoritative time server in Windows Server 2003
;http://support.microsoft.com/kb/816042

SETTIME '\\AL-WINSLOW'

; *********************** COMMON NETWORK DRIVE MAPPING FOR ALL USERS **************

;Not really sure why you delete and re-map each logon but hey... to each his own
;Probably better to add the persistent switch as well
USE Y: /delete /persistent
USE Y: '\\AL-WINSLOW\SHARE'
USE S: /delete /persistent
USE S: '\\AL-WINSLOW\SHARE'
USE P: /delete /persistent
USE P: '\\AL-WINSLOW\AUTOLENDERS'
USE O: /delete /persistent
USE O: '\\AL-WINSLOW\HPSCAN'


; ************************END OF DRIVE MAPPING FOR ALL USERS***********************

; ************************DRIVE MAPPING FOR BUSINESS GROUPS************************

;Not required but recommend adding the specific Domain or if single Domain then
;just the @Domain macro
If InGroup(@Domain+'\WISETRACK')
use M: '\\VOORHEES-SERVER\PUBLIC'
use U: '\\SERVER_SOUTH\SHARE'
use K: '\\SERVER_NORTH\SHARE'
use L: '\\LAKEWOOD-SERVER\SHARE'
EndIf

If InGroup (@Domain+'\HP4250-RECON')
$Nul = AddPrinterConnection('\\AL-WINSLOW\HP-4250-RECON')
;SetDefaultPrinter ('\\AL-WINSLOW\HP-4250-RECON')
EndIf

If InGroup (@Domain+'\OKIC5200-RECON')
$Nul = AddPrinterConnection('\\AL-WINSLOW\OKI-C5200N-RECON')
EndIf

If InGroup (@Domain+'\HP4345-ADMIN')
$Nul = AddPrinterConnection('\\AL-WINSLOW\HP-4345MFP-2NDFLOOR')
EndIf

If InGroup(@Domain+'\OKIC5200-SERVICE1')
$Nul = AddPrinterConnection('\\al-winslow\OKI-C5200N-SERVICE1')
EndIf

If InGroup(@Domain+'\OKIC5200-SERVICE2')
$Nul = AddPrinterConnection('\\al-winslow\oki-c5200n-service2')
EndIf

If InGroup(@Domain+'\DELLW5300-INVENTORY')
$Nul = AddPrinterConnection('\\AL-WINSLOW\DELL-W5300-INVENTORY')
;SetDefaultPrinter ('\\AL-WINSLOW\DELL-W5300-INVENTORY')
EndIf

If InGroup(@Domain+'\all_prn')
$Nul = AddPrinterConnection('\\al-winslow\DELL-W5300-INVENTORY')
$Nul = AddPrinterConnection('\\AL-WINSLOW\OKI-C5200N-SERVICE1')
$Nul = AddPrinterConnection('\\AL-WINSLOW\OKI-C5200N-SERVICE2')
$Nul = AddPrinterConnection('\\AL-WINSLOW\HP-4345MFP-2NDFLOOR')
$Nul = AddPrinterConnection('\\AL-WINSLOW\OKI-C5200N-RECON')
$Nul = AddPrinterConnection('\\AL-WINSLOW\HP-4250-RECON')
EndIf


; ************************************************ END ****************************

Exit 1

Top
Page 1 of 1 1


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

Who's Online
0 registered and 657 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.081 seconds in which 0.031 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