|
-
Aug 24th, 2009, 01:35 PM
#1
Thread Starter
New Member
Network Printer Logon Script
I'm running a Win2008 domain, and have a User-based logon GPO referencing a VB
script which shares several network printers, each shared from a single file
server. This GPO applies to "Domain Users." My issue is that if I delete a the shared printer off the GPO (and server too), it remains on the client workstations, confusing the end users. What's the best way to remove an old network printer from workstations?
Here's the current logon script:
MapPrinter "\\DC1\HPLJ2300N"
MapPrinter "\\DC1\DELL1710N"
MapPrinter "\\DC1\DELL3100CN"
Sub MapPrinter(strPrinter)
On Error Resume Next
Set objNetwork = CreateObject("WScript.Network")
boolConnected = False
intAttempts = 1
While boolConnected = False And intAttempts <= 10
Err.Clear
objNetwork.AddWindowsPrinterConnection strPrinter
If Err.Number <> 0 Then
intAttempts = intAttempts + 1
WScript.Sleep 2000
Else
boolConnected = True
End If
Wend
Err.Clear
On Error GoTo 0
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|