Hi Pankajmcp, if your printers are published in AD on the sharing options, you can use something like this:
Const ADS_SCOPE_SUBTREE = 2
set WN = CreateObject("WScript.Network")
set ADConnection = CreateObject("ADODB.Connection")
set ADCommand = CreateObject("ADODB.Command")
ADConnection.Provider = "ADsDSOObject"
ADConnection.Open("Active Directory Provider")
ADCommand.ActiveConnection = ADConnection
ADCommand.Properties("Page Size") = 1000
ADCommand.Properties("Timeout") = 30
ADCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
ADCommand.Properties("Cache Results") = False
'Set Printer name to match on (change to match your printer names)
pName = "SITECODE*"
'Setup query - this is one line
ADCommand.CommandText = "Select printerName, serverName from 'LDAP://dc=yourdomain,dc=xx,dc=xx' where objectClass = 'printQueue' AND " & "printerName = '" & pName & "'"
set RecSet = ADCommand.Execute
RecSet.MoveFirst()
Do Until RecSet.EOF
WN.AddWindowsPrinterConnection("\\" & RecSet.Fields("serverName").value & "\" & RecSet.Fields("printerName").value)
recset.movenext
Loop