Help - Search - Members - Calendar
Full Version: Using Java Script to get AD Usernames insert into html page
MSFN Forums > Coding, Scripting and Servers > Web Development (HTML, Java, PHP, ASP, XML, etc.)

   
Google Internet Forums Unattended CD/DVD Guide
cjoyce1980
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?

CODE
<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>
cjoyce1980
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?

CODE
<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>
Google Internet Forums Unattended CD/DVD Guide
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.