• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 118
  • Last Modified:

Changing service account password on multiple computers in the service filed

I am trying to change all the passwords on multiple 2008 r2 servers but I get errors and I am not good at this please help..

maybe something that reads a test file and then changes the Service password on each server and have a text input to revile success on each server or fail.

I am using PowerShell and here is my example.

icm $Servertest { /StartMode=Automatic /account=user /username=Server1 Service/password=XXXXXXXXXX}
0
eperez0968
Asked:
eperez0968
  • 4
  • 3
1 Solution
 
Will SzymkowskiSenior Solution ArchitectCommented:
Is this service account password a local account on the machines itself? Or do you have an AD account that has a password cached on a service that you are managing with it?

Will.
0
 
eperez0968Author Commented:
Hi Will its a AD account used as a service account, not local...
0
 
becraigCommented:
Here is a previously answered question where I wrote a short script to do this:

http://www.experts-exchange.com/Programming/Languages/Scripting/Powershell/Q_28350680.html
0
Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

 
eperez0968Author Commented:
Ok I miss spoke some, its using the default service account which I need to change all of the servers using a specific service to change the default to a specified service account name and change the password.
0
 
becraigCommented:
So you can use the script above with a slight modification.

So instead we just simply search for the service by name then make the change :

$acctname = "domain\user"
$svcpwd  = "password"
#Text file
$servers = (gc serverlist.txt) 
#from AD 
#Import-Module ActiveDirectory
#$servers = (Get-ADComputer -Filter *)

foreach ($server in $servers) 
{
$servicename = "Name of the service to change"
write-host "updating $servicename"
$svcnm = gwmi win32_service -computername $server -filter "name='$servicename'"
#Update Service
$svcnm.change($null,$null,$null,$null,$null,$null,"$UserName",$svcpwd,$null,$null,$null) 
#Stop Service
$svcnm.stopservice
#Start Service
$svcnm.startservice
}
}

Open in new window

0
 
eperez0968Author Commented:
where does this txt file get placed?
 $servers = (gc serverlist.txt)
0
 
becraigCommented:
You can change
gc serverlist.txt

To
gc c:\folder\filenamet.txt
Where the path is the exact path to the text file with your list of servers.
0
 
eperez0968Author Commented:
great response to the problem.. and interaction...
0

Featured Post

Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

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