Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


pspasswd in batch file issue

 
Logged in as: Guest
arrSession:exec spGetSession 2,7,50173
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [General Forum] >> Other Programming/Scripting Languages >> pspasswd in batch file issue
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 pspasswd in batch file issue - 7/31/2007 8:06:33 AM   
  kmarty009

 

Posts: 64
Score: 0
Joined: 5/21/2004
From: USA
Status: offline
I have written this batch file script to change admin passwords.  It works great except that it is not writing to the log file on failures.  I guess I need is someone to help me make sure that failures are written to another text file called failure.txt.  I have tried using errorlevel but it never writes the failures.  can anyone help me out?  Thanks.

@echo off
:: Password Script for Changing Windows Servers
:: Created By Kirk Marty and Eric Welshons
:: 7/31/2007
:: Before Running this script you must change the 4 Variables below
:: Copy this script to your hard drive and run in a DOS Window
SET _SERVERLIST=C:\Jobs\servers.txt
SET _USERNAME=domain\username
SET _PASSWORD=password
SET _ADMNAME=administrator
SET _ADMPASSWD=password
::Checking for the server file
if not exist "%_ServerList%" (
echo serverlist "%_SERVERLIST%" not found.  Create it and try again.
exit /b 1
)
:: let us do our work in a for loop
for /F %%i in ('type "%_SERVERLIST%"') do (
  echo Machine %%i
pspasswd \\%%i -u %_USERNAME% -p %_PASSWORD% %_ADMNAME% %_ADMPASSWD% >>results.txt

)

_____________________________

KirkM.
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [General Forum] >> Other Programming/Scripting Languages >> pspasswd in batch file issue Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts