Thank you Richard for you script. Below is the function that I am now using taken from it. I am now able to populate the drop lists based on the site and then after clicking on a button the printers both install. Excellent. Now, I have a problem. When the script runs in the live environment, it runs on a pc that is not on the Domain yet. Therefore, i get an access denied when it comes to getting the printers list. Now in the utility I have created, the engineer puts in his account details before putting the computer on the domain. Is there anyway, to get the below function to use these credentials?
Code:
Function ShowPrinters()
$Printer1.clear
$Printer2.clear
Global $__SERVER_PRINT,$__DOMAIN_PRINT
GLOBAL $oWinNT
$SitePrinter = readprofilestring("C:\Store\ADScript\sites.ini",$OU.Text,"PrinterPath")
$__DOMAIN_PRINT="MyDomain"
$__SERVER_PRINT=$SitePrinter
$oWinNT=GetObject("WinNT://"+$__DOMAIN_PRINT+"/"+$__SERVER_PRINT+",computer")
$oWinNT.Filter = "PrintQueue",""
; Add all printers - already mapped printers to "connected" otherwise to "available"
For Each $oPrintQueue In $oWinNT
$Printer1.additem($oPrintQueue.Name)
$Printer2.additem($oPrintQueue.Name)
Next
EndFunction