Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Advanced Script

Status
Not open for further replies.
Oct 8, 2001
41
NL
Hi,

I want to write one script that connect to different printers per user group. For say group 1 gets printer A and group 2 gets printer B. What tool should I use and are there any examples.

Thanks Robin Plomp
Senior System Engineer
CCA

Is a dream a lie if it don't come true
Or is it something worse
 
I would use Visual Basic Scripting which is intended to replace .bat files. Here is a clip from my login script to get you started. You'll notice the use of the network object that exposes user name, group, and domain stuff.

dim user, domain, DriveLetter, AdsiPath, flag, RetVal

Set objNet = WScript.CreateObject( "WScript.Network" )
Set objShell = WScript.CreateObject( "WScript.Shell" )

user = objNet.UserName
domain = objNet.UserDomain
if domain = "" then
domain = "PPSQL"
end if

'AdsiPath = "WinNT://" & domain & "/" & user
Set objAdsi = getobject( "WinNT://" & domain & "/" & user )

Set objDrives = objNet.EnumNetworkDrives
'
' Call a different subroutine based on the Windows NT group of the user
'
for each prop in objAdsi.groups
select case prop.name
case "PDI"


Hope this helps. If it does click the checkmark.

Kevin

|
|
V
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top