<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Security</title><link>http://forums.asp.net/25.aspx</link><description>All about ASP.NET security (authentication, authorization, membership, roles, etc.) and the Login controls. &lt;a href="http://aspadvice.com/SignUp/list.aspx?l=24&amp;c=17" target="_blank"&gt;Email List&lt;/a&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Help with impersonate - remotely resetting password</title><link>http://forums.asp.net/thread/1937416.aspx</link><pubDate>Tue, 02 Oct 2007 19:58:56 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1937416</guid><dc:creator>banging</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1937416.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1937416</wfw:commentRss><description>&lt;p&gt;Hard coding the user in the webconfig file worked.&amp;nbsp; I wish I could figure out why it&amp;#39;s not passing along the windows credentials but it does work.&amp;nbsp; Thanks very much for your help.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Help with impersonate - remotely resetting password</title><link>http://forums.asp.net/thread/1921237.aspx</link><pubDate>Fri, 21 Sep 2007 19:57:13 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1921237</guid><dc:creator>tsm</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1921237.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1921237</wfw:commentRss><description>&lt;p&gt;Another thing you can try is hardcoding the impersonation identity into your web.config file.&lt;/p&gt;</description></item><item><title>Re: Help with impersonate - remotely resetting password</title><link>http://forums.asp.net/thread/1921177.aspx</link><pubDate>Fri, 21 Sep 2007 19:01:45 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1921177</guid><dc:creator>banging</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1921177.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1921177</wfw:commentRss><description>&lt;p&gt;Thanks for the reply!&amp;nbsp; I do have anonymous access disabled and using integrated windows authentication.&amp;nbsp; It is running under the right account but seems to use the anomyous account when it leaves the asp server and goes out to a remote box.&amp;nbsp; &lt;/p&gt;</description></item><item><title>Re: Help with impersonate - remotely resetting password</title><link>http://forums.asp.net/thread/1919625.aspx</link><pubDate>Fri, 21 Sep 2007 01:36:29 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1919625</guid><dc:creator>tsm</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1919625.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1919625</wfw:commentRss><description>&lt;p&gt;Try disabling anonymous access in IIS.&amp;nbsp; I don&amp;#39;t think anonymous access would have rights to reset an administrator account.&amp;nbsp;&amp;nbsp;Eventhough you are using an account with sufficient rights, I believe if anonymous access and impersonation&amp;nbsp;are&amp;nbsp;enabled then the request is made with the IUSR_mahinename account.&lt;/p&gt;</description></item><item><title>Help with impersonate - remotely resetting password</title><link>http://forums.asp.net/thread/1918889.aspx</link><pubDate>Thu, 20 Sep 2007 16:27:19 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1918889</guid><dc:creator>banging</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1918889.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1918889</wfw:commentRss><description>&lt;p&gt;Hi,&amp;nbsp; I&amp;#39;m porting a vbscript to asp.net and have this remote password reset tool working only if I&amp;#39;m logged into the computer and running it from there.&amp;nbsp; If I access the page from a different box it fails to bind to another workstation.&amp;nbsp; Basically, the program loops through a text file with computer names and resets the administrator account. I&amp;#39;m&amp;nbsp;logging in with&amp;nbsp;impersonate and windows authentication that has rights to reset the administrator account.&amp;nbsp; It works great when rdp&amp;#39;d into the web server but not from my desktop.&amp;nbsp; The security logs on the remote pc&amp;#39;s whose password I&amp;#39;m trying to reset shows successfull anonymous access but not account change.&amp;nbsp; I&amp;#39;m sure that the program is using the account that has admin privleges but it seems that it&amp;#39;s not using that acct. to bind to the pc&amp;#39;s and reset the admin acct.&lt;/p&gt;
&lt;p&gt;web config file snippet&lt;/p&gt;&amp;nbsp;&lt;font color="#0000ff" size="2"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;authentication&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;mode&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;font size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Windows&lt;/font&gt;&lt;font size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;/&amp;gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt; 
&lt;p&gt;&amp;lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;identity&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;impersonate&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt; = &lt;/font&gt;&lt;font size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;true&lt;/font&gt;&lt;font size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt; /&amp;gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;partial reset code&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Do&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Until&lt;/font&gt;&lt;font size="2"&gt; serverlist.EndOfStream&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&amp;#39;assign the variable host to represent a line in the text file, which is a server&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Try&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;host = serverlist.ReadLine&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Catch&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;Logfile.WriteLine(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;error reading serverlist.txt file, &amp;quot;&lt;/font&gt;&lt;font size="2"&gt; &amp;amp; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Date&lt;/font&gt;&lt;font size="2"&gt;.Now)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;lblUploadStatus.Text = &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;Error reading serverlist.txt file, check the file&amp;quot;&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Exit&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Sub&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;End&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Try&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&amp;#39;bind with adsi to the user account on the server&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Try&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;user = GetObject(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;WinNT://&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; &amp;amp; host &amp;amp; &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; &amp;amp; useraccount)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;Logfile.WriteLine(host &amp;amp; &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;,success,&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; &amp;amp; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Date&lt;/font&gt;&lt;font size="2"&gt;.Now)&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Catch&lt;/font&gt;&lt;font size="2"&gt; ex &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; System.Exception&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&amp;#39;MsgBox(&amp;quot;An exception occurred:&amp;quot; &amp;amp; &amp;quot; for &amp;quot; &amp;amp; host &amp;amp; vbCrLf &amp;amp; ex.Message)&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;Logfile.WriteLine(host &amp;amp; &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;, failure,&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; &amp;amp; ex.Message &amp;amp; &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;,&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; &amp;amp; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Date&lt;/font&gt;&lt;font size="2"&gt;.Now)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;End&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Try&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&amp;#39;change the password to the new password&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Try&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;user.SetPassword(confirmpassword)&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Catch&lt;/font&gt;&lt;font size="2"&gt; ex &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; Exception&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&amp;#39;Logfile.WriteLine(host &amp;amp; &amp;quot;, change password failure,&amp;quot; &amp;amp; Date.Now)&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;End&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Try&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&amp;#39;confirm the password change&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Try&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;user.SetInfo()&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&amp;#39;Logfile.WriteLine(host &amp;amp; &amp;quot;, set password success,&amp;quot; &amp;amp; Date.Now)&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Catch&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&amp;#39;Logfile.WriteLine(host &amp;amp; &amp;quot;, set password failure,&amp;quot; &amp;amp; Date.Now)&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;End&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Try&lt;/p&gt;&lt;/font&gt;</description></item></channel></rss>