Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 177
  • Last Modified:

in the process of changing admin passwords, want a script ot get a list of computers

we are in the process of changing the local administrator passwords of all our client computers. i have tested the utitlty pspasswd.exe to change the passwords and now want to implement it. need a script that can extract a list of computers in a text file that i can use for changing passwords.
0
mgmohiuddin
Asked:
mgmohiuddin
2 Solutions
 
Shift-3Commented:
Paste the script below into a text file with a .cmd extension.  Run it either from a 2003 server or a workstation with the Administration Tools installed.  It will create a list named computerlist.txt in the same directory.


@echo off
setlocal enabledelayedexpansion
 
for /F %%G in ('dsquery computer -o samid') do (
 set comp=%%~G1
 echo !comp:$=! >> computerlist.txt
)

Open in new window

0
 
Jared LukerCommented:
You can just do an export from your computers OU in Active Directory User and Computers and save it out to a text file if you like.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now