pohodactl.ps1
is a PowerShell script for automating STORMWARE POHODA accounting
software. You can use it to:
-
start, stop and get status of mServers
-
list connected users
-
run an automated task
Important
|
The script should work with recent versions of POHODA (starting with release 13400). Only POHODA SQL and POHODA E1 are supported. |
Download pohodactl.ps1
and pohodactl.conf
and keep them in the same directory. Modify the following options in
pohodactl.conf
according to your environment:
|
Path to |
|
SQL Server hostname. |
|
SQL Server user. |
|
SQL Server password. |
Backslashes must be escaped using another backslash (e.g. \\COMPUTER\Pohoda.exe
becomes \\\\COMPUTER\\Pohoda.exe
).
If you want to keep the configuration file in a different directory or under a different name, you need to provide its
path to pohodactl.ps1
as -Config
option.
pohodactl will use the credentials of the current user when authorizing to SQL Server.
PS> .\pohodactl.ps1 [COMMAND] [SUBCOMMAND] [ARGUMENT] [OPTIONS]
Command | Subcommand | Description | |
---|---|---|---|
|
|
Prints a list of connected users. |
|
|
|
Prints a list of configured mServers and their status. Add |
|
|
Gives you Low Level Discovery json for Zabbix |
||
|
Performs a health-check of configured mServers. pohodactl will send an authenticated HTTP request to the mServer to check if it’s responding. You can optionally pass a single mServer name as the argument, otherwise all mServers will be queried. Requires two additional configuration options to be present in
Exit code will be zero if all mServers are running and responding, non-zero otherwise. |
||
|
Accepts mServer name as the argument. Starts the mServer or all mServers if the argument is empty. |
||
|
Accepts mServer name as the argument. Stops the mServer or all mServers if the argument is empty. |
|
PS> .\pohodactl.ps1 client list-active
Id PohodaUser LastActive Computer RemoteComputer WindowsUser Database
-- ---------- ---------- -------- -------------- ----------- --------
123 @ 01.01.2022 12:00:00 UCTOPC winusr StwPh_12345678_2022
124 @ 01.01.2022 12:00:00 WINSERVER SEF-PC sef StwPh_12345678_2022
PS> .\pohodactl.ps1 mserver status
Year IsRunning Name Ico Url
---- --------- ---- --- ---
2022 True mserver 12345678 http://WINSERVER:8001
PS> .\pohodactl.ps1 mserver health
IsRunning Name IsResponding
--------- ---- ------------
True mserver True