Mirek1 Absent Member.
Absent Member.
1454 views

HPOO v10.6 VBS Script execution problem

Hello,

Im trying to execute remote command, but when I specify user for this command execution a get an error:

{exception=System.Exception: Could not read/parse the process return code. Please verify that the user has the proper access to run remote commands.
   at dotNETWebActions_RemoteExecution.RemoteExecution.Execute(ActionRequest req, ISession s, IActionRegistry reg);StdErr=;returnCode=1;ProcessReturnCode=;returnResult=Could not read/parse the process return code. Please verify that the user has the proper access to run remote commands. ;StdOut=;ReturnValue=0;ProcessID=6512;sessionId=new session;isSessionOn=False;Result=;}

HPOO System account which Im using is linked with windows local user, which has admin rights and command can be executed under this user from windows command line without problems.

Is it possible to set permissions for System accounts like in version 9 (System accounts -> right-click on user name -> Permissions)?

Thank you.

Labels (1)
0 Likes
7 Replies
AndreiTruta Outstanding Contributor.
Outstanding Contributor.

Re: HPOO v10.6 System Accounts - Permissions

Hi,

I am a little bit confused. It would help if you could provide more details about how you designed the flow and what exactly you are trying to achieve.

For the System Accounts you can go to Central under the Configuration Items and view and alter permissions for the system accounts - if you log into Central as an administrator.

 

Andrei Vasile Truta
0 Likes
Mirek1 Absent Member.
Absent Member.

Re: HPOO v10.6 System Accounts - Permissions

Hello Andrei,

I need to run vbs script under specific windows user. Please check the attachment for more info.

Thank you.

0 Likes
Established Member.. TerrySummers
Established Member..

Re: HPOO v10.6 System Accounts - Permissions

"HPOO System account which Im using is linked with windows local user, which has admin rights and command can be executed under this user from windows command line without problems."

Could it be trying an AD/LDAP lookup? I say that because you mention it's a local account.
Is your HPOO central server or the remote server the command is trying to be run on linked to an AD?

0 Likes
Mirek1 Absent Member.
Absent Member.

Re: HPOO v10.6 System Accounts - Permissions

Hello,

everything is on the same host (HPOO studio, central, user, vb script).

0 Likes
Mirek1 Absent Member.
Absent Member.

Re: HPOO v10.6 System Accounts - Permissions

Hello,

I found new interesting fact. When I execute simple vbs script, everything is working fine. But because my HPOO is running on windows server 2012R2 and I need full admin right for my script (same like if you run command line with "Run as administrator" option), I have to use this workaround:

RunAsAdmin()

.......

Script Body

.......

Function RunAsAdmin()
  Dim objApp
    if WScript.Arguments.length = 3 Then
      Set objAPP = CreateObject("Shell.Application")
      objAPP.ShellExecute "wscript.exe", Wscript.ScriptFullName & " " & ObjArgs(0) &" "& ObjArgs(1) &" "& ObjArgs(2) & " RunAsAdministrator",,"runas", 1
      WScript.Quit
    End If
End Function

When I execute it from command line, everything is working just fine, but when I execute it from HPOO studio, the flow stuck for a while on this operation and than fail with this error:

{exception=System.Exception: Could not read/parse the process return code. Please verify that the user has the proper access to run remote commands.
   at dotNETWebActions_RemoteExecution.RemoteExecution.Execute(ActionRequest req, ISession s, IActionRegistry reg);StdErr=;returnCode=1;ProcessReturnCode=;returnResult=Could not read/parse the process return code. Please verify that the user has the proper access to run remote commands. ;StdOut=Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

;ReturnValue=0;ProcessID=9640;sessionId=new session;isSessionOn=False;Result=Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

;}

I will be very glad for any help.

0 Likes
EASJosh Respected Contributor.
Respected Contributor.

Re: HPOO v10.6 System Accounts - Permissions

Hi Mirek,

I note in your screenshot, that you've deleted the input user, and are now using the input username.

Is there any reason for this? Does the operation work when you specify your username under 'user' as oppose to 'username'?

I have tried this and I am able to execute VBScripts fine in my lab. Are you able to share the full VBScript that you are trying to execute?

Cheers,
Josh


--------------------------------------
If my post helped you, please click the 'Kudos' button.
0 Likes
Mirek1 Absent Member.
Absent Member.

Re: HPOO v10.6 System Accounts - Permissions

Hello Josh,

the vbscript serve for local user creation and everything is running just fine if UAC is dissabled. Because I cant to disable UAC (it is agains the policy), I added this function into the script:

Function RunAsAdmin()
  Dim objApp
    if WScript.Arguments.length = 3 Then
      Set objAPP = CreateObject("Shell.Application")
      objAPP.ShellExecute "wscript.exe", Wscript.ScriptFullName & " " & ObjArgs(0) &" "& ObjArgs(1) &" "& ObjArgs(2) & " RunAsAdministrator",,"runas", 1
      WScript.Quit
    End If
End Function

You can use it in any vbscript, just adjust number if arguments (ObjArgs(0) &" "& ObjArgs(1) &" "& ObjArgs(2) ) and if WScript.Arguments.length = "number of arguments". This function just execute your old vbsript again with admin rights and close the old one. Please try to test it and let me know of it works for you.

Thanks.

Mirek

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.