Page 1 of 1 1
Topic Options
#205062 - 2012-05-01 05:03 AM If ingroup Windows 2008 R2
xempa Offline
Fresh Scripter

Registered: 2006-08-12
Posts: 37
Hi

My apologies if this has been answered already , but I cannot seem to get a definitive yes or no answer , whether if ingroup is supported with Windows 2003 R2 (AD Server)

I'm trying to add printers through if ingroup ?

I can add printers otherwise without if ingroup

Any help here would be gratefully appreciated

Thanks

Top
#205063 - 2012-05-01 05:07 AM Re: If ingroup Windows 2008 R2 [Re: xempa]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
It works fine, unless you are using a GPO script with UAC enabled.
Top
#205076 - 2012-05-01 11:11 PM Re: If ingroup Windows 2008 R2 [Re: Allen]
xempa Offline
Fresh Scripter

Registered: 2006-08-12
Posts: 37
Hi Allen

Thanks for your help , I'm hoping you mean yes to Windows 2008 R2 X64 AD
My apologies for my earlier typo "Windows 2003"

Yes , that is possible , I will check this tommorrow, also it's possible the version of kix32 I am using is maybe too old . The one I was using was 12 July 2006 ?

As a sanity check are you able to critique the following. This would at least eliminate the script itself as the possible problem. Your help here would be greatly appreciated. Many thanks

 Code:
[postprep]
USE * /DELETE
? " MAPPING USER DRIVES...."
Use h: "\\\\server1\staff$\%username%"
Use p: "\\server1\public"
Use s: "\\server1\staff-public"
Use i: "\\server1\students$"
Use q: "\\server1\staff_shared"
? " - Successful" 
? " " 

IF INGROUP("Domain Admins")
use T: "\\Server1\ICT$" 
Endif

;====Printer Mappings here==================================================================

IF INGROUP("West")		
      $=AddPrinterConnection ("\\Server1\Room12 B_W")
      $=AddPrinterConnection ("\\Server1\Room12 Colour")     
      $=SetDefaultPrinter ("\\Server1\Room12 B_W")
      ? "Added printer connection....Setting default to Room12 B_W"
ENDIF

IF INGROUP("East")		
      $=AddPrinterConnection ("\\server1\Middle syn B_W")
      $=AddPrinterConnection ("\\server1\Middle syn Colour")
      $=SetDefaultPrinter ("\\server1\Middle syn B_W")
      ? "Added printer connection.....Setting default to Middle syn B_W"
ENDIF

IF INGROUP("South")		
      $=AddPrinterConnection ("\\server1\Resource Rm B_W")
      $=AddPrinterConnection ("\\server1\Resource Rm Colour")
      $=SetDefaultPrinter ("\\server1\Resource Rm B_W")
      ? "Added printer connection....Setting default to Resource Rm B_W"
ENDIF

IF INGROUP("Admin")
	$=AddPrinterConnection ("\\Server1\Principal B_W")
	$=AddPrinterConnection ("\\Server1\Principal Colour")
	$=AddPrinterConnection ("\\Server1\Reception Office B_W")
	$=AddPrinterConnection ("\\Server1\Resource Rm B_W")
	$=AddPrinterConnection ("\\Server1\Principal Rm Colour")
        ? "Added printer connection....
ENDIF

IF INGROUP("Students")
	$=AddPrinterConnection ("\\Server1\Resource Rm B_W")
        $=SetDefaultPrinter ("\\server1\Resource Rm B_W")
        ? "Added printer connection....Setting default to Resource Rm B_W"
	$=AddPrinterConnection ("\\Server1\Middle Syn B_W")
	$=AddPrinterConnection ("\\Server1\Room12 B_W")        
        ? "Added printer connection....
ENDIF

;=====Other printers=======================================================================

IF @USERID = "joycea" 
  $=AddPrinterConnection ("\\Server1\Principal B_W")
  $=SetDefaultPrinter ("\\server1\Principal B_W")        
ENDIF

IF @USERID = "reception" 
  $=AddPrinterConnection ("\\Server1\Reception Office B_W")
  $=SetDefaultPrinter ("\\server1\Reception Office B_W")        
ENDIF


Edited by Allen (2012-05-02 12:11 AM)
Edit Reason: added code tags

Top
#205077 - 2012-05-01 11:42 PM Re: If ingroup Windows 2008 R2 [Re: xempa]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
I assume this is simply a typo, but...this line looks wrong.
 Code:
Use h: "\\\\server1\staff$\%username%"
Otherwise, I didnt spot anything that looked like it wouldnt work.

Also, do the last two mappings (the ones based off userid) map correctly?


Edited by ShaneEP (2012-05-01 11:43 PM)

Top
#205078 - 2012-05-02 12:18 AM Re: If ingroup Windows 2008 R2 [Re: ShaneEP]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
I exclusively use 4.62 for all my logon scripts. The AD servers vary from Server 2003, Server 2008, and Server 2008 R2 (x64). Everything works as expected.



Top
#205079 - 2012-05-02 12:22 AM Re: If ingroup Windows 2008 R2 [Re: Allen]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
Thanks to Lonks new spiffy color code... it found the error for me...

You are missing the closing quotes around the messages about setting the printer in both of these sections...

 Code:
IF INGROUP("Admin")
	$=AddPrinterConnection ("\\Server1\Principal B_W")
	$=AddPrinterConnection ("\\Server1\Principal Colour")
	$=AddPrinterConnection ("\\Server1\Reception Office B_W")
	$=AddPrinterConnection ("\\Server1\Resource Rm B_W")
	$=AddPrinterConnection ("\\Server1\Principal Rm Colour")
        ? "Added printer connection....
ENDIF

IF INGROUP("Students")
	$=AddPrinterConnection ("\\Server1\Resource Rm B_W")
        $=SetDefaultPrinter ("\\server1\Resource Rm B_W")
        ? "Added printer connection....Setting default to Resource Rm B_W"
	$=AddPrinterConnection ("\\Server1\Middle Syn B_W")
	$=AddPrinterConnection ("\\Server1\Room12 B_W")        
        ? "Added printer connection....
ENDIF

Top
#205081 - 2012-05-02 02:36 AM Re: If ingroup Windows 2008 R2 [Re: Allen]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Good catch...And Im willing to bet he is testing with an account that is a member of "Admin" lol.
Top
#205085 - 2012-05-02 06:34 AM Re: If ingroup Windows 2008 R2 [Re: ShaneEP]
xempa Offline
Fresh Scripter

Registered: 2006-08-12
Posts: 37
Excellent guys thanks very much for your help.

Using a newer kix32.exe was primarily the ticket and yes a couple of typo's without closed quotes and the extra \\ for the user mapping didn't help. I thanks you all again for your help.

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
0 registered and 793 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.053 seconds in which 0.035 seconds were spent on a total of 13 queries. Zlib compression enabled.

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