Map af printer udfra AD gruppe.
Jeg har lavet denne kode og det virker næsten osse. Hvis en bruger skal have flere end én printer, måske 3, så er det ligesom om at det kun er én man får. Koden er indsat i vores loginscript, men jeg frygter at det er fordi at login scriptet bliver gennemført for hurtigt. Er der nogen der kan give et bud hvad problemet er?Sub AddPrinters
On Error Resume Next
Dim x, PrintGroups
PrintGroups = Array("CP001","CP004","CP007","CP008","CP009","CP012","CP013","CP014","CP021","CP022","CP023","CP024","P170C","P200","P201","P205","P230", _
"P231","P235","P238","P265","P267","P270","P277","P278","P281","P285","P288","P290","P296","P301","P303","P305","P306","P315","P317","P318","P319","P324", _
"P326","P327","P330","P331","P333","P334","P335","P337","P341","P343","P344","P345","P346","P347","P348","P349","P351","P352","P353","P354","P355","P356",_
"P357","P358","P359","P360","P361","P400")
for each x in PrintGroups
Call AddPrinterByGroup("PRINTER_GRUPPE" & x,"\\servernavn\" & x & "-64bit")
next
if DebugMode = "Yes" Then
MsgBox("AddPrinters sub works.")
End If
End Sub 'AddPrinters
Sub AddPrinterByGroup(ADPrnGroupName,PrinterName)
If ADHelper.IsCurrentUserMember(ADPrnGroupName) then
lWSHNetworkPrn.AddWindowsPrinterConnection PrinterName
End If
End Sub 'AddPrinterByGroup