Update McAfee Dat on multiple remote servers
hi all, new ps scripting, have small requirement , need update mcafee dat on multiple remote servers without login them, ps script tried following code not working , can me correct this.
$remoteservers = get-content "c:\logs\mcafee\servers.txt"
@(
foreach ($server in $remoteservers)
{
if ( test-connection -computername $remoteserver -count 1 -erroraction silentlycontinue )
{
$path='c:\program files (x86)\mcafee\virusscan enterprise\mcupdate.exe'
$parameters='/update /quiet'
$path='c:\program files (x86)\mcafee\common framework\cmdagent.exe /p'
}
else
{
$path='c:\program files\mcafee\virusscan enterprise\mcupdate.exe'
$parameters='/update /quiet'
$path='c:\program files\mcafee\common framework\cmdagent.exe /p'
write-output "$name is unrechable please check server either ilo or vc console"
}
}
)|out-file -filepath 'c:\logs\mcafee\mcafe_dat.
hello
ok
create filesahre mirror mcafee ftp , set default mcafee agent connect file share.
or create scheduled task downalad dat file , run share http://www.mcafee.com/apps/downloads/security-updates/security-updates.aspx?region=us
sorry english
Windows Server > Windows PowerShell
Comments
Post a Comment