Skip to content

Powershell REST client for grommunio

License

Notifications You must be signed in to change notification settings

grommunio/aapi-powershell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

grommunio Admin API Powershell (AAPIPS)

project license latest version code size pull requests welcome code with love by grommunio twitter

grommunio AAPIPS (Admin API Powershell) is the Powershell interface to the REST-based grommunio Admin API to manage entire grommunio installations from Powershell

Overview

About grommunio AAPIPS

  • Simple management of grommunio for Microsoft Administrators
  • Well-documented interface descriptions
  • Powerful Powershell interface allows simple and complex management tasks with grommunio
  • Standardized calls enable full compliance with grommunio Admin API
  • Standalone, requiring no dependencies to run

Getting Started

Prerequisites

grommunio AAPIPS requires Powershell 6.2 or later to run.

Installation

grommunio AAPIPS is soon available as install-ready module from the Powershell Gallery, until then please refer to the manual installation.

For manual installation, use Build.ps1 and import the resulting Module:

Build.ps1
Import-Module -Name '.\src\GrommunioAdmin' -Verbose

Example

# Import grommunioAdmin Powershell module
Import-Module -Name '.\src\GrommunioAdmin' -Verbose

# Define grommunio Admin API credentials
$grommunioHost="https://mail.example.com:8443"
$grommunioUsername="admin"
$grommunioPassword="VerySecureAP1-Passw0rd"

# Set grommunio Admin API endpoint
$APIEndpoint = -join($grommunioHost,"/api/v1")
Set-GroAdminConfiguration -BaseUrl $APIEndpoint

# Login to grommunio Admin API
$LoginResult = (Submit-GroAdminLogin -ContentType "application/x-www-form-urlencoded" -User $grommunioUsername -Pass $grommunioPassword)
$LoginCookie = -join("grommunioAuthJwt=",$LoginResult.grommunioAuthJwt)
$LoginCSRF = $LoginResult.csrf

# Set authentication headers for any request
Set-GroAdminConfiguration -DefaultHeaders @{"Cookie"="$LoginCookie";"X-CSRF-TOKEN"="$LoginCSRF"}

PS> Get-GroAdminAbout

API   backend schema
---   ------- ------
1.9.2 1.9.8      109

PS> $domains = $(Get-GroAdminDomains).data
PS> echo $domains

ID            : 1
domainname    : grommunio.com
displayname   : grommunio.com
orgID         : 1
maxUser       : 100
activeUsers   : 43
inactiveUsers : 1
title         : grommunio
address       : DC Tower, Donau-City-Str. 7 / door 2 / 30th floor, 1220 Vienna, Austria
adminName     : 
tel           :
endDay        : 2050-09-30
domainStatus  : 0

Removal

To uninstall the module, simply run:

Remove-Module -FullyQualifiedName @{ModuleName = "GrommunioAdmin"; ModuleVersion = "1.9.2"}

Tests

To install and run Pester, please execute the following commands in the terminal:

Install-module -name Pester -force
Invoke-Pester

For troubleshooting, please run $DebugPreference = 'Continue' to turn on debugging and disable it with $DebugPreference = 'SilentlyContinue' when done with the troubleshooting.

API Documentation

Documentation for API Endpoints

All URIs are relative to /api/v1

