Page 1 of 1 1
Topic Options
#66003 - 2002-06-02 04:39 AM Question about adding printers via script
Scrimbo Offline
Lurker

Registered: 2002-06-02
Posts: 1
I've written a UDF to parse the user's group memberships to add them to whatever printer is specified by the group name. No problems there, but I was wondering two things:

How can I check to see if a user is removed from a group, and therefore remove the unwanted printer?

Can Kixtart check to see if the printer is already there, and if so, skip it?

--Thanks!
Scrimbo

Top
#66004 - 2002-06-02 04:47 AM Re: Question about adding printers via script
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
You can check for the printer in HKEY_CURRENT_USER\Printers and if found do an InGroup() check to see if the user is still a member.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#66005 - 2002-06-02 07:10 PM Re: Question about adding printers via script
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
It would be something like this:
code:
IF INGROUP('GroupA')
$rc=ADDPRINTERCONNECTION('\\server\printer')
ELSE
IF READVALUE('HKEY_CURRENT_USER\Printers\...','...')='...'
$rc=DELPRINTERCONNECTION('\\server\printer')
ENDIF
ENDIF

_________________________
There are two types of vessels, submarines and targets.

Top
#66006 - 2002-06-05 06:12 PM Re: Question about adding printers via script
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
solved?
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

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 764 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.113 seconds in which 0.076 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