Solved

Changing service account password on multiple computers in the service filed

Posted on 2015-01-12
8
109 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
  • 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Scenario:  You do full backups to a internal hard drive in either product (SBS or Server 2008).  All goes well for a very long time.  One day, backups begin to fail with a message that the disk is full.  Your disk contains many, many more backups th…
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 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…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

860 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