Automation via ConsoleApp
The ConsoleApp utility allows you to automatically manage Axidian Privilege objects and configure access permissions. For example, you can use the utility to create multiple resources or accounts at once, as well as revoke all unused permissions.
All operations performed by the utility are logged in the Events journal.
Authentication
Before using the utility, configure authentication to access Axidian Privilege. ConsoleApp supports the following OAuth 2.0 authentication modes:
- Resource Owner Password Flow (ROPC) — the utility obtains an access token on behalf of a PAM user and sends their credentials to the Axidian Privilege IDP component. All actions performed through the utility are executed on behalf of the PAM user, and the available operations are limited by the privileges of the specified user.
- Client Credentials Flow — the utility authenticates in PAM on its own behalf in Machine-to-Machine (M2M) mode. All actions performed through the utility are executed on behalf of the
Console Applicationservice client, and the available operations are limited by the privileges of this client.
- Resource Owner Password Flow
- Client Credentials Flow
For ROPC authentication, do not fill in the clientSecret parameter — leave the value empty.
To configure authentication:
- Navigate to the utility folder and open the appsettings.json configuration file.
- For the
coreUrlparameter, specify the Core component address. - For the
idpUrlparameter, specify the IdP component address. - For the
authUsernameparameter, specify the PAM user login.
If the parameter is not specified, the login will be requested when the utility starts. - For the
authPasswordparameter, specify the PAM user password.
If the parameter is not specified, the password will be requested when the utility starts.
When the utility starts, authentication is performed on behalf of the specified PAM user. If two-factor authentication is configured for the user, the utility will request an OTP code.
It is not recommended to use this authentication method — all users working with the utility perform operations on behalf of the service client and have the same set of privileges. To differentiate permissions and improve security, use ROPC authentication.
To configure authentication:
- Navigate to the utility folder and open the appsettings.json configuration file.
- For the
clientSecretparameter, specify theConsole Applicationclient secret.
When the utility starts, authentication is performed on behalf of the service client, and the OTP code is not requested.
Open the IdP component configuration file at:
- Windows: C:\inetpub\wwwroot\idp\appsettings.json
- Linux: /etc/axidian/axidian-pam/idp/appsettings.json
In the IdentitySettings section, the ConsoleAppClientSecret parameter contains the client secret.
Configuration file example
- Resource Owner Password Flow
- Client Credentials Flow
{
"coreUrl": "https://pam.example.local/core",
"idpUrl": "https://pam.example.local/idp",
"clientSecret": "",
"authUsername": "ConsoleAppUser",
"authPassword": "#123QwerTy!",
"skipErrorsInBulkProcessing": true,
"NLog": {
"variables": {
"minLevel": "Trace",
"dbMinLevel": "Info",
"maxArchiveFilesPerCategory": 23
},
"rules": {
"1": {
"logger": "*",
"minLevel": "Trace",
"writeTo": "processFile"
}
}
}
}
{
"coreUrl": "https://pam.example.local/core",
"idpUrl": "https://pam.example.local/idp",
"clientSecret": "NPW8dALzsjzpSGDlTGIEMt5o6sjM8x3sz",
"authUsername": "",
"authPassword": "",
"skipErrorsInBulkProcessing": true,
"NLog": {
"variables": {
"minLevel": "Trace",
"dbMinLevel": "Info",
"maxArchiveFilesPerCategory": 23
},
"rules": {
"1": {
"logger": "*",
"minLevel": "Trace",
"writeTo": "processFile"
}
}
}
}
Account operations
Create an account
- Single account
- Multiple accounts
To create an account in Axidian Privilege:
Navigate to the utility folder.
Run the utility with the parameters from the table:
- Windows
- Linux
.\Pam.ConsoleApp.exe create-account <parameter> <value>dotnet ./Pam.ConsoleApp.dll create-account <parameter> <value>Parameters
Parameter Requirement Description--usernameRequired Account name --resourceor--domainRequired Account location: --resource— resource name--domain— domain name
Specify one of the parameters.--passwordOptional Account password --descriptionOptional Description --policyOptional Policy to apply to the account --key-fileOptional Path to the SSH key file, for example: .\id_rsa--key-passphraseOptional SSH key file passphrase Command examples
- Windows
- Linux
Create an account.\Pam.ConsoleApp.exe create-account `
--username Administrator `
--resource app01.local `
--password "Pass123$" `
--description "Local admin" `
--policy DefaultCreate a domain account.\Pam.ConsoleApp.exe create-account --username Administrator --domain dev.localCreate an account with an SSH key.\Pam.ConsoleApp.exe create-account `
--username root `
--resource linux01.local `
--password "Pass123$" `
--key-file .\id_rsa `
--key-passphrase "Passphrase"Create an accountdotnet ./Pam.ConsoleApp.dll create-account `
--username Administrator `
--resource app01.local `
--password "Pass123$" `
--description "Local admin" `
--policy DefaultCreate a domain accountdotnet ./Pam.ConsoleApp.dll create-account --username Administrator --domain dev.localCreate an account with an SSH keydotnet ./Pam.ConsoleApp.dll create-account `
--username root `
--resource linux01.local `
--password "Pass123$" `
--key-file .\id_rsa `
--key-passphrase "Passphrase"
To create multiple accounts in Axidian Privilege:
Create a CSV file using the following template:
Location type;Location Name;Username;Set password;Password;Description;SSH key file path;SSH key passphraseParameters
Parameter Requirement DescriptionLocation typeRequired Account type: Local— resource accountDomain— domain account
Location NameRequired Resource or domain name UsernameRequired Account name Set passwordRequired Set a password for the account: true— set a passwordfalse— create the account without a password
PasswordOptional Account password.
Specify ifSet passwordis set totrue.DescriptionOptional Description SSH key file pathOptional Path to the SSH key file, for example: .\id_rsaSSH key passphraseOptional SSH key file passphrase CSV file example
Local;dc.dev.local;root;true;root;Local account;;
Local;raspberrypi;root;true;root;SSH key example;id_rsa;passphrase
Domain;dev.local;Administrator;false;;Domain admin;;Navigate to the utility folder and run the command:
- Windows
- Linux
.\Pam.ConsoleApp.exe create-accounts-from-file --file <file path>dotnet ./Pam.ConsoleApp.dll create-accounts-from-file --file <file path>
Delete an account
To delete an account from Axidian Privilege:
Navigate to the utility folder.
Run the command, specifying the account name or its identifier:
- Windows
- Linux
.\Pam.ConsoleApp.exe delete-account --name <account name>.\Pam.ConsoleApp.exe delete-account --id <account identifier>dotnet ./Pam.ConsoleApp.dll delete-account --name <location\account name>dotnet ./Pam.ConsoleApp.dll delete-account --id <account identifier>The identifier is displayed in the URL in the account profile.
Command examples
- Windows
- Linux
Delete an account by name.\Pam.ConsoleApp.exe delete-account --name app01.local\UserDelete an account by identifier.\Pam.ConsoleApp.exe delete-account --id a988f1b0-b871-43fa-a40c-6f4ac75f904cDelete an account by namedotnet ./Pam.ConsoleApp.dll delete-account --name app01.local\AdministratorDelete an account by identifierdotnet ./Pam.ConsoleApp.dll delete-account --id a988f1b0-b871-43fa-a40c-6f4ac75f904c
Resource operations
Create a resource
- Single resource
- Multiple resources
To create a resource in Axidian Privilege:
Navigate to the utility folder.
Run the utility with the parameters from the table:
- Windows
- Linux
.\Pam.ConsoleApp.exe create-resource <parameter> <value>dotnet ./Pam.ConsoleApp.dll create-resource <parameter> <value>Parameters
Parameter Requirement Description--nameRequired Resource name --descriptionOptional Description or--dns-name--ip-addressRequired Resource address: --dns-name— DNS name--ip-address— IP address
Specify one of the parameters.--user-connection-typeRequired User connection type. For more details, see User connection. --user-connection-addressOptional IP address or DNS name of the user connection --user-connection-portOptional User connection port --user-connection-matching-urlOptional Login page URL for a web resource --user-connection-matching-url-is-regexOptional Indicates whether the login page URL is a regular expression: true— yesfalse— no
Specify if the parameter is set.UC matching url--service-accountOptional Service account name --service-connection-typeOptional Service connection type. For more details, see Service connection. --service-connection-portOptional Service connection port --service-ssh-templateOptional SSH connector template name. Specify if the service connection type is SSH.--cisco-privilege-mode-passwordOptional Cisco privileged mode password. Specify if the service connection type is Cisco IOS.--policyOptional Policy to apply to the resource Command examples
- Windows
- Linux
Create a resource.\Pam.ConsoleApp.exe create-resource `
--name APP01 `
--description "Application server" `
--dns-name app01.local `
--user-connection-type RDP `
--user-connection-port 3389 `
--service-account DOMAIN\svc_app `
--service-connection-type WindowsCreate a resourcedotnet ./Pam.ConsoleApp.dll create-resource `
--name APP01 `
--description "Application server" `
--dns-name app01.local `
--user-connection-type RDP `
--user-connection-port 3389 `
--service-account DOMAIN\svc_app `
--service-connection-type Windows
To create multiple resources in Axidian Privilege:
Create a CSV file using the following template:
Name;Description;DNS name;IP address;UC type;UC address;UC port;UC matching url;UC matching url is regex;SC account name;SC type;SC SSH template;SC address;SC port;Cisco privilege mode passwordParameters
Parameter Requirement DescriptionNameRequired Resource name DescriptionOptional Description orDNS nameIP addressRequired DNS name or IP address of the resource. Specify one of the parameters. UC typeRequired User connection type. For more details, see User connection. UC addressOptional IP address or DNS name of the user connection UC portOptional User connection port UC matching urlOptional Login page URL for a web resource UC matching url is regexOptional Indicates whether the login page URL is a regular expression: true— yesfalse— no
Specify if the parameter is set.UC matching urlSC account nameOptional Service account name SC typeOptional Service connection type. For more details, see Service connection. SC SSH templateOptional SSH connector template name. Specify if the service connection type is SSH.SC addressOptional IP address or DNS name of the service connection SC portOptional Service connection port Cisco privilege mode passwordOptional Cisco privileged mode password. Specify if the service connection type is Cisco IOS.CSV file example
APP01;Application server;app01.local;;RDP;;;;;DOMAIN\svc_app;Windows;;;;
WEB01;Corporate website;portal.local;;WebTemplate;https://portal.local/;;https://portal.local/login;FALSE;DOMAIN\svc_web;Windows;;;;
SSH01;Linux server;;192.168.0.50;SSH;;;;;;;;;;Navigate to the utility folder and run the command:
.\Pam.ConsoleApp.exe create-resources-from-file --file <file path>
Delete a resource
To delete a resource from Axidian Privilege:
Navigate to the utility folder.
Run the command, specifying the resource name or its identifier:
- Windows
- Linux
.\Pam.ConsoleApp.exe delete-resource --name <resource name>.\Pam.ConsoleApp.exe delete-resource --id <resource identifier>dotnet ./Pam.ConsoleApp.dll delete-resource --name <resource name>dotnet ./Pam.ConsoleApp.dll delete-resource --id <resource identifier>The identifier is displayed in the URL in the resource profile.
Command examples
- Windows
- Linux
Delete a resource by name.\Pam.ConsoleApp.exe delete-resource --name app01.localDelete a resource by identifier.\Pam.ConsoleApp.exe delete-resource --id a988f1b0-b871-43fa-a40c-6f4ac75f904cDelete a resource by namedotnet ./Pam.ConsoleApp.dll delete-resource --name app01.localDelete a resource by identifierdotnet ./Pam.ConsoleApp.dll delete-resource --id a988f1b0-b871-43fa-a40c-6f4ac75f904c
Permission operations
Create a permission
- Single permission
- Multiple permissions
To create a permission in Axidian Privilege:
Navigate to the utility folder.
Run the utility with the parameters from the table:
- Windows
- Linux
.\Pam.ConsoleApp.exe create-permission <parameter> <value>dotnet ./Pam.ConsoleApp.dll create-permission <parameter> <value>Parameters
Parameter Requirement Description--userRequired PAM user name in UPN format --accountOptional PAM account name for connecting to the resource. If not specified, the user will be prompted to enter the account credentials when starting a session. --resourcesor--resources-groupRequired Resource or resource group name. Specify in the format: <resource name>:<connection type>— for one or more resources<group name>— for a resource group
--active-fromOptional Date and time when the permission becomes active. Specify in the format DD.MM.YYYY HH:MMorDD.MM.YYYY.--active-toOptional Date and time when the permission is suspended. Specify in the format DD.MM.YYYY HH:MMorDD.MM.YYYY.--schedule-time-fromOptional Time when the permission can be used. Specify in the format HH:MM.--schedule-time-endOptional Time when the permission cannot be used. Specify in the format HH:MM.--schedule-time-utcOptional Convert the specified access time from the current time zone to UTC: true— use the current time zonefalse— convert to UTC
--allow-to-view-credsOptional Allow the user to view the credentials of accounts added to the permission: true— allowfalse— deny
--allow-to-change-credsOptional Allow the user to change the credentials of accounts added to the permission: true— allowfalse— deny
Command examples
- Windows
- Linux
Create a permission for multiple resources.\Pam.ConsoleApp.exe create-permission `
--user ivanov@domain.local `
--account DOMAIN\Administrator `
--resources srv01.local:RDP,srv02.local:SSHCreate a permission for a resource group.\Pam.ConsoleApp.exe create-permission `
--user ivanov@domain.local `
--account DOMAIN\Administrator `
--resources-group PROD-SERVERSCreate a permission with time restrictions.\Pam.ConsoleApp.exe create-permission `
--user ivanov@domain.local `
--resources srv01.local:SSH `
--active-from "01.08.2026 09:00" `
--active-to "31.08.2026 18:00" `
--schedule-time-from 08:00 `
--schedule-time-end 21:59 `
--schedule-time-utc true `
--allow-to-view-creds true `
--allow-to-change-creds trueCreate a permission for multiple resourcesdotnet ./Pam.ConsoleApp.dll create-permission `
--user ivanov@domain.local `
--account DOMAIN\Administrator `
--resources srv01.local:RDP,srv02.local:SSHCreate a permission for a resource groupdotnet ./Pam.ConsoleApp.dll create-permission `
--user ivanov@domain.local `
--account DOMAIN\Administrator `
--resources-group PROD-SERVERSCreate a permission with time restrictionsdotnet ./Pam.ConsoleApp.dll create-permission `
--user ivanov@domain.local `
--account resource\Administrator `
--resources srv01.local:SSH `
--active-from "01.08.2026 09:00" `
--active-to "31.08.2026 18:00" `
--schedule-time-from 08:00 `
--schedule-time-end 21:59 `
--schedule-time-utc true `
--allow-to-view-creds true `
--allow-to-change-creds true
To create multiple permissions in Axidian Privilege:
Create a CSV file using the following template:
UserPrincipalName;AccountName;Resource1[:ConnectionType];Resource2[:ConnectionType];...;ResourceN[:ConnectionType]Parameters
Parameter Requirement DescriptionUserPrincipalNameRequired PAM user name in UPN format AccountNameRequired Account name in the DOMAIN\user format. If not specified, the user will be prompted to enter the account credentials when starting a session.Resource[:ConnectionType]Required Resource name and user connection type. Multiple resources can be specified. Example: srv01.local:RDP;srv02.local:SSH.
If the resource has only one user connection, the connection type can be omitted.CSV file example
ivanov@domain.local;DOMAIN\Administrator;srv01.local:RDP;srv02.local:SSH
petrov@domain.local;;linux01.local:SSHNavigate to the utility folder and run the command:
- Windows
- Linux
.\Pam.ConsoleApp.exe create-permissions-from-file --file <file path>dotnet ./Pam.ConsoleApp.dll create-permissions-from-file --file <file path>
Revoke a permission
Revoked permissions cannot be restored. If you need to temporarily restrict the use of a permission, suspend it instead.
- Single permission
- Multiple permissions
To revoke a permission:
Navigate to the utility folder.
Run the following command:
- Windows
- Linux
Revoke a permission by number.\Pam.ConsoleApp.exe revoke-permissions --permissions <permission numbers>Revoke a user permission.\Pam.ConsoleApp.exe revoke-permissions-by-user <parameter> <value>Revoke a permission by numberdotnet ./Pam.ConsoleApp.dll revoke-permissions --permissions <permission numbers>Revoke a user permissiondotnet ./Pam.ConsoleApp.dll revoke-permissions-by-user <parameter> <value>Parameters
Parameter Requirement Description--userRequired PAM user name in UPN format --accountOptional Account name --resourcesor--resources-groupRequired Resource or resource group name. Specify one of the parameters. Command examples
- Windows
- Linux
Revoke user permissions by resources.\Pam.ConsoleApp.exe revoke-permissions-by-user `
--user ivanov@domain.local `
--account DOMAIN\Administrator `
--resources srv01.local:RDP,srv02.local:SSHRevoke user permissions by resource group.\Pam.ConsoleApp.exe revoke-permissions-by-user `
--user ivanov@domain.local `
--account DOMAIN\Administrator `
--resources-group PROD-SERVERSRevoke permissions for a resourcedotnet ./Pam.ConsoleApp.dll revoke-permissions-by-user `
--user ivanov@domain.local `
--account DOMAIN\Administrator `
--resources srv01.local:RDP,srv02.local:SSHRevoke user permissions for a resource groupdotnet ./Pam.ConsoleApp.dll revoke-permissions-by-user `
--user ivanov@domain.local `
--account DOMAIN\Administrator `
--resources-group PROD-SERVERS
To revoke multiple permissions in Axidian Privilege:
Create a CSV file using the following template:
UserPrincipalName;AccountName;Resource1[:ConnectionType];Resource2[:ConnectionType];...;ResourceN[:ConnectionType]Parameters
Parameter Requirement DescriptionUserPrincipalNameRequired PAM user name in UPN format AccountNameRequired Account name in the DOMAIN\user format. If not specified, the user will be prompted to enter the account credentials when starting a session.Resource[:ConnectionType]Required Resource name and user connection type. Multiple resources can be specified. Example: srv01.local:RDP;srv02.local:SSHCSV file example
ivanov@domain.local;DOMAIN\Administrator;srv01.local:RDP;srv02.local:SSH
petrov@domain.local;;linux01.local:SSHNavigate to the utility folder and run the command:
.\Pam.ConsoleApp.exe revoke-permissions-from-file --file <file path>
After the command is executed, the specified permissions are set to the Revoked state.
Suspend a permission
An unused permission is a permission that has not been used within the period specified in the Monitoring settings. It is recommended to revoke or suspend such permissions.
To suspend unused permissions:
Navigate to the utility folder.
Run the following command:
- Windows
- Linux
.\Pam.ConsoleApp.exe suspend-unused-permissionsdotnet ./Pam.ConsoleApp.dll suspend-unused-permissions
After the command is executed, all unused permissions are set to the Suspended state.
The permission can be resumed at any time.