Thanks for your response

My Kix programming skills are far from perfect all i need to do is Map drives and create printer connections via the OU i have created the code using groups but my IT director will only use Kix if we can use OUs instead of groups for these functions. i thought it would be simple like bellow

Code:
 

break on

If InContainer('ou=Users,ou=Information Technology,OU=Dublin,dc=lab,dc=iconcr,dc=com','User')[0]
? 'T: (\\shortts\DATA)'
Use T: '\\shortts\DATA'
EndIf


But obviously I’m wrong and it is more complex, Sorry to be a pain but I would love to get this working at the moment there using Bach files Mate

Above I have the bath of the distinguished name of the user location how would the code fit