Hi Friends,
I need your valuable suggestion on how I can achieve the following:
OS: Windows
In short: I want to understand how can I RUN a Powershell script from a Batch file by providing domain credentials (NON-INTERACTIVELY).
Here is my scenario in detail:
I have a java program, started by a Service, which creates a batch file on the fly which will have to invoke a powershell script during runtime and the powershell script has some cmdlets which need to RUN as DOMAIN USER, otherwise those cmdlets wont return values. Currently I am using a work around like.. I am running the service as the domain user and able to get the data from cmdlets, but when I run the service as Local System account I am not getting data from cmdlet.
Can you please suggest a better way to accomplish what i wanted.. getting data from cmdlet without having to run the service as domain user. Can I run the powershell script as DOMAIN USER from within the batch file. The program which creates the batch file has domain user credentials (username & password).
Please note that WinRM is disabled in the environment, otherwise I could use Invoke-Command with details and make things work without having to run the service as domain user.
Thanks a lot for your valuable suggestions.
Regards,