{"id":836,"date":"2011-11-01T17:23:13","date_gmt":"2011-11-02T00:23:13","guid":{"rendered":"http:\/\/www.analogrithems.com\/rant\/?p=836"},"modified":"2013-07-11T18:33:58","modified_gmt":"2013-07-12T01:33:58","slug":"change-local-admin-password-on-all-computers-in-your-domain","status":"publish","type":"post","link":"https:\/\/www.analogrithems.com\/rant\/change-local-admin-password-on-all-computers-in-your-domain\/","title":{"rendered":"Change Local Admin Password on All Computers in Your Domain"},"content":{"rendered":"<p>Here is an awesome script I found to change the admin password on all the computers in your domain. \u00c2\u00a0It uses a simple visual basic object to search for all the computers in your domain&#8217;s Active Directory then loops through each computer and sets a new password for the Administrator account.<\/p>\n<p>&nbsp;<\/p>\n<p>[sourcecode language=&#8221;vb&#8221;]<br \/>\nOn Error Resume Next<br \/>\nrem http:\/\/blogs.technet.com\/b\/heyscriptingguy\/archive\/2007\/07\/03\/how-can-i-change-the-local-administrator-password-on-all-my-computers.aspx<br \/>\nConst ADS_SCOPE_SUBTREE = 2<\/p>\n<p>Set objConnection = CreateObject(&quot;ADODB.Connection&quot;)<br \/>\nSet objCommand =   CreateObject(&quot;ADODB.Command&quot;)<br \/>\nobjConnection.Provider = &quot;ADsDSOObject&quot;<br \/>\nobjConnection.Open &quot;Active Directory Provider&quot;<\/p>\n<p>Set objCommand.ActiveConnection = objConnection<br \/>\nobjCommand.CommandText = _<br \/>\n    &quot;Select Name From &#8216;LDAP:\/\/DC=yourcompany,DC=com&#8217; Where objectClass=&#8217;computer&#8217;&quot;<br \/>\nobjCommand.Properties(&quot;Page Size&quot;) = 1000<br \/>\nobjCommand.Properties(&quot;Searchscope&quot;) = ADS_SCOPE_SUBTREE<br \/>\nSet objRecordSet = objCommand.Execute<br \/>\nobjRecordSet.MoveFirst<\/p>\n<p>Do Until objRecordSet.EOF<br \/>\n    strComputer = objRecordSet.Fields(&quot;Name&quot;).Value<\/p>\n<p>    Set objUser = GetObject(&quot;WinNT:\/\/&quot; &amp; strComputer &amp; &quot;\/Administrator&quot;)<br \/>\n    objUser.SetPassword &quot;mynewpassword!&quot;<\/p>\n<p>    objRecordSet.MoveNext<br \/>\nLoop<br \/>\n[\/sourcecode]<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is an awesome script I found to change the admin password on all the computers in your domain. \u00c2\u00a0It uses a simple visual basic object to search for all the computers in your domain&#8217;s Active Directory then loops through each computer and sets a new password for the Administrator account. &nbsp; [sourcecode language=&#8221;vb&#8221;] On [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,50],"tags":[51,168],"class_list":["post-836","post","type-post","status-publish","format-standard","hentry","category-ldap","category-windows-scripting","tag-active-directory","tag-ldap"],"_links":{"self":[{"href":"https:\/\/www.analogrithems.com\/rant\/wp-json\/wp\/v2\/posts\/836","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.analogrithems.com\/rant\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.analogrithems.com\/rant\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.analogrithems.com\/rant\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.analogrithems.com\/rant\/wp-json\/wp\/v2\/comments?post=836"}],"version-history":[{"count":5,"href":"https:\/\/www.analogrithems.com\/rant\/wp-json\/wp\/v2\/posts\/836\/revisions"}],"predecessor-version":[{"id":6135,"href":"https:\/\/www.analogrithems.com\/rant\/wp-json\/wp\/v2\/posts\/836\/revisions\/6135"}],"wp:attachment":[{"href":"https:\/\/www.analogrithems.com\/rant\/wp-json\/wp\/v2\/media?parent=836"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.analogrithems.com\/rant\/wp-json\/wp\/v2\/categories?post=836"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.analogrithems.com\/rant\/wp-json\/wp\/v2\/tags?post=836"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}