Hello,
Maybe someone can assist me in getting this script to work.
What I want this to do is when ran it will read a list of computers from a text file "computers.txt" and invoke/run a file from a shared location and install it on those machines listed in the text file.
thanks in advance
Maybe someone can assist me in getting this script to work.
What I want this to do is when ran it will read a list of computers from a text file "computers.txt" and invoke/run a file from a shared location and install it on those machines listed in the text file.
Code:
$cred = get-credential
$exe = "\\jashare1\IT\CitrixOnlinePluginWeb.exe"
$computers = get-content "C:\Scripts\Computers.txt"
foreach($computer in $computers)
{
Invoke-WmiMethod -Name Create -Class Win32_Process -Namespace root\cimv2 -ArgumentList $exe -credential $cred -ComputerName $computer | out-null
}
thanks in advance