Sign in to follow this  
Followers 0
bourny

Please help with ADFunctions

2 posts in this topic

I am looking to detect from a specific OU in my AD structure which users are mail enabled (Exchange mailbox enabled) I have used the ADFunctions before but cannot find a function that will suit this job.. I am sure there will be a way to do it..

Any help appreciated.

Share this post


Link to post
Share on other sites



I haven't tried it myself ... but at http://www.codeproject.com/KB/vbscript/ExchangeMailBox.aspx they check attribute HomeMDB to see if a user is mailbox enabled.

So with ADFunctions your code would look like:

#Include <adfunctions.au3>
Global $ADUsertab[1]
; Get all Users in OU
_ADGetObjectsInOU($ADUserTab, "<your OU>",  "(&(objectCategory=user))", 2, "sAMAccountName")
; Check if mail enabled
_ArrayDisplay($ADUserTab)
For $i = 1 To $ADUserTab[0]
  ConsoleWrite($ADUserTab[$i] & "  " & _ADGetObjectAttribute($ADUserTab[$i],"HomeMDB") & @CRLF)
Next
If it returns "" or 0 then the Attribute is not set = no Mailbox.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0