Sign in with
Sign up | Sign in
Your question

Changing Local Admin Password Across the Domain

Last response: in Windows 2000/NT
Share
Anonymous
a b 8 Security
July 8, 2004 1:14:39 PM

Archived from groups: microsoft.public.win2000.security (More info?)

How do I change the Local Administrator Password across
the domain without visiting every computer? Any help in
this matter is appreciated.

More about : changing local admin password domain

July 8, 2004 9:24:39 PM

Archived from groups: microsoft.public.win2000.security (More info?)

"Kevin" <anonymous@discussions.microsoft.com> wrote in message
news:29c9d01c46506$ab604a00$a301280a@phx.gbl...
> How do I change the Local Administrator Password across
> the domain without visiting every computer? Any help in
> this matter is appreciated.


There are plenty of tools available on the net, I remember seeing one on
Download.com, that would do this,
in fact here's the link

http://www.download.com/Network-Password-Changer/3000-2...

from the write up.
<Changes password on multiple computers centrally. Ideal for centrally
changing the Local Administrator password on a group of computers. Uses the
currently logged in user and searches for computers on the network that the
user can log in to as a local user, and changes the password of the user
remotely.

Jud
Anonymous
a b 8 Security
July 8, 2004 9:24:40 PM

Archived from groups: microsoft.public.win2000.security (More info?)

I thought there was a way to do it through domain policy.
>-----Original Message-----
>
>"Kevin" <anonymous@discussions.microsoft.com> wrote in
message
>news:29c9d01c46506$ab604a00$a301280a@phx.gbl...
>> How do I change the Local Administrator Password across
>> the domain without visiting every computer? Any help
in
>> this matter is appreciated.
>
>
>There are plenty of tools available on the net, I
remember seeing one on
>Download.com, that would do this,
>in fact here's the link
>
>http://www.download.com/Network-Password-Changer/3000-
2085-10225696.html?tag=lst-0-1
>
>from the write up.
><Changes password on multiple computers centrally. Ideal
for centrally
>changing the Local Administrator password on a group of
computers. Uses the
>currently logged in user and searches for computers on
the network that the
>user can log in to as a local user, and changes the
password of the user
>remotely.
>
>Jud
>
>
>.
>
Anonymous
a b 8 Security
July 8, 2004 11:38:35 PM

Archived from groups: microsoft.public.win2000.security (More info?)

Kevin wrote:

> How do I change the Local Administrator Password across
> the domain without visiting every computer? Any help in
> this matter is appreciated.
Hi

As long as the computers are joined to an Active Directory domain:

You could do it in a computer startup script (with a GPO) that runs
as part of the boot up process (before the user logs in). It runs
under the system context and has admin rights.

To avoid users being able to read the script where the password is
stored, grant read access only for the AD group "Domain Computers"
to the script file.


As long as the Administrator account name is "Administrator", this
vbscript will set the password on the account:

'--------------------8<----------------------
sNewPassword = "testpassword"
Set oWshNet = CreateObject("WScript.Network")
sComputer = oWshNet.ComputerName

On Error Resume Next
Set oUser = GetObject("WinNT://" & sComputer & "/Administrator,user")
oUser.SetPassword sNewPassword
oUser.SetInfo
On Error Goto 0
'--------------------8<----------------------


If you want to change the password instead of setting it (but this
means you will need to be sure that you know the old password on
all the computers), use oUser.ChangePassword instead of
oUser.SetPassword, like this:

oUser.ChangePassword "old pwd here", sNewPassword



If there is a chance that the name of the administrator is not
"Administrator" (e.g. the account is renamed, or you have some
non-English OS versions), you could use this version instead:

'--------------------8<----------------------
sNewPassword = "testpassword"
Set oWshNet = CreateObject("WScript.Network")
sComputer = oWshNet.ComputerName
sAdminName = GetAdministratorName

On Error Resume Next
Set oUser = GetObject("WinNT://" & sComputer & "/" & sAdminName & ",user")
oUser.SetPassword sNewPassword
oUser.SetInfo
On Error Goto 0


Function GetAdministratorName()

Dim sUserSID, oWshNetwork, oUserAccount

Set oWshNetwork = CreateObject("WScript.Network")
Set oUserAccounts = GetObject( _
"winmgmts://" & oWshNetwork.UserDomain & "/root/cimv2") _
.ExecQuery("Select Name, SID from Win32_UserAccount" _
& " WHERE Domain = '" & oWshNetwork.ComputerName & "'")

On Error Resume Next
For Each oUserAccount In oUserAccounts
If Left(oUserAccount.SID, 9) = "S-1-5-21-" And _
Right(oUserAccount.SID, 4) = "-500" Then
GetAdministratorName = oUserAccount.Name
Exit For
End if
Next
End Function
'--------------------8<----------------------




--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/community/scriptcenter...
!