Solved

Changing service account password on multiple computers in the service filed

Posted on 2015-01-12
8
112 Views
Last Modified: 2015-01-14
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
Comment
Question by:eperez0968
[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
  • 4
  • 3
8 Comments
 
LVL 53

Expert Comment

by:Will Szymkowski
ID: 40545272
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
 

Author Comment

by:eperez0968
ID: 40545278
Hi Will its a AD account used as a service account, not local...
0
 
LVL 29

Expert Comment

by:becraig
ID: 40545300
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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 

Author Comment

by:eperez0968
ID: 40545357
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
 
LVL 29

Accepted Solution

by:
becraig earned 500 total points
ID: 40545391
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
 

Author Comment

by:eperez0968
ID: 40546546
where does this txt file get placed?
 $servers = (gc serverlist.txt)
0
 
LVL 29

Expert Comment

by:becraig
ID: 40546660
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
 

Author Closing Comment

by:eperez0968
ID: 40548967
great response to the problem.. and interaction...
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

You might have come across a situation when you have Exchange 2013 server in two different sites (Production and DR). After adding the Database copy in ECP console it displays Database copy status unknown for the DR exchange server. Issue is strange…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
This tutorial will walk an individual through locating and launching the BEUtility application and how to execute it on the appropriate database. Log onto the server running the Backup Exec database. In a larger environment, this would generally be …
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

688 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