> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/p/pdq-adapter.md).

# PDQ Adapter

PDQ Adapter Inventory and PDQ Adapter Deploy keep their data in an SQLite database on a Windows machine. OctoXLabs connects to that machine over WinRM, runs sqlite3 against the PDQ Adapter database and reads computers, applications and collections.

## Use cases

* List devices that PDQ Adapter reports.

```
Adapters = pdq
```

* Find devices not online for 30 days.

```
Adapters = pdq AND NOT LastSeen last now-30d/d
```

## Before you begin

### Network

| Source              | Destination                                         | Port                                                                                      | Protocol              |
| ------------------- | --------------------------------------------------- | ----------------------------------------------------------------------------------------- | --------------------- |
| OctoXLabs connector | Windows machine that holds the PDQ Adapter database | 5985 (WinRM HTTP, default). 5986 is the usual WinRM HTTPS port; the port is configurable. | WinRM (HTTP or HTTPS) |

### Required permissions

| Scope or role                     | Permission                                                              | Needed for |
| --------------------------------- | ----------------------------------------------------------------------- | ---------- |
| User allowed to log in over WinRM | Run PowerShell and read the PDQ Adapter database file and `sqlite3.exe` | Devices    |

## Create credentials in PDQ Adapter

{% stepper %}
{% step %}

### Find the files

Note the full path of `sqlite3.exe` and of the PDQ Adapter database file on the target machine.
{% endstep %}

{% step %}

### Prepare WinRM

Make sure WinRM is enabled on the target machine and that an authorized user can sign in with the chosen authentication type.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter                | Required | Type    | Default | Description                                                                               |
| ------------------------ | -------- | ------- | ------- | ----------------------------------------------------------------------------------------- |
| Sqlite Path              | Yes      | String  |         | Path to the `sqlite3.exe` executable.                                                     |
| Database Path            | Yes      | String  |         | Path to the PDQ Adapter database file.                                                    |
| IP                       | Yes      | String  |         | IP address of the target machine.                                                         |
| Port                     | No       | Integer | 5985    | WinRM port.                                                                               |
| Username                 | Yes      | String  |         | Authorized user on the target machine.                                                    |
| Password                 | Yes      | String  |         | Password of the user.                                                                     |
| Auth Type                | No       | String  | NTLM    | Basic, Certificate, NTLM, Kerberos, Plaintext, SSL or Credssp.                            |
| Is Secure                | No       | Boolean | False   | Use HTTPS for WinRM.                                                                      |
| Certificate Verification | No       | Boolean | True    | Validate the server certificate when Is Secure is on.                                     |
| Kerberos Realm           | No       | String  |         | Realm for Kerberos, for example `CONTOSO.COM`. If empty, it is taken from a UPN username. |
| KDC IP                   | No       | String  |         | IP or host of the Kerberos KDC, for Kerberos only.                                        |

## Troubleshooting

| Error message                | Cause                                       | Fix                                                        |
| ---------------------------- | ------------------------------------------- | ---------------------------------------------------------- |
| Machine at is not reachable. | The ping to the target failed.              | Check the IP, network and ICMP rules.                      |
| Invalid ip address.          | The IP parameter is not a valid IP address. | Enter an IP address, not a host name.                      |
| SQLite query failed ():      | sqlite3 returned an error.                  | Check the sqlite3 and database paths and file permissions. |

## Change history
