ADvalue
Top  Previous  Next


Returns any Active Directory object property from full name, samAccountName, UserPrincipalName or AD-path.

The function returns nothing if the property is not found or if an error occurs. Check the log window for error messages.

Tip: use the Data.Get.AD command to extract multiple values for multiple objects at once.

Requirements
·The machine on which the AdmWin executable is executed must be member of the domain from which properties are to be extracted from.  
·You must be logged on as domain administrator on the machine on which the AdmWin executable is executed.  

ADValue (Type, Name, Property)

Type
Type of identifier to get property for  
Valid options: FullName | samAccountName | UserPrincipalName | ADPath  
 
FullName = Display name, usually same as cn, example "Tom Gray" (only works with accounts)  
 
samAccountName = "NT4" name, example "MyDomain\TGray"  
 
UserPrincipalName = UPN, example "TGray@d5.mydomain.com" (only works with accounts)  
 
ADPath = Active directory path, example "dc=com/dc=acme/dc=D31/cn=users/cn=account1"  

Name
Name of object (account, group etc.) to get property for  
 
Property
Property to read  
 
The easiest way to get correct AD property names is probably to use SetupExplorer, see How to display all existing properties for one account.  
 
"ADvalue" also returns these none-standard AD properties -  
·ADpath = full AD path to object  
·ADpathContainer = full AD path to object container  
·Account flags  

Examples
Get full active directory path from UPN

Set
 ObjectPath=ADValue (UserPrincipalName,10000@d2.acme.com,ADpath)   
If "%ObjectPath%"<> Then
 MessageBox %ObjectPath%   
Else   
 MessageBox Not found
EndIf



Get loginscript from samAccountName

MessageBox ADValue (samAccountName,d2\10000,LoginScript)