Skip to content

PowerShell script for automating STORMWARE POHODA accounting software.

License

Notifications You must be signed in to change notification settings

jaburjak/pohodactl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

pohodactl

pohodactl.ps1 is a PowerShell script for automating STORMWARE POHODA accounting software. You can use it to:

Important
The script should work with recent versions of POHODA (starting with release 13400). Only POHODA SQL and POHODA E1 are supported.

Installation

Download pohodactl.ps1 and pohodactl.conf and keep them in the same directory. Modify the following options in pohodactl.conf according to your environment:

CLIENT

Path to Pohoda.exe.

SQLSERVER

SQL Server hostname.

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.

Usage

PS> .\pohodactl.ps1 [COMMAND] [SUBCOMMAND] [ARGUMENT] [OPTIONS]
Command Subcommand Description

client

list-active

Prints a list of connected users.

mserver

status

Prints a list of configured mServers and their status.

health

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 pohodactl.confPHUSER and PHPASSWORD, which must contain valid POHODA user credentials.

Caution
Remember to restrict access to the credentials using proper file system permissions!

Exit code will be zero if all mServers are running and responding, non-zero otherwise.

start

Accepts mServer name as the argument. Starts the mServer or all mServers if the argument is empty.

stop

Accepts mServer name as the argument. Stops the mServer or all mServers if the argument is empty.

task

run

Requires task number as the argument. Runs the task.

Examples

List connected users
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
Enumerate mServers
PS> .\pohodactl.ps1 mserver status

Year IsRunning Name    Ico      Url
---- --------- ----    ---      ---
2022      True mserver 12345678 http://WINSERVER:8001
Health-check mServers
PS> .\pohodactl.ps1 mserver health

IsRunning Name    IsResponding
--------- ----    ------------
     True mserver         True

About

PowerShell script for automating STORMWARE POHODA accounting software.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published