Access denied error
<p>i created a web application on (Machine 1) and published it in IIS 7 (this machine running windows server 2008),from another machine (machine 2) running windows 2008 i send url string to create local windows account on the other machine (i.e machine1) but i always get access denied error.</p>

<p>here th code snippet of create user account on machine1</p>

<pre><code>  protected void Page_Load(object sender, EventArgs e)
{
    try
    {

        if (Request.QueryString["UserName"] != null)
        {
            if (createUserAccount(Decrypt(HttpUtility.UrlDecode(Request.QueryString["UserName"].ToString())), Decrypt(HttpUtility.UrlDecode(Request.QueryString["Password"].ToString())), Convert.ToDateTime(HttpUtility.UrlDecode(Request.QueryString["ExpireDate"].ToString()))))
                Response.Write("user created successfuly");
            else
                Response.Write("failed");
        }
        else if (Request.QueryString["Account"] != null)
        {
            if(ChangeExpirationDate(Decrypt(HttpUtility.UrlDecode(Request.QueryString["Account"].ToString())),Convert.ToDateTime(HttpUtility.UrlDecode(Request.QueryString["newExpireDate"].ToString()))))
                Response.Write("expiration date was updated successfuly");
            else
                Response.Write("failed");
        }

    }
    catch (Exception)
    {

        Response.Redirect("AccessDeniedPage.aspx");
    }

}
Boolean createUserAccount(String User, String Pass,DateTime expirationDate)
{
    try
    {
        String currentuser=Environment.UserName;//IUSER
        DirectoryEntry AD = new DirectoryEntry("WinNT://" + Environment.MachineName + ",computer");

        DirectoryEntry NewUser = AD.Children.Add(User, "user");
        NewUser.Invoke("SetPassword", new object[] { Pass });
        NewUser.Invoke("Put", new object[] { "Description", "Virtual account to connect to PLC LAB" });
        NewUser.Invoke("Put", new object[] { "AccountExpirationDate", expirationDate });

        NewUser.CommitChanges();
        DirectoryEntry grp;
        grp = AD.Children.Find("Administrators", "group");
        if (grp != null)
        {
            grp.Invoke("Add", new object[] { NewUser.Path.ToString() });
        }
        return true;
    }
    catch (Exception exception)
    {
        return false;

    }
}
</code></pre>

<p>please help</p>
