Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Change local admin password on all desktops

Posted on 2006-11-19
14
Medium Priority
?
339 Views
Last Modified: 2008-02-01
I would like to change the local admin account on all 500 of the desktops in my domain.  Is there a simple way to do this?  I would like to change it to the same password for all local admin.

I also would like to ensure that the users do not have admin rights to their local machines.

Thanks
0
Comment
Question by:darovitz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
  • 3
  • +1
14 Comments
 
LVL 48

Accepted Solution

by:
Jay_Jay70 earned 1000 total points
ID: 17976788
you can use restricted groups to control local admin rights
http://www.windowsecurity.com/articles/Using-Restricted-Groups.html

and a script like this one to reset admin passwords
http://articles.techrepublic.com.com/5100-1035_11-5198818.html
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 17976799
Where atl-ws-01 is the workstation,

Set objUser = GetObject("WinNT://atl-ws-01/administrator")
objUser.SetPassword("AdminPassword")


or to change all the computers in an OU:

Set objOU = GetObject("LDAP://OU=Finance, DC=fabrikam, DC=com")
objOU.Filter = Array("Computer")

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

acquired from: http://www.microsoft.com/technet/scriptcenter/resources/qanda/oct04/hey1015.mspx

To determine if the user is a local admin, this script should do the trick...(taken from http://www.microsoft.com/technet/scriptcenter/resources/qanda/aug04/hey0805.mspx)

Set objNetwork = CreateObject("Wscript.Network")
strComputer = objNetwork.ComputerName
strUser = objNetwork.UserName

Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators")
For Each objUser in objGroup.Members
    If objUser.Name = strUser Then
        Wscript.Echo strUser & " is a local administrator."
    End If
Next


Let me know if you need further assistance with this.

~sirbounty
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 17976803
Should've refreshed first - sorry Jay_Jay70
0
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 48

Expert Comment

by:Jay_Jay70
ID: 17976824
No need for apologies my friend
0
 
LVL 8

Expert Comment

by:nitadmin
ID: 17976921
I agree with sirbounty, use the script from Microsoft's Technet article. Script Guy has a lot of greate scripts for System Administrators.

http://www.microsoft.com/technet/scriptcenter/resources/qanda/oct04/hey1015.mspx

I have used this script, and it works perfectly, without any problems.

Cheers,
NITADMIN

0
 

Author Comment

by:darovitz
ID: 17985309
Ok, which one is best restricted group or the script.  I am leaning toward the restricted group.
0
 
LVL 8

Expert Comment

by:nitadmin
ID: 17985482
It depends, on Personal preferences.


I would prefer changing the local administrator password and not letting anyone have local administrator or local power user permissions.

Cheers,
NITADMIN
0
 
LVL 48

Expert Comment

by:Jay_Jay70
ID: 17985604
well its like comparing apple and oranges....the script reports on the members and resets the passwords, whereas the restricted groups controls the members

And if you work in an environment where you can get away with not even power user permissions then you are a lucky man.....in reality, it doesnt work unless you have a monster IT policy in place
0
 

Author Comment

by:darovitz
ID: 17989828
woman... smile
0
 
LVL 48

Expert Comment

by:Jay_Jay70
ID: 17991022
Oh how good do i now feel **Grin**......Twice i have done this on the boards now....Deep apologies!    You are a lucky woman :) :) :)
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 17991125
Methinks we should start changing the blue banner to pink for comments that come from fairer sex...I too have made that mistake many times... :$
0
 
LVL 48

Expert Comment

by:Jay_Jay70
ID: 17991206
Has my vote...I love feeling like a turkey.....
0
 

Author Comment

by:darovitz
ID: 17996580
You guys are killing me.  Pretty soon I'll be able to answer questions on here and catch up (I'm too busy to answer questions, smile).  Anyway I haven't gotten this to work yet.  I did do the restricted groups part (thanks Jay) and that works BUt haven't been able to change the password for all my machines. The one script requried I import a list of all my machines into it (too much work).... haven't look at the rest yet.  I just want to change from a txt to a vbs (maybe change my domain info) and that's it.  Lazy.
0
 
LVL 48

Expert Comment

by:Jay_Jay70
ID: 17999895
ah but you can automate the text file build with a dsquery command where you query for all machines in your domain :) trust me, all admins are lazy, thats why ms are so good with automation!

dsquery computer "dc=domain,dc=local" > C:\Computername.txt
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

A quick step-by-step overview of installing and configuring Carbonite Server Backup.
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

730 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