This PowerShell module provides a series of cmdlets for interacting with the Apache Guacamole API, performed by wrapping Invoke-RestMethod
for the API calls.
Requires PowerShell 3.0 or above as this is when Invoke-RestMethod
was introduced.
Download the latest release and extract the folder to your module location ($env:PSModulePath
).
Load the module
Import-Module -Name PSGuacamole
Once you've done this, all the cmdlets will be at your disposal.
New-GuacToken -Username "admin" -Password "MyPassword" -Server "http://srv-guacamole:8080/guacamole"
$Parameters = @{
"username"= "test"
"password"= "pass"
"attributes"= @{
"disabled"= ""
"expired"= ""
"access-window-start"= ""
"access-window-end"= ""
"valid-from"= ""
"valid-until"= ""
"timezone"= ""
"guac-full-name"= ""
"guac-organization"= ""
"guac-organizational-role"= ""
}
}
New-GuacUser -DataSource mysql -Parameters $Parameters
Get-GuacUser -Username "john.doe" -DataSource "mysql"
Get-GuacUser -Username "john.doe" -DataSource "mysql" -Details history
Remove-GuacUser -Username "john.doe" -DataSource "mysql"
Get-GuacConnections -DataSource "mysql"
Get-GuacConnection -DataSource mysql -ConnectionId 41 -Details $False -History $False
$RDPParameters = @{
"parentIdentifier"= "ROOT"
"name"= "New RDP Connection"
"protocol"= "rdp"
"parameters"= @{
"port"= ""
"read-only"= ""
"swap-red-blue"= ""
"cursor"= ""
"color-depth"= ""
"clipboard-encoding"= ""
"disable-copy"= ""
"disable-paste"= ""
"dest-port"= ""
"recording-exclude-output"= ""
"recording-exclude-mouse"= ""
"recording-include-keys"= ""
"create-recording-path"= ""
"enable-sftp"= ""
"sftp-port"= ""
"sftp-server-alive-interval"= ""
"enable-audio"= ""
"security"= ""
"disable-auth"= ""
"ignore-cert"= ""
"gateway-port"= ""
"server-layout"= ""
"timezone"= ""
"console"= ""
"width"= ""
"height"= ""
"dpi"= ""
"resize-method"= ""
"console-audio"= ""
"disable-audio"= ""
"enable-audio-input"= ""
"enable-printing"= ""
"enable-drive"= ""
"create-drive-path"= ""
"enable-wallpaper"= ""
"enable-theming"= ""
"enable-font-smoothing"= ""
"enable-full-window-drag"= ""
"enable-desktop-composition"= ""
"enable-menu-animations"= ""
"disable-bitmap-caching"= ""
"disable-offscreen-caching"= ""
"disable-glyph-caching"= ""
"preconnection-id"= ""
"hostname"= ""
"username"= ""
"password"= ""
"domain"= ""
"gateway-hostname"= ""
"gateway-username"= ""
"gateway-password"= ""
"gateway-domain"= ""
"initial-program"= ""
"client-name"= ""
"printer-name"= ""
"drive-name"= ""
"drive-path"= ""
"static-channels"= ""
"remote-app"= ""
"remote-app-dir"= ""
"remote-app-args"= ""
"preconnection-blob"= ""
"load-balance-info"= ""
"recording-path"= ""
"recording-name"= ""
"sftp-hostname"= ""
"sftp-host-key"= ""
"sftp-username"= ""
"sftp-password"= ""
"sftp-private-key"= ""
"sftp-passphrase"= ""
"sftp-root-directory"= ""
"sftp-directory"= ""
}
"attributes"= @{
"max-connections"= ""
"max-connections-per-user"= ""
"weight"= ""
"failover-only"= ""
"guacd-port"= ""
"guacd-encryption"= ""
"guacd-hostname"= ""
}
}
New-GuacConnection -DataSource mysql -Parameters $RDPParameters
Remove-GuacConnection -DataSource mysql -ConnectionId 74
Get-GuacConnectionsGroups -DataSource mysql
Get-GuacActiveConnections -DataSource mysql
- Get-GuacConnectionsGroup
- Get-GuacConnectionsGroupDetails
- Get-GuacConnectionsGroups
- Get-GuacConnectionsGroupsConnections
- New-GuacConnectionGroup
- Remove-GuacConnectionGroup
- Update-GuacConnectionGroup
- Get-GuacActiveConnections
- Get-GuacConnection
- Get-GuacConnections
- New-GuacConnection
- Remove-GuacConnection
- Stop-GuacConnection
- Update-GuacConnection
- Get-GuacConnectionsHistory
- Get-GuacUsersHistory
- Get-GuacLanguages
- Get-GuacPatches
- Add-GuacConnectionGroupMember
- Add-GuacSystemPermission
- Remove-GuacConnectionGroupMember
- Remove-GuacSystemPermission
- Get-GuacSchemaConnection
- Get-GuacSchemaConnectionGroup
- Get-GuacSchemaProtocols
- Get-GuacSchemaSharingProfile
- Get-GuacSchemaUser
- Get-GuacSharingProfile
- Get-GuacSharingProfiles
- New-GuacSharingProfile
- Remove-GuacSharingProfile
- New-GuacToken
- Remove-GuacToken
- Get-GuacTunnel
- Get-GuacTunnels
- Add-GuacUserGroupConnection
- Add-GuacUserGroupMember
- Add-GuacUserGroupPermission
- Get-GuacUserGroup
- Get-GuacUserGroups
- New-GuacUserGroup
- Remove-GuacUserGroup
- Remove-GuacUserGroupConnection
- Remove-GuacUserGroupPermission
- Update-GuacUserGroup
- Update-GuacUserGroupParent
- Add-GuacUserConnection
- Get-GuacUser
- Get-GuacUsers
- New-GuacUser
- Remove-GuacUser
- Remove-GuacUserConnection
- Update-GuacUser
- Update-GuacUserPassword
Author: UpperM