Class Method HTTP request Description
GroAdminDefaultsApi Get-GroAdminCreateParams GET /defaults/createParams getCreateParams
GroAdminDefaultsApi Get-GroAdminDomainDefaultParams GET /defaults/createParams/{domainID} getDomainDefaultParams
GroAdminDefaultsApi Get-GroAdminStoreLangs GET /defaults/storeLangs getStoreLangs
GroAdminDefaultsApi Invoke-GroAdminPatchCreateParams PATCH /defaults/createParams patchCreateParams
GroAdminDefaultsApi Invoke-GroAdminPatchDomainDefaultParams PATCH /defaults/createParams/{domainID} patchDomainDefaultParams
GroAdminDefaultsApi Send-GroAdminCreateParams PUT /defaults/createParams putCreateParams
GroAdminDefaultsApi Send-GroAdminDomainDefaultParams PUT /defaults/createParams/{domainID} putDomainDefaultParams
GroAdminDomainAdminClassesApi Invoke-GroAdminDeleteClass DELETE /domains/{domainID}/classes/{ID} deleteClass
GroAdminDomainAdminClassesApi Get-GroAdminClass GET /domains/{domainID}/classes/{ID} getClass
GroAdminDomainAdminClassesApi Get-GroAdminClasses GET /domains/{domainID}/classes getClasses
GroAdminDomainAdminClassesApi Get-GroAdminClassesTree GET /domains/{domainID}/classes/tree getClassesTree
GroAdminDomainAdminClassesApi Invoke-GroAdminPatchClass PATCH /domains/{domainID}/classes/{ID} patchClass
GroAdminDomainAdminClassesApi Submit-GroAdminClass POST /domains/{domainID}/classes postClass
GroAdminDomainAdminClassesApi Test-GroAdminFilter POST /domains/{domainID}/classes/testFilter testFilter
GroAdminDomainAdminFoldersApi Invoke-GroAdminDeleteFolder DELETE /domains/{domainID}/folders/{folderID} deleteFolder
GroAdminDomainAdminFoldersApi Invoke-GroAdminDeleteMember DELETE /domains/{domainID}/folders/{folderID}/owners/{memberID} deleteMember
GroAdminDomainAdminFoldersApi Get-GroAdminFolder GET /domains/{domainID}/folders/{folderID} getFolder
GroAdminDomainAdminFoldersApi Get-GroAdminFolderTree GET /domains/{domainID}/folders/tree getFolderTree
GroAdminDomainAdminFoldersApi Get-GroAdminFolders GET /domains/{domainID}/folders getFolders
GroAdminDomainAdminFoldersApi Get-GroAdminOwners GET /domains/{domainID}/folders/{folderID}/owners getOwners
GroAdminDomainAdminFoldersApi Invoke-GroAdminPatchFolder PATCH /domains/{domainID}/folders/{folderID} patchFolder
GroAdminDomainAdminFoldersApi Submit-GroAdminFolders POST /domains/{domainID}/folders postFolders
GroAdminDomainAdminFoldersApi Submit-GroAdminOwner POST /domains/{domainID}/folders/{folderID}/owners postOwner
GroAdminDomainAdminFoldersApi Set-GroAdminMember PUT /domains/{domainID}/folders/{folderID}/owners/{memberID} setMember
GroAdminDomainAdminMListsApi Invoke-GroAdminDeleteMlist DELETE /domains/{domainID}/mlists/{ID} deleteMlist
GroAdminDomainAdminMListsApi Get-GroAdminMlist GET /domains/{domainID}/mlists/{ID} getMlist
GroAdminDomainAdminMListsApi Get-GroAdminMlists GET /domains/{domainID}/mlists getMlists
GroAdminDomainAdminMListsApi Invoke-GroAdminPatchMlist PATCH /domains/{domainID}/mlists/{ID} patchMlist
GroAdminDomainAdminMListsApi Submit-GroAdminMlists POST /domains/{domainID}/mlists postMlists
GroAdminDomainAdminUsersApi Stop-GroAdminWipe DELETE /domains/{domainID}/users/{userID}/sync/{deviceID}/wipe cancelWipe
GroAdminDomainAdminUsersApi Invoke-GroAdminDeleteStoreAccessUser DELETE /domains/{domainID}/users/{userID}/storeAccess/{username} deleteStoreAccessUser
GroAdminDomainAdminUsersApi Invoke-GroAdminDeleteStoreProps DELETE /domains/{domainID}/users/{userID}/storeProps deleteStoreProps
GroAdminDomainAdminUsersApi Invoke-GroAdminDeleteUser DELETE /domains/{domainID}/users/{userID} deleteUser
GroAdminDomainAdminUsersApi Get-GroAdminDelegates GET /domains/{domainID}/users/{userID}/delegates getDelegates
GroAdminDomainAdminUsersApi Get-GroAdminDomainSyncPolicy GET /domains/{domainID}/syncPolicy getDomainSyncPolicy
GroAdminDomainAdminUsersApi Get-GroAdminSendas GET /domains/{domainID}/users/{userID}/sendas getSendas
GroAdminDomainAdminUsersApi Get-GroAdminStoreAccessUsers GET /domains/{domainID}/users/{userID}/storeAccess getStoreAccessUsers
GroAdminDomainAdminUsersApi Get-GroAdminStoreProps GET /domains/{domainID}/users/{userID}/storeProps getStoreProps
GroAdminDomainAdminUsersApi Get-GroAdminSyncedDevices GET /domains/{domainID}/users/{userID}/sync getSyncedDevices
GroAdminDomainAdminUsersApi Get-GroAdminUser GET /domains/{domainID}/users/{userID} getUser
GroAdminDomainAdminUsersApi Get-GroAdminUsers GET /domains/{domainID}/users getUsers
GroAdminDomainAdminUsersApi Invoke-GroAdminOofSizeLarge GET /domains/{domainID}/users/{userID}/oof oofSizeLarge
GroAdminDomainAdminUsersApi Invoke-GroAdminPatchStoreProps PATCH /domains/{domainID}/users/{userID}/storeProps patchStoreProps
GroAdminDomainAdminUsersApi Invoke-GroAdminPatchUser PATCH /domains/{domainID}/users/{userID} patchUser
GroAdminDomainAdminUsersApi Submit-GroAdminDeviceWipe POST /domains/{domainID}/users/{userID}/sync/{deviceID}/wipe postDeviceWipe
GroAdminDomainAdminUsersApi Submit-GroAdminStoreAccessUser POST /domains/{domainID}/users/{userID}/storeAccess postStoreAccessUser
GroAdminDomainAdminUsersApi Submit-GroAdminUser POST /domains/{domainID}/users postUser
GroAdminDomainAdminUsersApi Send-GroAdminDelegates PUT /domains/{domainID}/users/{userID}/delegates putDelegates
GroAdminDomainAdminUsersApi Send-GroAdminDeviceResync PUT /domains/{domainID}/users/{userID}/sync/{deviceID}/resync putDeviceResync
GroAdminDomainAdminUsersApi Send-GroAdminDownsync PUT /domains/{domainID}/users/{userID}/downsync putDownsync
GroAdminDomainAdminUsersApi Send-GroAdminSendas PUT /domains/{domainID}/users/{userID}/sendas putSendas
GroAdminDomainAdminUsersApi Send-GroAdminStoreAccessUser PUT /domains/{domainID}/users/{userID}/storeAccess putStoreAccessUser
GroAdminDomainAdminUsersApi Remove-GroAdminDeviceResync DELETE /domains/{domainID}/users/{userID}/sync/{deviceID} removeDeviceResync
GroAdminDomainAdminUsersApi Remove-GroAdminDeviceStates DELETE /domains/{domainID}/users/{userID}/sync removeDeviceStates
GroAdminDomainAdminUsersApi Set-GroAdminOofSize PUT /domains/{domainID}/users/{userID}/oof setOofSize
GroAdminDomainAdminUsersApi Set-GroAdminPassword PUT /domains/{domainID}/users/{userID}/password setPassword
GroAdminLDAPApi Invoke-GroAdminCheckUsers GET /domains/ldap/check checkUsers
GroAdminLDAPApi Invoke-GroAdminDeleteLDAPConf DELETE /system/mconf/ldap deleteLDAPConf
GroAdminLDAPApi Invoke-GroAdminDeleteOrgLDAPConf DELETE /system/orgs/{ID}/ldap deleteOrgLDAPConf
GroAdminLDAPApi Invoke-GroAdminDeleteOrphaned DELETE /domains/ldap/check deleteOrphaned
GroAdminLDAPApi Get-GroAdminLDAP GET /domains/ldap/dump dumpLDAP
GroAdminLDAPApi Get-GroAdminLDAPConf GET /system/mconf/ldap getLDAPConf
GroAdminLDAPApi Get-GroAdminOrgLDAPConf GET /system/orgs/{ID}/ldap getOrgLDAPConf
GroAdminLDAPApi Import-GroAdminLdapUser POST /domains/ldap/importUser importLdapUser
GroAdminLDAPApi Send-GroAdminDownsync PUT /domains/{domainID}/users/{userID}/downsync putDownsync
GroAdminLDAPApi Search-GroAdminLDAP GET /domains/ldap/search searchLDAP
GroAdminLDAPApi Set-GroAdminLDAPConf PUT /system/mconf/ldap setLDAPConf
GroAdminLDAPApi Set-GroAdminOrgLDAPConf PUT /system/orgs/{ID}/ldap setOrgLDAPConf
GroAdminLDAPApi Update-GroAdminAllDomainUsers POST /domains/{domainID}/ldap/downsync updateAllDomainUsers
GroAdminLDAPApi Update-GroAdminAllUsers POST /domains/ldap/downsync updateAllUsers
GroAdminLDAPApi Update-GroAdminOrgLDAPUsers POST /system/orgs/{ID}/ldap/downsync updateOrgLDAPUsers
GroAdminMiscApi Invoke-GroAdminCheckFormat GET /chkFormat checkFormat
GroAdminMiscApi Invoke-GroAdminDeleteMailq POST /system/mailq/delete deleteMailq
GroAdminMiscApi Clear-GroAdminMailq POST /system/mailq/flush flushMailq
GroAdminMiscApi Get-GroAdminAbout GET /about getAbout
GroAdminMiscApi Get-GroAdminMailq GET /system/mailq getMailq
GroAdminMiscApi Get-GroAdminProfile GET /profile getProfile
GroAdminMiscApi Get-GroAdminStatus GET /status getStatus
GroAdminMiscApi Get-GroAdminUserDomains GET /domains getUserDomains
GroAdminMiscApi Submit-GroAdminLogin POST /login postLogin
GroAdminMiscApi Submit-GroAdminRequeue POST /system/mailq/requeue postRequeue
GroAdminMiscApi Send-GroAdminPasswd PUT /passwd putPasswd
GroAdminMiscApi Invoke-GroAdminRemoteCLI POST /system/cli remoteCLI
GroAdminMiscApi Sync-GroAdminTop GET /system/sync/top syncTop
GroAdminServiceApi Get-GroAdminUserDeviceWipeStatus GET /service/wipe/{username} getUserDeviceWipeStatus
GroAdminServiceApi Get-GroAdminUserInformation GET /service/userinfo/{username} getUserInformation
GroAdminServiceApi Get-GroAdminUserSyncPolicy GET /service/syncPolicy/{username} getUserSyncPolicy
GroAdminServiceApi Send-GroAdminPasswd PUT /passwd putPasswd
GroAdminServiceApi Set-GroAdminUserDeviceWipeStatus POST /service/wipe/{username} setUserDeviceWipeStatus
GroAdminSystemAdminDBConfApi Invoke-GroAdminDeleteConfigFile DELETE /system/dbconf/{service}/{file}/ deleteConfigFile
GroAdminSystemAdminDBConfApi Invoke-GroAdminDeleteServiceConfig DELETE /system/dbconf/{service}/ deleteServiceConfig
GroAdminSystemAdminDBConfApi Get-GroAdminCommandList GET /system/dbconf/commands getCommandList
GroAdminSystemAdminDBConfApi Get-GroAdminConfigFile GET /system/dbconf/{service}/{file}/ getConfigFile
GroAdminSystemAdminDBConfApi Get-GroAdminServiceFiles GET /system/dbconf/{service}/ getServiceFiles
GroAdminSystemAdminDBConfApi Get-GroAdminServicesListDBConf GET /system/dbconf/ getServicesListDBConf
GroAdminSystemAdminDBConfApi Invoke-GroAdminPatchConfigFile PATCH /system/dbconf/{service}/{file}/ patchConfigFile
GroAdminSystemAdminDBConfApi Invoke-GroAdminPatchServiceFiles PATCH /system/dbconf/{service}/ patchServiceFiles
GroAdminSystemAdminDBConfApi Send-GroAdminConfigFile PUT /system/dbconf/{service}/{file}/ putConfigFile
GroAdminSystemAdminDashboardApi Get-GroAdminDashboard GET /system/dashboard getDashboard
GroAdminSystemAdminDashboardApi Get-GroAdminServiceInfo GET /system/dashboard/services/{unit} getServiceInfo
GroAdminSystemAdminDashboardApi Get-GroAdminServicesList GET /system/dashboard/services getServicesList
GroAdminSystemAdminDashboardApi Send-GroAdminServiceSignal POST /system/dashboard/services/{unit}/{action} sendServiceSignal
GroAdminSystemAdminDomainsApi Invoke-GroAdminDeleteDomain DELETE /system/domains/{domainID} deleteDomain
GroAdminSystemAdminDomainsApi Get-GroAdminAllUsers GET /system/users getAllUsers
GroAdminSystemAdminDomainsApi Get-GroAdminDomainInfo GET /system/domains/{domainID} getDomainInfo
GroAdminSystemAdminDomainsApi Get-GroAdminDomains GET /system/domains getDomains
GroAdminSystemAdminDomainsApi Invoke-GroAdminPatchDomain PATCH /system/domains/{domainID} patchDomain
GroAdminSystemAdminDomainsApi Submit-GroAdminDomain POST /system/domains postDomain
GroAdminSystemAdminLicenseApi Invoke-GroAdminDownloadCert GET /system/license/certificate.pem downloadCert
GroAdminSystemAdminLicenseApi Get-GroAdminLicense GET /system/license getLicense
GroAdminSystemAdminLicenseApi Send-GroAdminLicense PUT /system/license putLicense
GroAdminSystemAdminLogsApi Get-GroAdminLog GET /system/logs/{file} getLog
GroAdminSystemAdminLogsApi Get-GroAdminLogs GET /system/logs getLogs
GroAdminSystemAdminMConfApi Invoke-GroAdminDeleteAuthmgr DELETE /system/mconf/authmgr deleteAuthmgr
GroAdminSystemAdminMConfApi Invoke-GroAdminDeleteLDAPConf DELETE /system/mconf/ldap deleteLDAPConf
GroAdminSystemAdminMConfApi Get-GroAdminAuthmgr GET /system/mconf/authmgr getAuthmgr
GroAdminSystemAdminMConfApi Get-GroAdminLDAPConf GET /system/mconf/ldap getLDAPConf
GroAdminSystemAdminMConfApi Set-GroAdminAuthmgr PUT /system/mconf/authmgr setAuthmgr
GroAdminSystemAdminMConfApi Set-GroAdminLDAPConf PUT /system/mconf/ldap setLDAPConf
GroAdminSystemAdminOrganizationsApi Invoke-GroAdminDeleteOrg DELETE /system/orgs/{ID} deleteOrg
GroAdminSystemAdminOrganizationsApi Invoke-GroAdminDeleteOrgLDAPConf DELETE /system/orgs/{ID}/ldap deleteOrgLDAPConf
GroAdminSystemAdminOrganizationsApi Get-GroAdminOrg GET /system/orgs/{ID} getOrg
GroAdminSystemAdminOrganizationsApi Get-GroAdminOrgLDAPConf GET /system/orgs/{ID}/ldap getOrgLDAPConf
GroAdminSystemAdminOrganizationsApi Get-GroAdminOrgs GET /system/orgs getOrgs
GroAdminSystemAdminOrganizationsApi Invoke-GroAdminPatchOrg PATCH /system/orgs/{ID} patchOrg
GroAdminSystemAdminOrganizationsApi Submit-GroAdminOrgs POST /system/orgs postOrgs
GroAdminSystemAdminOrganizationsApi Set-GroAdminOrgLDAPConf PUT /system/orgs/{ID}/ldap setOrgLDAPConf
GroAdminSystemAdminProxiesApi Get-GroAdminAntispam GET /system/antispam/{path} getAntispam
GroAdminSystemAdminProxiesApi Get-GroAdminVhostStatus GET /system/vhostStatus/{host} getVhostStatus
GroAdminSystemAdminProxiesApi Get-GroAdminVhosts GET /system/vhostStatus getVhosts
GroAdminSystemAdminRolesApi Invoke-GroAdminDeleteRole DELETE /system/roles/{ID} deleteRole
GroAdminSystemAdminRolesApi Get-GroAdminPermissions GET /system/roles/permissions getPermissions
GroAdminSystemAdminRolesApi Get-GroAdminRole GET /system/roles/{ID} getRole
GroAdminSystemAdminRolesApi Get-GroAdminRoles GET /system/roles getRoles
GroAdminSystemAdminRolesApi Invoke-GroAdminPatchRole PATCH /system/roles/{ID} patchRole
GroAdminSystemAdminRolesApi Invoke-GroAdminPatchUserRoles PATCH /domains/{domainID}/users/{userID}/roles patchUserRoles
GroAdminSystemAdminRolesApi Submit-GroAdminRole POST /system/roles postRole
GroAdminSystemAdminServersApi Invoke-GroAdminDeleteServer DELETE /system/servers/{ID} deleteServer
GroAdminSystemAdminServersApi Get-GroAdminServer GET /system/servers/{ID} getServer
GroAdminSystemAdminServersApi Get-GroAdminServers GET /system/servers getServers
GroAdminSystemAdminServersApi Invoke-GroAdminPatchServer PATCH /system/servers/{ID} patchServer
GroAdminSystemAdminServersApi Submit-GroAdminServers POST /system/servers postServers
GroAdminTasQApi Get-GroAdminTask GET /tasq/tasks/{ID} getTask
GroAdminTasQApi Get-GroAdminTasks GET /tasq/tasks getTasks
GroAdminTasQApi Invoke-GroAdminNotify POST /tasq/notify notify
GroAdminTasQApi Start-GroAdminTaskq POST /tasq/start startTaskq
GroAdminTasQApi Stop-GroAdminTaskq POST /tasq/stop stopTaskq
GroAdminTasQApi Invoke-GroAdminTaskQStatus GET /tasq/status taskQStatus

Documentation for Models

Status

Support

For direct contact to the maintainers (for example to supply information about a security-related responsible disclosure), you can contact grommunio directly at [email protected]

Project assistance

If you want to say thank you or/and support active development of grommunio AAPIPS:

  • Add a GitHub Star to the project.
  • Tweet about grommunio AAPIPS.
  • Write interesting articles about the project on Dev.to, Medium, your personal blog or any medium you feel comfortable with.

Together, we can make grommunio AAPIPS better!

Contributing

First off, thanks for taking the time to contribute! Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make will benefit everybody else and are greatly appreciated.

If you have found an issue and want to report an issue, either reach out to us in our community, or, if you have a subscription, open up a support case.

To provide changesets,

Then, either

  • create a pull request towards the master branch.

or

  • upload commits to a git store of your choosing, or export the series as a patchset using git format-patch.
  • send the patch(es) or git link to [email protected] and we will consider the submission.

Additional notes

  • If possible, please only work on one issue per commit.

Security

grommunio AAPIPS follows good practices of security. grommunio constantly monitors security-related issues. grommunio AAPIPS is provided "as is" without any warranty. For professional support options through subscriptions, head over to grommunio.

License

This project is licensed under the GNU Affero General Public License v3.

See LICENSE.txt for more information.