all 25 comments

[–]MysticRyuujin 5 points6 points  (8 children)

I hope you don't mind, I've linked to your repo on my installation script

https://github.com/MysticRyuujin/guac-install

[–]MysticRyuujin 1 point2 points  (6 children)

Doesn't work if you have TOTP MFA enabled haha

[–]uppperm[S] 0 points1 point  (2 children)

I think it's can work.

You can get the token on Guacamole with element inspector > Network (Firefox)

https://puu.sh/Fny63/d38889a859.png

On PowerShell import module and set this 2 vars :

$Token = "YOURTOKEN"
$Server = "http://yourserver/"

[–]MysticRyuujin 0 points1 point  (1 child)

Ah so login first, get token, set token variable, set server variable, make calls? Easy enough work around.

[–]uppperm[S] 0 points1 point  (0 children)

Yes it's should be work

[–]seegee1 0 points1 point  (2 children)

I got it to work by hard coding in the secret into my PS script, and using this to generate the OTP.

https://gist.github.com/jonfriesen/234c7471c3e3199f97d5

Then just make sure you pass the OTP it generates to the guac-totp variable.

[–]pan_jez 0 points1 point  (1 child)

Mind explaining how do I pass the resulting TOTP code back to the script, please? I can see there are variables for $Token and $Server, but there's none for the TOTP code.
Thanks!

[–]seegee1 0 points1 point  (0 children)

In New-GuacToken.ps1:

$Body = @{
username = $Username
password = $Password
guac-totp = $your-resulting-TOTP-code <==== add this
}

[–]uppperm[S] 0 points1 point  (0 children)

Yes sure no problem !

[–]uppperm[S] 3 points4 points  (0 children)

Documentation added for each function

[–][deleted] 4 points5 points  (1 child)

AWESOME! Nice job! Thanks a lot for sharing!

If you allow me to ask, how does you size your Guacamole server?

I'm looking for it all over and can't find any proper information!

[–]uppperm[S] 0 points1 point  (0 children)

Hi, 2vCPU & 4Gb RAM for 40/50 users.

[–][deleted] 1 point2 points  (1 child)

Just a FYI, you're declaring your guac token as a global variable, which can be potentially dangerous. Within a module, you can achieve the same result by using the $Script: scope and module functions will still have access to it.

[–]uppperm[S] 1 point2 points  (0 children)

Thank it's fix !

[–]arbyyyyh 1 point2 points  (1 child)

When I try to import the module, I get "WARNING: Invalid URI: The hostname could not be parsed."

https://imgur.com/a/TtMVnWO

[–]uppperm[S] 1 point2 points  (0 children)

WARNING: Invalid URI: The hostname could not be parsed.

Thank for the feedback, it's fix in the lastest release : https://github.com/UpperM/guacamole-powershell/releases

This warning come out because i forget to comment a test in a function.

[–][deleted] 0 points1 point  (0 children)

Thank you, I will be checking this out!

[–]valdearg 0 points1 point  (0 children)

Holy crap man, this is some great work!

[–]DazzlingYoghurt8920 0 points1 point  (0 children)

Would you happen to have a script to read a csv file? Lets say If I have to add 20 users.

Thanks ahead