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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBScript error message

Status
Not open for further replies.

scloan

MIS
Joined
Feb 17, 1999
Messages
9
Location
US
I am trying to run the following vbscript and when I do I get an error message referring to line 10, saying;
"the remote server machine does not exist or is unavailable."
I have no clue why. Any help would be appreciated.
Option Explicit

Dim objNetwork, objSysInfo, strUserDN
Dim objGroupList, objUser, objFSO
Dim strComputerDN, objComputer

Set objNetwork = CreateObject("Wscript.Network")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objSysInfo = CreateObject("ADSystemInfo")
strUserDN = objSysInfo.userName
strComputerDN = objSysInfo.computerName
'wscript.Echo
' Bind to the user and computer objects with the LDAP provider.
Set objUser = GetObject("LDAP://" & strUserDN)
Set objComputer = GetObject("LDAP://" & strComputerDN)


' Add a network printer if the user is a member of the group.
' Make this printer the default.
If IsMember(objUser, "ptest") Then
objNetwork.AddWindowsPrinterConnection "\\server1\PPROG"
objNetwork.SetDefaultPrinter "\\server1\PPROG"
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top