OrionCookies
Programmer
I am trying to migrate printer from old server to new.
this script works fine if found no Fully qualified domain name print que.
But won't migrate if script find any FQDN.
So, if ECHO objPrinter.Name, and printer has FQDN name, it won't echo me back.
is there any way i can read FQDN name of the printer...
'****************************************************************
strComputer = "."
Set objNetwork = WScript.CreateObject("WScript.Network")
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colPrinters = objWMIService.ExecQuery _
("Select * From Win32_Printer Where Local = False")
NewpthName = "\\abc.def.ghi.corp\"
On Error Resume Next
For Each objPrinter in colPrinters
wscript.echo objPrinter.name
pthLength = Len(objPrinter.Name)
midSlash = InStr(3,objPrinter.Name,"\")
serverpth = Left(objPrinter.Name,midSlash-1)
PtrName = Right(objPrinter.Name,pthLength-midSlash)
lserverpth = lcase(serverpth)
next
this script works fine if found no Fully qualified domain name print que.
But won't migrate if script find any FQDN.
So, if ECHO objPrinter.Name, and printer has FQDN name, it won't echo me back.
is there any way i can read FQDN name of the printer...
'****************************************************************
strComputer = "."
Set objNetwork = WScript.CreateObject("WScript.Network")
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colPrinters = objWMIService.ExecQuery _
("Select * From Win32_Printer Where Local = False")
NewpthName = "\\abc.def.ghi.corp\"
On Error Resume Next
For Each objPrinter in colPrinters
wscript.echo objPrinter.name
pthLength = Len(objPrinter.Name)
midSlash = InStr(3,objPrinter.Name,"\")
serverpth = Left(objPrinter.Name,midSlash-1)
PtrName = Right(objPrinter.Name,pthLength-midSlash)
lserverpth = lcase(serverpth)
next