Ok. Back to the original question, "how to get attributes out of AD for a user?"
I have attached 2 test flows to get an attribute.
TEMP_getAdUserAttribute: (*** need to set the input adUser ***) - This flow works
System.log("aduser: " + adUser); var attribs = adUser.allAttributes; System.log("attribs: " + attribs); System.log("========== All Attributes ==========="); for each (attrib in attribs){ if (attrib.name == "mail") { System.log("attribute: "+attrib.name+ "("+adUser.getAttribute(attrib.name)+")"); } }
TEST_EmailActions: (*** do not set the input adUser ***) - this fails with: "attribs: undefined" [basically it has an issue with the attribs array]
requester = Server.getCurrentLdapUser().displayName; System.log("requester: " + requester); requesterLogin = Server.getCurrentLdapUser().loginName; System.log("requesterLogin: " + requesterLogin); targetUser = ActiveDirectory.searchExactMatch("User", requesterLogin); System.log("targetUser: " + targetUser); adUser = targetUser; System.log("adUser: " + adUser); var attribs = adUser.allAttributes; System.log("attribs: " + attribs); System.log("============= Returned Attributes ==============="); for each (attrib in attribs){ if (attrib.name == "mail") { System.log("attribute: "+attrib.name+ "("+adUser.getAttribute(attrib.name)+")"); } }
I cannot figure out why it works in one workflow and not the other.
Any suggestions?
Thanks
B