{"id":263,"date":"2006-06-13T20:11:27","date_gmt":"2006-06-14T01:11:27","guid":{"rendered":"http:\/\/192.168.33.66\/wp\/?p=263"},"modified":"2006-06-13T20:11:27","modified_gmt":"2006-06-14T01:11:27","slug":"local-admin-password-problem","status":"publish","type":"post","link":"http:\/\/www.wildow.com\/blog\/?p=263","title":{"rendered":"Local Admin Password Problem"},"content":{"rendered":"<p>Local Admin Password Problem  change local admin password on multiple computers<br \/>\n<!--more--><\/p>\n<p>SysInternals offers a free too called PsPasswd <br \/>\nhttp:\/\/www.sysinternals.com\/Utilities\/PsPasswd.html , which <br \/>\nallows you to remotely reset passwords on a range of computers <br \/>\non your network. The tool will also report successes and <br \/>\nfailures of changed passwords, and allows you to run a single <br \/>\ncommand against a list of computers. Since the password is just <br \/>\nincluded within the syntax of a command that you run, it will <br \/>\nnever be stored as plain text in a batch or script file.<\/p>\n<p>To use PsPasswd, you&#8217;ll first need a list of all computers in <br \/>\nyour domain. To enumerate all computer objects in a domain, <br \/>\nyou could run this script:<\/p>\n<p>LogFile = &#8220;C:\\computers.txt&#8221;<br \/>\nConst ForWriting = 2<br \/>\nConst ADS_SCOPE_SUBTREE = 2<\/p>\n<p>Set objConnection = CreateObject(&#8220;ADODB.Connection&#8221;)<br \/>\nSet objCommand = CreateObject(&#8220;ADODB.Command&#8221;)<br \/>\nobjConnection.Provider = &#8220;ADsDSOObject&#8221;<br \/>\nobjConnection.Open &#8220;Active Directory Provider&#8221;<\/p>\n<p>Set objCOmmand.ActiveConnection = objConnection<br \/>\nobjCommand.CommandText = _<br \/>\n   &#8220;Select Name, Location from &#8216;LDAP:\/\/DC=mcpmag,DC=com&#8217; &#8221; _<br \/>\n   &#038; &#8220;Where objectClass=&#8217;computer'&#8221;<br \/>\nobjCommand.Properties(&#8220;Page Size&#8221;) = 1000<br \/>\nobjCommand.Properties(&#8220;Searchscope&#8221;) = ADS_SCOPE_SUBTREE<br \/>\nSet objRecordSet = objCommand.Execute<br \/>\nobjRecordSet.MoveFirst<\/p>\n<p>Set objFSO =<br \/>\nCreateObject(&#8220;Scripting.FileSystemObject&#8221;)<br \/>\nSet objFile = objFSO.CreateTextFile(LogFile, ForWriting)<\/p>\n<p>Do Until objRecordSet.EOF<br \/>\n   objFile.WriteLine objRecordSet.Fields(&#8220;Name&#8221;).Value<br \/>\n   objRecordSet.MoveNext<br \/>\nLoop<\/p>\n<p>Note that the script will output to a file named &#8220;computers.txt&#8221; <br \/>\non the C drive. This could be changed by editing the LogFile <br \/>\nvariable assignment in the first line of the script. Note that <br \/>\nin your environment, you will also need to change the domain <br \/>\nreferenced in line 12. In my example, I use mcpmag.com <br \/>\n(DC=mcpmag,DC=com).<\/p>\n<p>Once you have a list of all computers, you can then run <br \/>\npspasswd.exe to change the local administrator password on <br \/>\nall systems in the list. Here&#8217;s the syntax that I used on my<br \/>\ntest network:<\/p>\n<p>pspasswd.exe @c:\\computers.txt administrator P@ssword!<\/p>\n<p>Following the @ symbol in the command syntax is the path to <br \/>\nthe file containing all computer names. The next part of the <br \/>\nsyntax is the name of the account whose password will be <br \/>\nchanged, followed by the new password (P@ssword!).<\/p>\n<p>Now here is the output that was generated from the command:<\/p>\n<p>PsPasswd v1.21 &#8211; Local and remote password changer<br \/>\nCopyright (C) 2003-2004 Mark Russinovich<br \/>\nSysinternals &#8211; www.sysinternals.com<\/p>\n<p>\\\\PC1:<br \/>\nError changing password:<br \/>\nThe network path was not found.<\/p>\n<p>\\\\BSODME:<br \/>\nPassword for BSODME\\administrator successfully changed.<\/p>\n<p>Since the output will list both success and failures, you will <br \/>\nbe able to note the systems in which the password was not <br \/>\nsuccessfully changed. In my case, the system named PC1 was not <br \/>\nlocated. So I would have to ensure that PC1 was online and then <br \/>\nrun the command a second time. (Note that PsPasswd can also be <br \/>\nrun against a single computer.) Since the command relies on UNC <br \/>\npaths to connect to systems, you will need to ensure that the <br \/>\ntarget systems have File and Print Sharing enabled and that File <br \/>\nand Print Sharing is not being blocked by the system&#8217;s firewall. <br \/>\nBy default, the Windows XP Pro SP2 firewall does not allow File <br \/>\nand Print sharing. However, this can be quickly changed via <br \/>\nGroup Policy.<\/p>\n<p>As you can see, with a simple list of computers on your network, <br \/>\nremotely changing the local administrator password using PsPasswd <br \/>\nis a relatively painless process.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Local Admin Password Problem change local admin password on multiple computers<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-263","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/263","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=263"}],"version-history":[{"count":0,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/263\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=263"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=263"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=263"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}