$mac = GetBSSID(1,@WkSta)
$location = ReadProfileString ($LogonServer+"\NETLOGON\printer.ini", $mac, "Location")
$groups = ReadProfileString ($LogonServer+"\NETLOGON\printer.ini", $mac, "Groups")
$groups = Split($groups,",")
For Each $group in $groups
If InGroup($group)
$shares = ReadProfileString ($LogonServer+"\NETLOGON\printer.ini", $mac+":"+$group, "Shares")
$shares = Split($shares,",")
$sharenum = 0
For Each $shareobj in $shares
$name = Split($shareobj,":")[0]
$share = Split($shareobj,":")[1]
If AddPrinterConnection("\\server\"+$share) = 0
If $sharenum = UBound($shares)
$null = SetDefaultPrinter("\\server\"+$name)
EndIf
Else
$null = MessageBox("2 Der er et problem med at etablerer forbindelse til : "+$share,"Printer fejl",0)
EndIf
$sharenum = $sharenum+1
Next
EndIf
Next