Page 1 of 1 1
Topic Options
#144825 - 2005-08-05 03:36 PM Defining printers by default gateway for laptop users
Peterg Offline
Lurker

Registered: 2005-08-05
Posts: 1
Hello all, we have a number of small (max 50 clients) sites. I would like to initiate the printer mapping processes at logon by checking first where they are physically located and then checking them against security access groups for that locations printers. I thought that checking the default gateway would be a good way to check where a machine was located on the network.

I have tried searching for code to check against the default gateway or mapping printers but don't get much that was relevant.

Any suggestions/better ideas?

Cheers,

Peter.

Top
#144826 - 2005-08-05 03:41 PM Re: Defining printers by default gateway for laptop users
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
If it is AD and the boundaries are defined as sites, you could use the @Site macro. If not, then there are several UDFs that will give you IP based information to work with. See the FAQ section for more info.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#144827 - 2005-08-06 03:20 AM Re: Defining printers by default gateway for laptop users
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Maybe enumerate the possible default gateways and see if your preferred one is in the list...
Code:

Dim $arrGateways[]
$arrGateways = EnumGateways()

;Dim $strGateway
;For Each $strGateway In $arrGateways
; $strGateway?
;Next

If AScan($arrGateways, "192.168.234.1") = 1
Use p: "\\MyComputer\Share\Deeper"
EndIf

Function EnumGateways()
Dim $Count
$Count = 0
Dim $Junk
Dim $arrGWInfos[]
While NOT @ERROR
$Junk = EnumIPInfo($Count)
If NOT @ERROR
ReDim PRESERVE $arrGWInfos[$Count]
$arrGWInfos[$Count] = EnumIPInfo($Count, 3)
$Count = $Count + 1
EndIf
Loop
$EnumGateways = $arrGWInfos
Exit 0
EndFunction


Top
#144828 - 2005-08-06 04:47 AM Re: Defining printers by default gateway for laptop users
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
When you say "sites" do you mean Active Directory sites, or physical customer sites that are not related?

You could place users into Printer Groups and check against that as well.

Using a Gateway as code given might be good if all the sites have their own gateways, but to me all of these could be problematic as an example all the users at site X might have same gateway, but be on 3 floors and who the heck on the 3rd floor needs all 5 of the printers from the first floor installed and mapped on their system.

Just an example which might not apply to you, but often I see people attempting to automate printer installs for users and I've been to computers that have had 50+ computers mapped because of different circumstances that are beyond the control of the Administrator.

Top
#144829 - 2005-08-06 05:38 PM Re: Defining printers by default gateway for laptop users
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
eh?
can't be beyond the control of administrator.
it can be pure administration but as long as it's in the network, it's controllable by the admin.
_________________________
!

download KiXnet

Top
#144830 - 2005-08-07 03:13 AM Re: Defining printers by default gateway for laptop users
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
excuse me but unless your are GOD and can forsee everything then yes it is beyond the Administrator to KNOW everything before it has happened.
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 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.066 seconds in which 0.034 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