View Full Version : Getting DisplayName out of Active Directory using JScript
cjoyce1980
11-30-2007, 02:06 PM
Does anyone know how to get DisplayName out of Active Directory using JScript
Would like to intergrate this is into a html page, so the user currently in session would have there DisplayName on show.
Solaris17
11-30-2007, 03:03 PM
http://techrepublic.com.com/5208-11184-0.html?forumID=57&threadID=187339&messageID=1919069?
Namslas90
11-30-2007, 03:11 PM
Try here;
http://www.microsoft.com/technet/scriptcenter/scripts/jscript/default.mspx?mfr=true
:toast:
cjoyce1980
11-30-2007, 05:06 PM
thanks guys but i hit both of those sources early and i'm still having no luck, i guess i'll still have to keep googling!
Kreij
11-30-2007, 05:17 PM
This Link (http://searchwincomputing.techtarget.com/tip/0,289483,sid68_gci1215538,00.html) seems to be more complete than the others.
It is in VBS, but the port to JScript should not be to hard.
Hope it helps :)
cjoyce1980
11-30-2007, 05:21 PM
its a little above and beyond what i need to do, but it's still not returning me the display. I'm getting the FQ user name (i.e. cn=user, ou=users, dn=domain, dn=com)
Kreij
11-30-2007, 05:29 PM
Why don't you paste your code here so we can take a look at it.
We love to help people with code problems (or at least I do).
cjoyce1980
11-30-2007, 05:36 PM
Why don't you paste your code here so we can take a look at it.
We love to help people with code problems (or at least I do).
i wish i could give you my code, but i left work about 2 hours ago and silly me the code is on my pc's HDD and i can't remote wake it up :cry:
Kreij
11-30-2007, 05:39 PM
Lol ... I've been in that situation before.
Oh well, it's the weekend and you should be planning on doing something entertaining, not worrying about code that will certainly wait until Monday. :toast:
cjoyce1980
11-30-2007, 06:01 PM
i know but i've not been able to switch off yet, never mind i'll annoy you guys on monday then
cjoyce1980
12-03-2007, 09:23 AM
Right, here is my code currently.
What i'm trying to do it is to make a small javascript within a html signature, so that my exhange email clients (outlook) all have the same disclaimer apart from there AD display name and email address.
so the output should look something like this:
Joe Brown
joe@mydomain.com
I can do the email address part (which is simply the users name and the domain name), but i'm not able to get the displayname out of AD.
<HTML>
<HEAD>
<script language=javascript>
<!--
var wshshell = new ActiveXObject("wscript.shell");
var username = wshshell.ExpandEnvironmentStrings("%username%");
var hostname = "domainame";
var linktext = username + "@" + hostname;
document.write(displayname + "<br>")
document.write("<a href=" + "mail" + "to:" + username + "@" + hostname + ">" + linktext + "</a>")
-->
</script>
</HEAD>
</HTML>
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.