Solved

Changing service account password on multiple computers in the service filed

Posted on 2015-01-12
8
108 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
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 …
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…

831 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