Solved

Local Admin Passwords

Posted on 2010-08-25
11
470 Views
Last Modified: 2013-12-26
Answer Worth 500 Points!

Objective: In a 2003server / XP Client enviroment - Deploy a solution to quickly change/reset administrator local password in automation. One-time only logon change needed.

Current Solution: Scripting a logon with Group Policy to change local admin password.

Problem: Does not work with current client access- will require admin rights. An need a work around.

On Error Resume Next
Set objOU = GetObject("LDAP://OU=Computers, OU=Engineering, DC=<SERVER>, DC=LOCAL")
objOU.Filter = Array("Computer")

For Each objItem in objOU
    strComputer = objItem.CN
    Set objUser = GetObject("WinNT://" & strComputer & "/Administrator")
    objUser.SetPassword("Password")
Next

Wscript.Echo "Passwords have been changed.!"
0
Comment
Question by:Jmarcomb
  • 5
  • 3
  • 2
11 Comments
 
LVL 57

Expert Comment

by:Mike Kline
ID: 33523897
Do you have any Windows Vista/7/2008 boxes anywhere in your domain.  If you do you can use group policy preferences to do this

http://abskb.spaces.live.com/blog/cns!8834054641A09100!1071.entry?sa=500679251

Thanks

Mike
0
 

Author Comment

by:Jmarcomb
ID: 33524265
I have a few windows 7 clients. The directions in the link are unclear for me to proceed.
0
 
LVL 57

Expert Comment

by:Mike Kline
ID: 33524609
So with Windows 7 clients you can use GPP, Darren has a good overview here

http://www.gpoguy.com/Portals/0/Group%20Policy%20Preferences%20Overview.pdf

The XP machines will need some pre-reqs.

I'll also add the VBScript zone to this question

Thanks

Mike
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

Author Comment

by:Jmarcomb
ID: 33525600
Resarching your solution..
0
 
LVL 65

Accepted Solution

by:
RobSampson earned 500 total points
ID: 33527512
Hi, first off, the script you have should not be run at logon, because it runs against multiple computers each time it is run.

All you should need is a startup script (under Computer Configuration) applied to the OU in question, with the following code:

    Set objNetwork = CreateObject("WScript.Network")
    strComputer = objNetwork.ComputerName
    Set objUser = GetObject("WinNT://" & strComputer & "/Administrator")
    objUser.SetPassword("Password")

Regards,

Rob.
0
 

Author Comment

by:Jmarcomb
ID: 33554154
Still working solution.. Will have an answer monday. Thanks.
0
 

Author Closing Comment

by:Jmarcomb
ID: 33562301
There are other options. This one is the best way for my network.
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 33563341
Thanks for the grade.

Regards,

Rob.
0
 

Author Comment

by:Jmarcomb
ID: 33566445
Ok- I jumped the gone on this topic. It did not work with group policy from the domain controller to clients using XP. It would however work from locl machine group policy. That is not the desired effect. I want to control it from a central location.
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 33572636
For it to work from domain Group Policy, you need to have it as a StartUp script, under Computer Configuration, and you should be pointing the policy to the script that you have copied directly into the NetLogon share of your domain controllers.

Regards,

Rob.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now