How to set up Nodes for 'Run As' functionality

Good Afternoon!

I’ve been trying my best to find this information elsewhere so as to not have to open a thread but I can’t seem to find a straight answer to this situation.

I have Powershell Universal installed on a server and deployed using IIS. I’d like to set up my Print server as an accessible node that I can execute scripts on remotely using the “Run As” feature in Powershell Universal. I can’t seem to figure out how exactly to configure the print server as a node though. I was hoping I could get a few pointers with this.

Thanks a ton,

-Z

Currently, you’d need PSU installed on the print server and they would need to share a database. You could then queue scripts directly on the print server. Your other alternative is to use PowerShell remoting within your scripts to access the print server remotely.

Understood. I’m working on switching the IIS configured server over to a MSSQL database, I’ve successfully migrated the data from the litedb to the MSSQL db however, when I set the connection string in the appsettings.json file, it still seems to be accessing the litedb. I’ve checked in programdata and wwwroot but I can’t seem to find any other appsettings.json files that might be lurking elsewhere and I’ve also restarted the IIS server. Am I missing a step?

It looks like I’m hitting a snag where the connection string in appsettings.json is throwing an error:

[10:05:08 FTL] Fatal error starting PowerShell Universal.
System.ArgumentException: The path is empty. (Parameter 'path')

When I change the connection string back to default, its fine.

%ProgramData%\\UniversalAutomation\\database.db

However, if I set it to either of these two, it fails. This same connection string works fine on remote machines but not in the IIS instance of PSU.

Data Source=localhost;Initial Catalog=PowershellUniversal;User Id=<redacted>;Password=<redacted>;Trusted_Connection=Yes;Encrypt=False

Data Source=<hostname>;Initial Catalog=PowershellUniversal;User Id=<redacted>;Password=<redacted>;Trusted_Connection=Yes;Encrypt=False

When I installed PSU desktop on a remote machine I used the connection string above where the data soruce was the of the SQL server and it worked as expected.

Did you set the plugin value to SQL? Here’ s an example fro my environment.

    "Plugins": [
        "SQL"
    ],
    "Data": {
        "RepositoryPath": "%ProgramData%\\UniversalAutomation\\Repository",
        "ConnectionString": "Server=(localdb)\\mssqllocaldb;Database=PSU;Trusted_Connection=True;",

Egg on my face, that did the trick. Thank you so much.

1 Like