GithubHelp home page GithubHelp logo

zeclab / guacamole-powershell Goto Github PK

View Code? Open in Web Editor NEW

This project forked from upperm/guacamole-powershell

0.0 0.0 0.0 148 KB

PowerShell functions useful to manage Apache Guacamole

PowerShell 100.00%

guacamole-powershell's Introduction

PSGuacamole

alt text

GitHub release

This PowerShell module provides a series of cmdlets for interacting with the Apache Guacamole API, performed by wrapping Invoke-RestMethod for the API calls.

Table of Contents

Getting Started

Requirements

Requires PowerShell 3.0 or above as this is when Invoke-RestMethod was introduced.

Installation

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.

Examples

Authentification

Get new token

New-GuacToken -Username "admin" -Password "MyPassword" -Server "http://srv-guacamole:8080/guacamole"

User Management

Create a new user

$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

Retrieve user

Get-GuacUser -Username "john.doe" -DataSource "mysql"

Retrieve user connection history

Get-GuacUser -Username "john.doe" -DataSource "mysql" -Details history

Remove User

Remove-GuacUser -Username "john.doe" -DataSource "mysql"

Connections Management

Retrieving all connections

Get-GuacConnections -DataSource "mysql"

Retrieving a connection

Get-GuacConnection -DataSource mysql -ConnectionId 41 -Details $False -History $False

Create RDP connection

$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 a connection

Remove-GuacConnection -DataSource mysql -ConnectionId 74

Retrieving all connections groups

Get-GuacConnectionsGroups -DataSource mysql

Retrieving all active connections

Get-GuacActiveConnections -DataSource mysql

Functions

ConnectionGroups

  • Get-GuacConnectionsGroup
  • Get-GuacConnectionsGroupDetails
  • Get-GuacConnectionsGroups
  • Get-GuacConnectionsGroupsConnections
  • New-GuacConnectionGroup
  • Remove-GuacConnectionGroup
  • Update-GuacConnectionGroup

Connections

  • Get-GuacActiveConnections
  • Get-GuacConnection
  • Get-GuacConnections
  • New-GuacConnection
  • Remove-GuacConnection
  • Stop-GuacConnection
  • Update-GuacConnection

History

  • Get-GuacConnectionsHistory
  • Get-GuacUsersHistory

Languages

  • Get-GuacLanguages

Patch

  • Get-GuacPatches

Permissions

  • Add-GuacConnectionGroupMember
  • Add-GuacSystemPermission
  • Remove-GuacConnectionGroupMember
  • Remove-GuacSystemPermission

Schemas

  • Get-GuacSchemaConnection
  • Get-GuacSchemaConnectionGroup
  • Get-GuacSchemaProtocols
  • Get-GuacSchemaSharingProfile
  • Get-GuacSchemaUser

SharingProfiles

  • Get-GuacSharingProfile
  • Get-GuacSharingProfiles
  • New-GuacSharingProfile
  • Remove-GuacSharingProfile

Token

  • New-GuacToken
  • Remove-GuacToken

Tunnels

  • Get-GuacTunnel
  • Get-GuacTunnels

UserGroups

  • Add-GuacUserGroupConnection
  • Add-GuacUserGroupMember
  • Add-GuacUserGroupPermission
  • Get-GuacUserGroup
  • Get-GuacUserGroups
  • New-GuacUserGroup
  • Remove-GuacUserGroup
  • Remove-GuacUserGroupConnection
  • Remove-GuacUserGroupPermission
  • Update-GuacUserGroup
  • Update-GuacUserGroupParent

Users

  • Add-GuacUserConnection
  • Get-GuacUser
  • Get-GuacUsers
  • New-GuacUser
  • Remove-GuacUser
  • Remove-GuacUserConnection
  • Update-GuacUser
  • Update-GuacUserPassword

Author

Author: UpperM

guacamole-powershell's People

Contributors

upperm avatar ebekker avatar dbhd avatar cristianadrielbraun avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.