Hi !
How to enumerate AD multivalue property values using JScript ?
Example:
try
{
var obj_network = WScript.CreateObject("WScript.Network");
var obj_dc = GetObject("LDAP://" + obj_network.ComputerName + "/RootDSE");
var obj_root = GetObject("LDAP://RootDSE");
obj_root.GetInfo();
for(index = 0; index < obj_root.PropertyCount; index++)
{
var obj_property = obj_root.Item(index);
if(obj_property.name == "namingContexts") // multivalue attribute
{
WScript.Echo(obj_property.name); // o'kay
var property_value;
for(property_value in obj_property.values)
{
// DC has several naming contexts but this code never
execute :(
var str_result = property_value.CaseIgnoreString()
WScript.Echo(str_result);
}
}
}
}
catch(e)
{
WScript.Echo(e.description);
}
P.S. I know how to do this in VBScript but I need use JScript...
List info : http://www.activedir.org/mail_list.htm
List FAQ : http://www.activedir.org/list_faq.htm
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/