L
L
Lobster 3932019-10-08 06:49:11
System administration
Lobster 393, 2019-10-08 06:49:11

How to change the password from nodes on different servers?

Hello! The question is - let's say I have 10 screw servers in administration. Each server has the same node. Advise a utility, or something else, with which you can change passwords on all servers from these nodes. At the same time, the utility should not refer to the cloud (the data should not be stored anywhere other than the servers themselves).
Any ideas?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
2
20ivs, 2019-10-08
@20ivs

Powershell + Workflow

D
Dmitry Shumov, 2019-10-08
@dshumov

Well, for example like this: https://social.technet.microsoft.com/wiki/contents...
or like this:

foreach ($Computer in $Computers) {
   $Computer    =    $Computer.toupper()
   $Isonline    =    "OFFLINE"
   $Status        =    "SUCCESS"
    Write-Verbose "Working on $Computer"
if((Test-Connection -ComputerName $Computer -count 1 -ErrorAction 0)) {
   $Isonline = "ONLINE"
   Write-Verbose "`t$Computer is Online"
} else { Write-Verbose "`t$Computer is OFFLINE" }
 
try {
   $account = [ADSI]("WinNT://$Computer/Administrator,user")
   $account.psbase.invoke("setpassword",$pwd1_text)
   Write-Verbose "`tPassword Change completed successfully"
}
catch {
  $status = "FAILED"
  Write-Verbose "`tFailed to Change the administrator password. Error: $_"
}
 
$obj = New-Object -TypeName PSObject -Property @{
  ComputerName = $Computer
  IsOnline = $Isonline
  PasswordChangeStatus = $Status
}
 
$obj | Select ComputerName, IsOnline, PasswordChangeStatus
 
if($Status -eq "FAILED" -or $Isonline -eq "OFFLINE") {
   $stream.writeline("$Computer `t $isonline `t $status")
}
 
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question