Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #CERT
- Invoke-WebRequest -Uri https://packages.wazuh.com/4.x/windows/wazuh-agent-4.4.0-1.msi -OutFile 'C:\Program Files (x86)\wazuh-agent-4.4.0-1.msi'; msiexec.exe /i 'C:\Program Files (x86)\wazuh-agent-4.4.0-1.msi' /q WAZUH_MANAGER='192.168.0.88' WAZUH_REGISTRATION_SERVER='192.168.0.88' WAZUH_AGENT_GROUP='Cert'
- Start-Sleep -Seconds 60
- Write-Host "Downloaded and installed"
- Start-Sleep -Seconds 3
- Write-Host "Restarting Wazuh service..."
- Start-Sleep -Seconds 3
- Restart-Service WazuhSvc
- Start-Sleep -Seconds 30
- Remove-Item 'C:\Program Files (x86)\wazuh-agent-4.4.0-1.msi'
- #IB
- Invoke-WebRequest -Uri https://packages.wazuh.com/4.x/windows/wazuh-agent-4.4.0-1.msi -OutFile 'C:\Program Files (x86)\wazuh-agent-4.4.0-1.msi'; msiexec.exe /i 'C:\Program Files (x86)\wazuh-agent-4.4.0-1.msi' /q WAZUH_MANAGER='192.168.0.88' WAZUH_REGISTRATION_SERVER='192.168.0.88' WAZUH_AGENT_GROUP='IB'
- Start-Sleep -Seconds 60
- Write-Host "Downloaded and installed"
- Start-Sleep -Seconds 3
- Write-Host "Restarting Wazuh service..."
- Start-Sleep -Seconds 3
- Restart-Service WazuhSvc
- Start-Sleep -Seconds 30
- Remove-Item 'C:\Program Files (x86)\wazuh-agent-4.4.0-1.msi'
- #control wazuh in server /var/ossec/bin/manage_agents
- #INSTALLING FROM LOCAL MACHINE AND WITH CONDITION FOR CHECKING FILE FOR EXISTING
- $Source = '\\smbserver\shares\A\Wazuh\wazuh-agent-4.4.0-1.msi'
- $Destination = '${env:tmp}\wazuh-agent-4.4.0-1.msi'
- if (Test-Path -Path $Source) {
- Write-Output "Installing..."
- Start-Sleep -Seconds 10
- Copy-Item -Path $Source -Destination $Destination -Force; msiexec.exe /i '${env:tmp}\wazuh-agent-4.4.0-1.msi' /q WAZUH_MANAGER='192.168.0.88' WAZUH_REGISTRATION_SERVER='192.168.0.88' WAZUH_AGENT_GROUP='Cert'
- Start-Sleep -Seconds 30
- Write-Host "Installed"
- Start-Sleep -Seconds 3
- Write-Host "Restarting the Service..."
- Start-Sleep -Seconds 3
- Restart-Service WazuhSvc
- Start-Sleep -Seconds 3
- Set-service WazuhSvc -StartupType Automatic
- Start-Sleep -Seconds 30
- Remove-Item '${env:tmp}\wazuh-agent-4.4.0-1.msi'
- Start-Sleep -Seconds 5
- Write-Host "The installation is successfully completed"
- } else {
- Write-Output "Error: The specified file not found!"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement