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
"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"
objNetwork.AddWindowsPrinterConnection "\\server1\PPROG"
objNetwork.SetDefaultPrinter "\\server1\PPROG"
End If