A *NEW* Kaseya Community is coming! Get the details & update your profile this week: https://www.community.connectit.com/discussion/41381/a-new-kaseya-community-is-coming

Need agent procedure to collect Autopilot data

Jeremy Hinkle
Jeremy Hinkle Member CHOCOLATE MILK
edited June 20 in Request

Has anyone figured out how to automate retrieving Autopilot data from devices using an Agent Procedure? Here's what I have so far:

The execute shell command is this:

powershell -Command "&{ Start-Process powershell -ArgumentList '-File c:\kworking\Autopilot.ps1' -Verb RunAs}"

The powershell script I'm trying to execute is the file MS gives you to collect the data:

New-Item -Type Directory -Path "C:\HWID"

Set-Location -Path "C:\HWID"

$env:Path += ";C:\Program Files\WindowsPowerShell\Scripts"

Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned -Force

Install-Script -Name Get-WindowsAutopilotInfo -Force

Get-WindowsAutopilotInfo -OutputFile AutopilotHWID.csv

I've tried numerous different ways, but I never get the desired outcome. The furthest I can see that is happening is the PATH variable has what it needs added. I've tried to execute the powershell script directly as the user, as system - neither works. If anyone has any suggestions or wants to test this on their own system, be my guest!

3 votes

Awaiting Votes · Last Updated