# Collect Logs
This PowerShell script from [bu11etpr00f](https://github.com/bu11etpr00f/scripts-ninjarmm/blob/master/ninjarmmagent.collect.ninjalogs.ps1) starts log collection by invoking the NinjaOne agent with the /collectlogs flag. This prints logs to the shell and
```PowerShell
## Universal PowerShell Script to Collect NinjaRMMAgent Logs
## Created by bu11etpr00f 2019.10.01
##
## Set ninjarmmagent.exe Location
$exeLocation = Get-ChildItem -Path "C:\Program Files (x86)\" -Recurse -Depth 1 -Include "ninjarmmagent.exe" | Select-Object -First 1
## Set Command Paramaters
$exeArguments = "/collectlogs"
## Run Command
Start-Process $exeLocation $exeArguments
```