Hi, I am trying to output 2 figures from AD The First is to count how many users in AD have the String OU=C3084* in the Distinguished name attribute and the second is of the first output how many have them have the mail attribute set. I have read what feels like the entire internet about adfunctions but im not sure how to start Can anyone point me in the right direction please I was trying to run a query like this $objCommand.CommandText = "<LDAP://" & $strDNSDomain &