• We've upgraded our forums. Please post any issues/requests in this thread.

Getting DisplayName out of Active Directory using JScript

Joined
Apr 8, 2006
Messages
714 (0.17/day)
Likes
11
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
#1
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

Creator Solaris Utility DVD
Joined
Aug 16, 2005
Messages
19,263 (4.28/day)
Likes
6,069
Location
Florida
System Name Not named yet
Processor I5 7640x 5Ghz 24/7
Motherboard MSI x299 Tomahawk Arctic
Cooling Corsair H55
Memory 32GB Corsair DDR4 3000mhz
Video Card(s) Gigabyte 1080TI
Storage 2x Seagate 3TB Drives (RAID 0) 1x Seagate 256GB SSD 1x Adata 120GB SSD
Display(s) 3x AOC Q2577PWQ
Case Inwin 303 White (Thermaltake Ring 120mm Purple accent)
Audio Device(s) Onboard on Audio-Technica ATH-AG1
Power Supply Seasonic 1050W Snow
Mouse Roccat Tyon White
Keyboard Ducky Shine 6
Software Windows 10 x64 Pro
Joined
Apr 8, 2006
Messages
714 (0.17/day)
Likes
11
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
#4
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
Staff member
Joined
Feb 6, 2007
Messages
13,817 (3.49/day)
Likes
5,524
Location
Cheeseland (Wisconsin, USA)
Processor Intel Core 2 Quad QX9650 Extreme @ 3.0 GHz
Motherboard Asus Rampage Formula
Cooling ZeroTherm Nirvana NV120 Premium
Memory 8GB (4 x 2GB) Corsair Dominator PC2-8500
Video Card(s) 2 x Sapphire Radeon HD6970
Storage 2 x Seagate Barracuda 320GB in RAID 0
Display(s) Dell 3007WFP 30" LCD (2560 x 1600)
Case Thermaltake Armor w/ 250mm Side Fan
Audio Device(s) SupremeFX 8ch Audio
Power Supply Thermaltake Toughpower 750W Modular
Software Win8 Pro x64 / Cat 12.10
#5
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.17/day)
Likes
11
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
#6
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
Staff member
Joined
Feb 6, 2007
Messages
13,817 (3.49/day)
Likes
5,524
Location
Cheeseland (Wisconsin, USA)
Processor Intel Core 2 Quad QX9650 Extreme @ 3.0 GHz
Motherboard Asus Rampage Formula
Cooling ZeroTherm Nirvana NV120 Premium
Memory 8GB (4 x 2GB) Corsair Dominator PC2-8500
Video Card(s) 2 x Sapphire Radeon HD6970
Storage 2 x Seagate Barracuda 320GB in RAID 0
Display(s) Dell 3007WFP 30" LCD (2560 x 1600)
Case Thermaltake Armor w/ 250mm Side Fan
Audio Device(s) SupremeFX 8ch Audio
Power Supply Thermaltake Toughpower 750W Modular
Software Win8 Pro x64 / Cat 12.10
#7
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.17/day)
Likes
11
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
#8
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
Staff member
Joined
Feb 6, 2007
Messages
13,817 (3.49/day)
Likes
5,524
Location
Cheeseland (Wisconsin, USA)
Processor Intel Core 2 Quad QX9650 Extreme @ 3.0 GHz
Motherboard Asus Rampage Formula
Cooling ZeroTherm Nirvana NV120 Premium
Memory 8GB (4 x 2GB) Corsair Dominator PC2-8500
Video Card(s) 2 x Sapphire Radeon HD6970
Storage 2 x Seagate Barracuda 320GB in RAID 0
Display(s) Dell 3007WFP 30" LCD (2560 x 1600)
Case Thermaltake Armor w/ 250mm Side Fan
Audio Device(s) SupremeFX 8ch Audio
Power Supply Thermaltake Toughpower 750W Modular
Software Win8 Pro x64 / Cat 12.10
#9
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.17/day)
Likes
11
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
#10
i know but i've not been able to switch off yet, never mind i'll annoy you guys on monday then
 

cjoyce1980

New Member
Joined
Apr 8, 2006
Messages
714 (0.17/day)
Likes
11
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
#11
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: