SetServiceCredentials

<< Click to Display Table of Contents >>

SetServiceCredentials

Updates the Windows account credentials used to run the PDQ Inventory background service. This command is designed for automated password rotation workflows and integration with Password Access Management (PAM) solutions.

After updating the credentials, the service is automatically restarted to apply the change unless -NoRestart is specified.

Syntax

PDQInventory SetServiceCredentials -Username <domain\username> [-Password <password>] [-SecurePassword] [-NoRestart]

Parameters

Parameter

Required

Description

-Username <username>

Yes

The Windows account the service will run as. Use DOMAIN\username format for domain accounts, or .\username for local accounts.

-Password <password>

No

The new password for the account. If omitted and -SecurePassword is not set, you will be prompted interactively. WARNING: passwords passed on the command line may be visible in process listings and shell history.

-SecurePassword

No

Prompts for the password interactively. The password is not echoed to the screen. Use this flag instead of -Password to avoid exposing the password in command history.

-NoRestart

No

Applies the credential changes without restarting the background service. The new credentials will take effect the next time the service is restarted.

Exit Codes

Exit Code

Meaning

0

Credentials updated successfully.

1

Failure. The account could not be validated, the service failed to restart, or another error occurred. Check the error message for details. If the service fails to restart, see Manually restarting the PDQ service.

2

User cancelled at the interactive password prompt.

Examples

Update service credentials and prompt for the password securely:

PDQInventory SetServiceCredentials -Username DOMAIN\svcaccount -SecurePassword

Update credentials for a local account:

PDQInventory SetServiceCredentials -Username .\localuser -SecurePassword

Update credentials and skip the service restart:

PDQInventory SetServiceCredentials -Username DOMAIN\svcaccount -Password MyP@ss -NoRestart

Pipe the password from a PAM tool via stdin (most secure for scripting):

Get-Secret -Name PDQServiceAccount | ConvertFrom-SecureString -AsPlainText | PDQInventory SetServiceCredentials -Username DOMAIN\svcaccount

NOTE: This command requires Administrator privileges and accesses the database directly (offline mode), so it does not require the background service to be running. If the service is running, it will be restarted automatically after the credential change to apply the new credentials, unless -NoRestart is specified.

 

 

 

© 2026 PDQ.com Corporation. All rights reserved.

PDQ.com is a trademark of PDQ.com Corporation. All other product and company names are the property of their respective owners.

Help Version: 20.0.22.0