Home > Forum > Actions > [CLOSED] Running Powershell scripts generates error

[CLOSED] Running Powershell scripts generates error
0

Awhile back I was able to run PS scripts via an action without any issues. I don't use them much, primarily when playing around with what is possible. However I have a need for them now, but they will not run from webcon.

I am running the powershell with an account that has the correct permissions. I have verified by running powershell on the webcon server with the account and testing the script.

I see the following error in event viewer.

PowerShell Error
Message=WCF Service can be executed on registered account only. Valid PortalAppPoolIdentity username from database is empty.
Source=WebCon.WorkFlow.Service
StackTrace= at WebCon.WorkFlow.Service.WCFService.WCFService.ValidatePortalAccount(Int32 dbId)
at WebCon.WorkFlow.Service.WCFService.WCFService.PowerShellExec(String script, String login, String password)
System.Exception: WCF Service can be executed on registered account only. Valid PortalAppPoolIdentity username from database is empty.
at WebCon.WorkFlow.Service.WCFService.WCFService.ValidatePortalAccount(Int32 dbId)
at WebCon.WorkFlow.Service.WCFService.WCFService.PowerShellExec(String script, String login, String password)


Anyone else run into this?

MVP

Hi Bo,

did you install an update recently?

I remember that I had a similar error even so it was in a different situation. Maybe the AppPool was installed using local system or network account since the GlobalParameters entry was empty in BPS_Config.

You could check this:

SELECT [PRM_ID]
,[PRM_Name]
,[PRM_Value]
FROM [dbo].[GlobalParameters]
where PRM_Name like 'PortalApp%'

It was on a dev system so I simply updated the account for the App Pool in IIS and set the value in the table.

Best regards,
Daniel

I did an update a few months ago, and it has been quite awhile since I've tried PS, probably before that update.

Interesting, when I run that query, nothing comes back. There is no entry for PRM_Name like 'PortalApp%'
That would explain why the error says it's empty.

I have gone into the app pool in IIS and reassigned the user/password as an attempt to fix, but because of this missing sql row it didn't make a difference.

Not sure the best method to get it added to that table....

WEBCON
In reply to: Daniel Krüger (Cosmo Consult)

*** removed ***

Please open BPS Installer, then select Tools and application management. On the next panel, let's select "Portal address configuration and click button Change user. Now, please provide credentials of the application pool user - it can be the same user as during the installation - we want to just update that info in the config database.

Finally, please restart WebCon WorkFlow Service.

In reply to: Pawel Jawien (WEBCON)

Please open BPS Installer, then select Tools and application management. On the next panel, let's select "Portal address configuration and click button Change user. Now, please provide credentials of the application pool user - it can be the same user as during the installation - we want to just update that info in the config database.

Finally, please restart WebCon WorkFlow Service.

I followed your instructions, the username was prepopulated with the right account. I entered the password, hit Save and then hit Save again on the Main Menu. I restarted the webcon flow service.

When I run the query Dan provided it still comes back with 0 results for that name and the powershell actions still give the same error.

Edit: I'm downloading the latest version and will attempt an upgrade and retry the suggestion

Edit 2: Ok, the latest version seems to have resolved it. I still had to use the process above, but I can now run PS Scripts via actions.

Thanks!