Hi Dudes and dudesses,
Please see my newly created VBS login script which I am planning on using in a Windows 2003 AD environment, Its about 75% Complete, so far the home user directory and mapped shared drives are mapping fine when user logs in, I can get the printer map working IF the printer is hosted on a dedicated server, the only problem is our domain controller is hosted in a DC up north therefore if we wanted to print, the data would have to be sent up to the DC to be processed by the print server, then back down to our network in South Wales.
As we have 2 printers in the office which both have the ability to hardcode IP addresses in them, we dont therefore need to use a print server on a dedicated server.
Please see my code below.
As you can see, the line
is in the format "\\servername\Printer Name" and this is causing a problem for us as technically the printer will not be hosted on a server.
I have also tried
but neither work, is there anyway around this? we want the deminish the server name and just connect via IP address of the printer.
Any help greatly appriciated.
Please see my newly created VBS login script which I am planning on using in a Windows 2003 AD environment, Its about 75% Complete, so far the home user directory and mapped shared drives are mapping fine when user logs in, I can get the printer map working IF the printer is hosted on a dedicated server, the only problem is our domain controller is hosted in a DC up north therefore if we wanted to print, the data would have to be sent up to the DC to be processed by the print server, then back down to our network in South Wales.
As we have 2 printers in the office which both have the ability to hardcode IP addresses in them, we dont therefore need to use a print server on a dedicated server.
Please see my code below.
Code:
' VBScipt for Windows AD-Domain user login script with mapped network drive & mapped printer support----------'
' v1.1--------------------------------------------------------------------------------------------------------'
'copyright 2009-------------------------------------------------------------------------------'
' ------------------------------------------------------------------------------------------------------------'
'On Error Resume Next
' Initialise Groups with Const statement
Const SUPPORT_GROUP = "cn=support"
Const FINANCE_GROUP = "cn=finance"
Const PROVISIONING_GROUP = "cn=provisioning"
Const SALES_GROUP = "cn=sales"
'Map Users home directory to h:\
Set wshNetwork = CreateObject("WScript.Network")
wshNetwork.MapNetworkDrive "h:", "\\***\***$\" & wshNetwork.UserName
' Create objects and extract strGroup values
Set ADSysInfo = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" & ADSysInfo.UserName)
strGroups = LCase(Join(CurrentUser.MemberOf))
If InStr(strGroups, SUPPORT_GROUP) Then
wshNetwork.MapNetworkDrive "s:", "\\***\***\"
wshNetwork.AddWindowsPrinterConnection "\\Servername\Printername\"
'wshNetWork.SetDefaultPrinter
ElseIf InStr(strGroups, FINANCE_GROUP) Then
wshNetwork.MapNetworkDrive "f:", "\\***\***\"
wshNetwork.AddWindowsPrinterConnection "\\Servername\Printername\"
'wshNetWork.SetDefaultPrinter
'"\\PrintServer\FinLaser"
ElseIf InStr(strGroups, PROVISIONING_GROUP) Then
wshNetwork.MapNetworkDrive "s:", "\\***\***\"
wshNetwork.AddWindowsPrinterConnection "\\Servername\Printername\"
'wshNetWork.SetDefaultPrinter
'"\\PrintServer\HrLaser"
ElseIf InStr(strGroups, SALES_GROUP) Then
wshNetwork.MapNetworkDrive "s:", "\\***\***\"
wshNetwork.AddWindowsPrinterConnection "\\Servername\Printername\"
'wshNetWork.SetDefaultPrinter
'"\\PrintServer\HrLaser"
End If
As you can see, the line
Code:
wshNetwork.AddWindowsPrinterConnection "\\Servername\Printername\"
is in the format "\\servername\Printer Name" and this is causing a problem for us as technically the printer will not be hosted on a server.
I have also tried
Code:
"\\Printer IP\Printer name" and also "\\Printer IP"
but neither work, is there anyway around this? we want the deminish the server name and just connect via IP address of the printer.
Any help greatly appriciated.
Last edited: