Printer logon script
Hej jeg har lavet et logon script i VB der tilføjer nogle printere og det virker fint men der er en ting jeg ikke kan finde ud af. Jeg kan ikke finde en kommando der kan sætte hvilken output bin printet kommer ud i.Her er scriptet
Dim WSHShell, WSHNetwork, objDomain, DomainString, UserString, UserObj, Path
Set WSHShell = CreateObject("WScript.Shell")
Set WSHNetwork = CreateObject("WScript.Network")
'Automatically find the domain name
Set objDomain = getObject("LDAP://rootDse")
DomainString = objDomain.Get("dnsHostName")
'Find the Windows Directory
WinDir = WshShell.ExpandEnvironmentStrings("%WinDir%")
'Grab the user name
UserString = WSHNetwork.UserName
'Bind to the user object to get user name and check for group memberships later
Set UserObj = GetObject("WinNT://" & DomainString & "/" & UserString)
'Grab the computer name for use in add-on code later
strComputer = WSHNetwork.ComputerName
'ADD PRINTERS
WSHNetwork.AddWindowsPrinterConnection"\\eur\CPHVoucher"
WSHNetwork.AddWindowsPrinterConnection"\\eur\CPH-HpMainPrinter"
WSHNetwork.AddWindowsPrinterConnection"\\eur\HPColorL"
For Each GroupObj In UserObj.Groups
Select Case UCase(GroupObj.Name)
Case "ALLANTEST"
WSHNetwork.SetDefaultPrinter "\\eur\CPH-HpMainPrinter"
Case "WORKERB"
WSHNetwork.MapNetworkDrive "w:", "\\Server\Shared Documents",True
WSHNetwork.SetDefaultPrinter "\\ServerName\PrinterName"
End Select
Next
'Add On Code goes below this line
'=====================================
'=====================================
'Add On Code goes above this line
'Clean Up Memory We Used
set UserObj = Nothing
set GroupObj = Nothing
set WSHNetwork = Nothing
set DomainString = Nothing
set WSHSHell = Nothing
Set WSHPrinters = Nothing
'Quit the Script
wscript.quit