Glad to hear it helped.

It seemed like this had to have been done before in a UDF, so I searched and it appears that all the group functions are based on the NT provider and not LDAP. With that in mind I went ahead and merged the code into a new UDF called GetADUserGroups() - http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=198609#Post198609

To simplify your code above, it would be
 Code:
for each $groupname in GetADUserGroups($Credentials)
  if $groupname="MIG User Group"
      use R: /DELETE
      use R: "\\server\volume" /user:$Credentials /password:$PW
  endif
  if $groupname="Local Machine Admin"
      use Z: /DELETE
      use Z: "\\server\volume"  /user:$Credentials /password:$PW
  endif
next


Also... curious why you don't use kix for the vast majority of the script. Specifically, I don't see any reason why you have to map your drives in the batch.
_________________________
(... better days ahead)