Jump to content

Using Java Script to get AD Usernames insert into html page


Recommended Posts

I'm trying to use Java Script to get AD Usernames insert into html page so far i've got this point, and i'm able to insert the text, but i not able to get auything from AD. can anyone help?

<HTML>
<HEAD>
<script language=javascript>
<!--
var username = "UserName";
var hostname = "DomainName";
var linktext = username + "@" + hostname;
document.write("<a href=" + "mail" + "tox" + username + "@" + hostname + ">" + linktext + "</a>")
-->
</script>
</HEAD>
</HTML>

Link to comment
Share on other sites


I'm getting there, but now i need to get the displayname (or first and last name) from AD and i'll having no joy as i do not know the syntax for this.

any help please?

<HTML>
<HEAD>
<script language=javascript>
<!--
var wshshell = new ActiveXObject("wscript.shell");
var username = wshshell.ExpandEnvironmentStrings("%username%");
var displayName =
var hostname = "hostname";
var linktext = username + "@" + hostname;
document.write(displayName + "<br>")
document.write("<a href=" + "mail" + "tox" + username + "@" + hostname + ">" + linktext + "</a>")
-->
</script>
</HEAD>
</HTML>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...