• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Getting DisplayName out of Active Directory using JScript

Joined
Apr 8, 2006
Messages
714 (0.11/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.
 

Solaris17

Super Dainty Moderator
Staff member
Joined
Aug 16, 2005
Messages
25,774 (3.79/day)
Location
Alabama
System Name Rocinante
Processor I9 14900KS
Motherboard EVGA z690 Dark KINGPIN (modded BIOS)
Cooling EK-AIO Elite 360 D-RGB
Memory 64GB Gskill Trident Z5 DDR5 6000 @6400
Video Card(s) MSI SUPRIM Liquid X 4090
Storage 1x 500GB 980 Pro | 1x 1TB 980 Pro | 1x 8TB Corsair MP400
Display(s) Odyssey OLED G9 G95SC
Case Lian Li o11 Evo Dynamic White
Audio Device(s) Moondrop S8's on Schiit Hel 2e
Power Supply Bequiet! Power Pro 12 1500w
Mouse Lamzu Atlantis mini (White)
Keyboard Monsgeek M3 Lavender, Akko Crystal Blues
VR HMD Quest 3
Software Windows 11
Benchmark Scores I dont have time for that.
Joined
Apr 8, 2006
Messages
714 (0.11/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
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

Senior Monkey Moderator
Joined
Feb 6, 2007
Messages
13,817 (2.21/day)
Location
Cheeseland (Wisconsin, USA)
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 :)
 
Joined
Apr 8, 2006
Messages
714 (0.11/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
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

Senior Monkey Moderator
Joined
Feb 6, 2007
Messages
13,817 (2.21/day)
Location
Cheeseland (Wisconsin, USA)
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).
 
Joined
Apr 8, 2006
Messages
714 (0.11/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
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

Senior Monkey Moderator
Joined
Feb 6, 2007
Messages
13,817 (2.21/day)
Location
Cheeseland (Wisconsin, USA)
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:
 
Joined
Apr 8, 2006
Messages
714 (0.11/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
i know but i've not been able to switch off yet, never mind i'll annoy you guys on monday then
 
Joined
Apr 8, 2006
Messages
714 (0.11/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
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:
Top