Posts: 11,205
Threads: 101
Joined: Aug 2006
Reputation:
205
If you run it in GUI is there any dialog? It should not display any dialogs...
How do you call / use the script remotely? Is ASG-RD installed on the remote machine? Are you executing the script in the program files dir of ASGRD?
Regards/Gruss
Oliver
Posts: 11,205
Threads: 101
Joined: Aug 2006
Reputation:
205
We will have a look on this - never tried to use it via remote session
Regards/Gruss
Oliver
Posts: 11,205
Threads: 101
Joined: Aug 2006
Reputation:
205
I tried to use it as remote powershell session - and got a lot of errors... the API was never designed for remote sessions...
Why do you need to execute it on a remote session/server? It will be no difference on which computer it is executed - or do you want to read/write data from a local data source on a remote machine?
Regards/Gruss
Oliver
Posts: 4
Threads: 0
Joined: Mar 2020
Reputation:
0
Hey Oliver, thanks for looking into this.
We need to execute it remotely because we want to automate the creation of entries in ASG-RD during the deployment of new machines.
As we use Ansible for the deployment, remote execution via WinRM is the only way to go.
We even tried to put all the code into a script to execute it via Invoke-command... failed with the same errors.
It seems that the issue is related to the headless mode of our user session which doesn't support modal dialogs.
Programming is the art of adding bugs to an empty text file.
Posts: 11,205
Threads: 101
Joined: Aug 2006
Reputation:
205
Why don't you use a database instead of inserting some items into each local environment? I think something goes wrong in "internal login process" - the login user is impersonated and perhaps that's not working in a remote session - must try a little bit more, perhaps try to use other login options... Or perhaps you can just export your "initial settings" and import it via command line?
Regards/Gruss
Oliver
Posts: 2
Threads: 1
Joined: Mar 2020
Reputation:
0
We use a central database.
When a new server ist deployed, it needs to be created as a connection in ASGRD manually at the moment.
In future, the script should be called out of the linux-based deployment process to automate the creation.
Posts: 11,205
Threads: 101
Joined: Aug 2006
Reputation:
205
Ok - I think I found the reason - the remote session is not running under a known Windows-Account - so connection to database as denied and I think there was a modal dialog popping up...
If you want to run the API via remote call - you need to connect to a Database environment that uses a database user / Password for accessing the daabase - Integrated will not work (error: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.)
I have made some changes in my code to get the results - so I will verify where the dialog is shown and try to write back a warning message instead with the next version - but I think it should run also with current version if you check/change your database environment settings!
Regards/Gruss
Oliver
Posts: 4
Threads: 0
Joined: Mar 2020
Reputation:
0
Yes and no, the remote sessions are kind of incomplete, we had similar pass-through-authentication issues with other programs like robocopy and such, that's a known issue with psremoting and the very reason why we don't use the -PassThrough parameter with Connect-RDEnvironment and pass the credentials with the other parameters.
If I understand it correctly, ASG doesn't use these credentials for the database connection and tries to use the "broken" Environment?
Programming is the art of adding bugs to an empty text file.
Posts: 11,205
Threads: 101
Joined: Aug 2006
Reputation:
205
There are 2 authentications in ASGRD - once the user that you use to login into ASGRD - every user gets an own UserID and this is used to evaulate your internal permissions in ASGRD.
Second one is the database connection - you can use "Integrated Auth" so the WindowsUser is authenticated against your SQL instance! But you also can specify an internal sql user for the database connection! Just open EnvironmentManager => New connection to an existing database - in page "Database Access" you can choose how to authenticate - this is used for the ConnectionString!
Regards/Gruss
Oliver
Posts: 4
Threads: 0
Joined: Mar 2020
Reputation:
0
Thank you, that explains a lot... as a domain user doesn't work in this case, we'll try as soon as our DBA creates a sql-internal user for our tests.
A suggestion for your next version: if the api-connect is done with credentials, use those to connect to the database.
Programming is the art of adding bugs to an empty text file.