Page 1 of 1 1
Topic Options
#207403 - 2013-06-12 06:52 AM InGroup issue
dcirona Offline
Just in Town

Registered: 2013-06-12
Posts: 2
Loc: Australia
Hey all,


I currently have Windows 7 + SP1 machines in my environment and running Microsoft Server 2008 r2 Enterprise + SP1 domain controllers. I have implemented a GPO for a logon script to run for the students profiles.

Currently printers are being mapped on desktops and laptops based on the OU that the computers are located in.

I now require to run a script that maps several printers based on the User's Security group that they are part of.

My printer logon script looks like this at the moment which is simply a text file. ie printer.txt:

if (INSTR(@wksta, "MOBSET16"))
SetDefaultPrinter ("\\server\320-PRINT")
ADDPRINTERCONNECTION ("\\server\320-PRINT")
ADDPRINTERCONNECTION ("\\server\321-PRINT")
endif

if (INSTR(@wksta, "PCL"))
ADDPRINTERCONNECTION ("\\server\435-MONO-UPPERDECK")
setdefaultprinter("\\server\435-MONO-UPPERDECK")
endif

if InGroup("horizons")
ADDPRINTERCONNECTION ("\\server\577-PRINT")
ADDPRINTERCONNECTION ("\\server\578-PRINT")
ADDPRINTERCONNECTION ("\\server\579-PRINT")
SetDefaultPrinter ("\\server\577-PRINT")
; endif

:end

The printers map without a problem if they are based on computer objects located in an OU however when I try to map based on a User's security group I have no luck getting them to map.

Any idea or suggestions please?

Top
#207405 - 2013-06-12 07:28 PM Re: InGroup issue [Re: dcirona]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
I see no obvious errors in your script. I modified it a bit just to eliminate 1's and 0's from being sent to a console. Also added a messagebox as a simple step in trouble shooting. But this looks more like an issue with the environment, than with the script itself.

 Code:
IF INSTR(@wksta, "MOBSET16")
   $rc = ADDPRINTERCONNECTION ("\\server\320-PRINT")
   $rc = ADDPRINTERCONNECTION ("\\server\321-PRINT")
   $rc = SetDefaultPrinter ("\\server\320-PRINT")
ENDIF

IF INSTR(@wksta, "PCL")
   $rc = ADDPRINTERCONNECTION ("\\server\435-MONO-UPPERDECK") 
   $rc = setdefaultprinter("\\server\435-MONO-UPPERDECK")
ENDIF

IF InGroup("horizons")
   $rc = MessageBox(@UserID+" Is In Group 'horizons'","InGroup",0)
   $rc = ADDPRINTERCONNECTION ("\\server\577-PRINT")
   $rc = ADDPRINTERCONNECTION ("\\server\578-PRINT")
   $rc = ADDPRINTERCONNECTION ("\\server\579-PRINT")
   $rc = SetDefaultPrinter ("\\server\577-PRINT")
ELSE
   $rc = MessageBox(@UserID+" Is Not In Group 'horizons'","InGroup",0)
ENDIF


Edited by ShaneEP (2013-06-12 07:30 PM)

Top
#207406 - 2013-06-13 01:31 AM Re: InGroup issue [Re: ShaneEP]
dcirona Offline
Just in Town

Registered: 2013-06-12
Posts: 2
Loc: Australia
Hi ShaneEP,

That message came up and detected that the user is definitely in the security group!

Although it doesn't seem to add the printers automatically, it now requests for an Admin account to install the drivers for the machine as the students don't have any admin privileges. Is there a way to force the install of these drivers?

Top
#207415 - 2013-06-19 09:47 AM Re: InGroup issue [Re: dcirona]
Dariusvw Offline
Fresh Scripter

Registered: 2012-02-11
Posts: 11
Loc: South Africa
There is a GPO setting that you can use to change the ADMIN account needed to install printers. we used it awhile back.

I'll look it up when i next get a chance

Top
#207416 - 2013-06-19 03:04 PM Re: InGroup issue [Re: Dariusvw]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4574
Loc: USA
I've run into this with certain drivers, but not others. I disabled the GPO policy described below.

Point and Print Restrictions policy
http://support.microsoft.com/kb/319939
_________________________
(... better days ahead)

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 (Henriques) and 2516 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.059 seconds in which 0.028 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