A
Aaron_TekRecycle.com
this runs perfectly as a .vbs but I'd like to convert it to an ASP... any
ideas?
Response.Buffer = True
Dim objConnection, objCommand, objRecordSet
Dim oPrinterName, oServerName
Const ADS_SCOPE_SUBTREE = 2
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
objCommand.CommandText = "Select printerName, serverName from " _
& " 'LDAP://DC=corp,DC=COMPANY,DC=com' where objectClass='printQueue'"
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Timeout") = 30
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand.Properties("Cache Results") = False
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
Set oPrinterName = objRecordSet.Fields("printerName").Value
Set oServerName = objRecordSet.Fields("serverName").Value
Set oServerPrinter = "\\" & oServerName & "\" & oPrinterName
'Wscript.Echo "Printer Name: " & oPrinterName & vbcr & "Server Name: " &
oServerName (for .vbs)
' Display Printers on web page (for ASP)
Response.Write "Printer Name: " & oPrinterName
Response.Write vbcrlf
Response.Write "Server Name: " & oServerName
objRecordSet.MoveNext
Loop
ideas?
Response.Buffer = True
Dim objConnection, objCommand, objRecordSet
Dim oPrinterName, oServerName
Const ADS_SCOPE_SUBTREE = 2
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
objCommand.CommandText = "Select printerName, serverName from " _
& " 'LDAP://DC=corp,DC=COMPANY,DC=com' where objectClass='printQueue'"
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Timeout") = 30
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand.Properties("Cache Results") = False
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
Set oPrinterName = objRecordSet.Fields("printerName").Value
Set oServerName = objRecordSet.Fields("serverName").Value
Set oServerPrinter = "\\" & oServerName & "\" & oPrinterName
'Wscript.Echo "Printer Name: " & oPrinterName & vbcr & "Server Name: " &
oServerName (for .vbs)
' Display Printers on web page (for ASP)
Response.Write "Printer Name: " & oPrinterName
Response.Write vbcrlf
Response.Write "Server Name: " & oServerName
objRecordSet.MoveNext
Loop