I’m trying to install the windows agent on +100 servers and would like to do this via powershell. But i have run in to some problems.
When exec my script:
$RemoteMachine = "REMOTE-SERVER"
$domaincredentials = get-credential
write-host "Server Name is: $RemoteMachine"
#Copy the MSI Local to the computer
Write-Host "Copying MSI locally"
Copy "\\FILESERVER\d\cmk\check-mk-agent.msi" \\$RemoteMachine\c$\
#Run the MSI remotely
Write-Host "Running MSI"
Invoke-Command -ComputerName $RemoteMachine -Credential $domaincredentials -ScriptBlock { Start-Process -FilePath "msiexec.exe" -ArgumentList "/i C:\check-mk-agent.msi /quiet /lvx C:\cmk.log"}
I get this error in the verbose logging output MSI (s) (4C:F0) [09:27:52:289]: Note: 1: 1402 2: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer 3: 2 MSI (s) (4C:F0) [09:27:52:290]: File will have security applied from OpCode. MSI (s) (4C:F0) [09:27:52:297]: SOFTWARE RESTRICTION POLICY: Verifying package --> 'C:\check-mk-agent.msi' against software restriction policy MSI (s) (4C:F0) [09:27:52:297]: Note: 1: 2262 2: DigitalSignature 3: -2147287038 MSI (s) (4C:F0) [09:27:52:297]: SOFTWARE RESTRICTION POLICY: C:\check-mk-agent.msi is not digitally signed MSI (s) (4C:F0) [09:27:52:298]: SOFTWARE RESTRICTION POLICY: C:\check-mk-agent.msi is permitted to run at the 'unrestricted' authorization level.
How do i go about installing the agent on all of my servers?
Are you taking into account whether or not the local firewall is active and is going to block access to the service? You might want to add a rule that allows access to the service, see below. I realize this will allow any system on the domain,private network to access the service, I limit via only_from in the check_mk.user.yml configuration.