Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 219257

Re: Getting AD User attributes using plugin

$
0
0

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


Viewing all articles
Browse latest Browse all 219257

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>