<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Edwin M Sarmiento&gt;Change the Local Administrator password on all your domain computers &#8211; Edwin M Sarmiento</title>
	<atom:link href="https://www.edwinmsarmiento.com/change-the-local-administrator-password-on-all-your-domain-computers/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.edwinmsarmiento.com</link>
	<description>Intentional Excellence</description>
	<lastBuildDate>Mon, 13 Apr 2026 21:00:49 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
<site xmlns="com-wordpress:feed-additions:1">84283043</site>		<item>
		<title>&gt;Change the Local Administrator password on all your domain computers</title>
		<link>https://www.edwinmsarmiento.com/change-the-local-administrator-password-on-all-your-domain-computers/</link>
		<comments>https://www.edwinmsarmiento.com/change-the-local-administrator-password-on-all-your-domain-computers/#respond</comments>
		<pubDate>Wed, 21 Nov 2007 05:52:00 +0000</pubDate>
		<dc:creator>Edwin M Sarmiento</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://bassplayerdoc.wordpress.com/2007/11/21/change-the-local-administrator-password-on-all-your-domain-computers</guid>

				<description><![CDATA[&#62;Imagine this &#8211; 200 servers and 1,500 workstations. How would you change the local Administrator password (or any other account which you use to administer the local machine)? Being the lazy guy as I always have been, I don&#8217;t want to do things which would be repetitive so I wrote a script. This uses a [&#8230;]]]></description>
					<content:encoded><![CDATA[<p>&gt;<span style="font-family:arial;">Imagine this &#8211; 200 servers and 1,500 workstations. How would you change the local Administrator password (or any other account which you use to administer the local machine)? Being the lazy guy as I always have been, I don&#8217;t want to do things which would be repetitive so I wrote a script. This uses a list of servers and workstations stored in a text file named <strong><span style="font-size:85%;">computerList.txt</span></strong> (you can use either hostnames or IP addresses although I prefer IP) and generates a <strong><span style="font-size:85%;">CSV</span></strong> file which I can use as a report. </span></p>
<p><strong><span style="font-size:85%;color:#000099;">Dim loopCount, directory, objFSO,objFile,objFSO2,objFile2</span></strong></p>
<p></p>
<p><strong><span style="font-size:85%;color:#000099;">&#8216;Gets the directory where our script is running from<br />directory = CreateObject(&#8220;Scripting.FileSystemObject&#8221;).GetParentFolderName(Wscript.ScriptFullName)</span></strong></p>
<p></p>
<p><strong><span style="font-size:85%;color:#000099;">Set objFSO = CreateObject(&#8220;Scripting.FileSystemObject&#8221;)<br />Set objFile = objFSO.OpenTextFile(directory &amp; &#8220;computerList.txt&#8221;, 1)</span></strong></p>
<p></p>
<p><strong><span style="font-size:85%;color:#000099;">&#8216;===LOG of servers with successful PING<br />strFilePath = directory &amp; &#8220;serversPING.csv&#8221;<br />Set objFSO2 = CreateObject(&#8220;Scripting.FileSystemObject&#8221;)<br />&#8216; Open the file for write access.<br />On Error Resume Next<br />Set objFile2 = objFSO2.OpenTextFile(strFilePath, 2, True, 0)<br />If (Err.Number &lt;&gt; 0) Then<br />    On Error GoTo 0<br />    Wscript.Echo &#8220;File &#8221; &amp; strFilePath &amp; &#8221; cannot be opened&#8221;<br />    Set objFSO2 = Nothing<br />End If<br />On Error GoTo 0</span></strong></p>
<p></p>
<p><strong><span style="font-size:85%;color:#000099;">&#8216;Write HEADER<br />objFile2.WriteLine &#8220;SERVER,REACHABLE,PASSWORD CHANGED&#8221;</span></strong></p>
<p></p>
<p><strong><span style="font-size:85%;color:#000099;">Do Until objFile.AtEndOfStream<br />       strComputer = objFile.ReadLine</span></strong></p>
<p></p>
<p><strong><span style="font-size:85%;color:#000099;">      If Reachable(strComputer) Then<br />            strReachable = &#8220;REACHABLE&#8221;<br />            strPasswordChanged = &#8220;SUCCESSFUL&#8221;<br />            Call SetPassword(strComputer)<br />      Else<br />            strReachable = &#8220;UNREACHABLE&#8221;<br />            strPasswordChanged = &#8220;FAILURE&#8221;<br />      End If</span></strong></p>
<p></p>
<p><strong><span style="font-size:85%;color:#000099;">      objFile2.WriteLine strComputer &amp; &#8220;,&#8221; &amp; strReachable &amp; &#8220;,&#8221; &amp; strPasswordChanged</span></strong></p>
<p></p>
<p><strong><span style="font-size:85%;color:#000099;">Loop</span></strong></p>
<p></p>
<p><strong><span style="font-size:85%;color:#000099;">objFile.Close<br />Set objFSO =NOTHING<br />Set objFile = NOTHING</span></strong></p>
<p><strong><span style="font-size:85%;color:#000099;">objFile2.Close<br />Set objFSO2 =NOTHING<br />Set objFile2 = NOTHING</span></strong></p>
<p></p>
<p><strong><span style="font-size:85%;color:#000099;">MSGBOX &#8220;Finished&#8221;</span></strong></p>
<p></p>
<p><strong><span style="font-size:85%;color:#000099;"></span></strong> </p>
<p></p>
<p><strong><span style="font-size:85%;color:#000099;">&#8216;===============================<br />Function Reachable(strComputer)<br />&#8216;     On Error Resume Next</span></strong></p>
<p></p>
<p><strong><span style="font-size:85%;color:#000099;"> Dim wmiQuery, objWMIService, objPing, objStatus</p>
<p> wmiQuery = &#8220;Select * From Win32_PingStatus Where Address = &#8216;&#8221; &amp; strComputer &amp; &#8220;&#8216;&#8221;</p>
<p> Set objWMIService = GetObject(&#8220;winmgmts:\.rootcimv2&#8221;)<br /> Set objPing = objWMIService.ExecQuery(wmiQuery)</p>
<p> For Each objStatus in objPing<br />       If IsNull(objStatus.StatusCode) Or objStatus.Statuscode&lt;&gt;0 Then<br />             Reachable = False &#8216;if computer is unreacable, return false<br />       Else<br />             Reachable = True &#8216;if computer is reachable, return true<br />       End If<br /> Next</span></strong><strong><span style="font-size:85%;color:#000099;"><br />End Function</span></strong></p>
<p></p>
<p><strong><span style="font-size:85%;color:#000099;">&#8216;===================================<br />Function SetPassword(strComputer)<br /> strComputer = strComputer<br /> Set objUser = GetObject(&#8220;WinNT://&#8221; &amp; strComputer &amp; &#8220;/Administrator, user&#8221;)<br /> objUser.SetPassword &#8220;</span></strong><a href="mailto:T3$tP@$$w0rd"><strong><span style="font-size:85%;color:#000099;">T3$tP@$$w0rd</span></strong></a>&#8220;<br /><strong><span style="font-size:85%;color:#000099;"> objUser.SetInfo</p>
<p>End Function</span></strong></p>
<p><span style="font-family:arial;">Imagine how much time can be saved if you needed to do this ever 45 days.  I&#8217;ll work on something which reads Active Directory for the list of all computers and servers joined in the domain so one does not need to create the <strong><span style="font-size:85%;">computerList.txt</span></strong> file</span></p>
<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/92377218009570869-6226915881876184120?l=bassplayerdoc.blogspot.com' alt='' /></div>
]]></content:encoded>
			

		<wfw:commentRss>https://www.edwinmsarmiento.com/change-the-local-administrator-password-on-all-your-domain-computers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
				<post-id xmlns="com-wordpress:feed-additions:1">54</post-id>	</item>
	</channel>
</rss>