• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.
  • The forums have been upgraded with support for dark mode. By default it will follow the setting on your system/browser. You may override it by scrolling to the end of the page and clicking the gears icon.

Getting DisplayName out of Active Directory using JScript

Joined
Apr 8, 2006
Messages
714 (0.10/day)
System Name Xbox 360 Super Elite
Processor 3.2GHz PowerPC Tri-Core Xenon
Memory 512MB 700MHz GDDR3 RAM
Video Card(s) ATI Xenos @ 500 MHz
Storage 250GB
Display(s) 26" Samsung LCD HDTV
Case Super Elite (COD:MW2 Edition)
Audio Device(s) 5.1
Power Supply 120w
Software NXE
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.
 
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!
 
This Link 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 :)
 
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)
 
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).
 
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:
 
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:
 
i know but i've not been able to switch off yet, never mind i'll annoy you guys on monday then
 
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.

Code:
<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>
 
Last edited:
Back
Top