Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jimr3105 opened this issue Apr 21, 2022 · 1 comment
Open

Comments

@jimr3105
Copy link

jimr3105 commented Apr 21, 2022

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
}

@zpeters
Copy link

zpeters commented Jul 23, 2024

Did you ever get an answer for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants