Hi,
I am trying to update user names on multiple VMs. the below script is not working. how can I use the below script with variable so that I can mention or import through a csv input.
Please help.
$serv = "mytestvm"
$myuser = "johnb"
$Username = 'root'
$session = New-SSHSession $serv
$connected = $session.Connected
Invoke-SSHCommand -SSHSession $session -Command 'sed -i "s/.*pam.allow.users:.*/&,$($myuser)/" /etc/centrifydc.conf'
Remove-SSHSession $session -Verbose | Out-Null