guacamole-rest-api-documentation icon indicating copy to clipboard operation
guacamole-rest-api-documentation copied to clipboard

New-GuacUser in a foreach loop returning 500 (Internal Server Error)

Open jimr3105 opened this issue 2 years ago • 0 comments

The commands work independently...if I use the command "New-GuacUser -DataSource mysql -Parameters $GuacParameters" to create a single user, it works fine. I start getting the error when I put the command into a foreach loop and pull in names from a text file.

Other functions, like "Add-GuacUserConnection" in a foreach loop work just fine.

$password = "secretpassword" $userlist=(get-content userlist.txt) foreach ($user in $userlist) { $GuacParameters = @{ "username"= $user "password"= $password "attributes"= @{ "disabled"= "" "expired"= "" "access-window-start"= "" "access-window-end"= "" "valid-from"= "" "valid-until"= "" "timezone"= "" "guac-full-name"= "" "guac-organization"= "" "guac-organizational-role"= "" } } write-host ". . . . .Adding $user to Guacamole Server" New-GuacUser -DataSource mysql -Parameters $GuacParameters }

jimr3105 avatar Apr 21 '22 18:04 jimr3105