KRISH2
New Member.
319 views

Execute a windows command which need admin privileged (Elevated admin rights)

Hello All,

Need your help here!!

I am using below remote command execution operation.

/Base [1.6.2]/Library/Operations/Operating Systems/Windows/Remote Command Execution

Need to run a command which need elevated privileged. Although the user who is running the flow is a part of administrator group, but still not able to run the command.

Can you please help here?

Thanks,

KB

Labels (1)
0 Likes
3 Replies
Micro Focus Expert
Micro Focus Expert

Re: Execute a windows command which need admin privileged (Elevated admin rights)

Hi,

Where are you trying to execute the command from: studio or central? Does the request use powershell or simillar command?

I am asking this because for some commands (mostly powershell related commands) the fact that you are running the command as an user who is member of the administrator  group may not be sufficient.

In case of studio for certain commands running studio as administrator (right click run as administrator) may be required (regardless of the user privileges of the user running studio or that is provided in the username\password fields).

For central on the other hand the central service in windows must be run as a specific user, not as the local system administrator that it runs as by default.

Another problem you need to be aware of is that certain commands cannot be run remotely regardles of the user privileges you may have. (for example modifying the winrm execution policy or modifying the trusted hosts for windows is not allowed to be done remotely)

 

0 Likes
KRISH2
New Member.

Re: Execute a windows command which need admin privileged (Elevated admin rights)

Hi,

Thanks for your reply!!

I am running these command from Studio.

The command is for OMW ..to enable the service "vpstat -3 -r enable".

Do you mean, if i execute the flow from central it may work?

Thanks,KB

0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Execute a windows command which need admin privileged (Elevated admin rights)

Hi,

Running it by default in central will not work. By default central runs using a lower priviledged user account than studio.

In order to make it work in studio try the things i mentioned above: start studio as administrator (right click on the studio shortcut/executable and select run as administrator). If it still doesn't work make sure the winrm configuration (visible on the powershell folder from base cp ) are all done on both the studio host and on the remote host.

If the solution to your problem is run studio as administrator, then you need to have the central service also use an explicit administrator account for logon.

 

 

For example i was trying recently to modify the contents of a text document from the c:\Temp folder. In the powershell cli my command worked, however  in studio i got the same error you are getting. After starting studio as administrator it started working in studio as well. The powershell CLI is configured by default to run as administrator, this is what usually creates confusion, because when starting powershell you never have to explicitly select run as administrator.

Regards,

Vlad

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.