Results 1 to 7 of 7

Thread: Run Windows Powershell from Java

  1. #1
    Join Date
    Jan 2010
    Posts
    126

    Run Windows Powershell from Java

    Hello,
    I want to run a JSP Web application (JBoss 4.2.2.GA + JDK 1.6) where I means a PowerShell script for an Exchange Server 2003. So far so good. Then it brings me, however the error in the return:
    Code:
    WARNING: The following errors occurred when loading console C: \ Program 
    Files \ Microsoft \ Exchange Server \ Scripts \ example.psc1: 
    Can not load Windows PowerShell snap-in 
    Microsoft.Exchange.Management.PowerShell.Admin because of the following error: 
    Windows PowerShell snap-in is Microsoft.Exchange.Management.PowerShell.Admin 
    not installed on the machine.
    I have no idea what this error means, if you can help me with this then it would be great. Thank you.

  2. #2
    Join Date
    Mar 2010
    Posts
    303

    Re: Run Windows Powershell from Java

    You could command in a bat file store and run it. It works smoothly in my opinion [as the String] for the command
    Code:
    Process process = Runtime.getRuntime (). Exec ("cmd / c \" "+ thefile+" \ "");
    It is how you do it, if you have not done this in your code then please change your code.

  3. #3
    Join Date
    Mar 2010
    Posts
    303

    Re: Run Windows Powershell from Java

    Did I already tried, the problem is, it takes the snap-in is not if he runs in java, it says yes, that it is installed on the local machine, but it is installed and under CMD.exe does the powershell command so perfectly. Service runs under Administrator account-has, including access to the snap-in. If you have any other solution for this then please let me know. Thank you.

  4. #4
    Join Date
    Nov 2009
    Posts
    330

    Re: Run Windows Powershell from Java

    Let the whole time in a Java program to run, which is not running in a JBoss or Tomcat. You may reach through the container any restrictions on access to local resources. A "normal" VM is fairly unrestricted access.

  5. #5
    Join Date
    Dec 2009
    Posts
    292

    Re: Run Windows Powershell from Java

    I know from our server admin that it is because he does not find the snap and can not load because of the execute on the JVM, it loads the profile does not, do not talk as administrator and thus no access. I've searched me a vbscript that runs files through runas.exe with username + pw does not, however, as this turn a second VBScript cmd would start and withstood the JVM does not seem. Someone ne other good possibility (VB 6.0) or via LDAP to create a user in Exchange? Reading works because of jsp / java and ldap using so "select" command, only inserts do not work because it lubricates the executeQuery or executeUpdate from me.

  6. #6
    Join Date
    Nov 2009
    Posts
    335

    Re: Run Windows Powershell from Java

    I know from our server admin that it is because he does not find the snap and can not load because of the execute on the JVM, it loads the profile does not, do not talk as administrator and thus no access. I've searched me a vbscript that runs files through runas.exe with username + pw does not, however, as this turn a second VBScript cmd would start and withstood the JVM does not seem. Someone ne other good possibility (VB 6.0) or via LDAP to create a user in Exchange? Reading works because of jsp / java and ldap using so "select" command, only inserts do not work because it lubricates the executeQuery or executeUpdate from me.

  7. #7
    Join Date
    Jan 2010
    Posts
    119

    Re: Run Windows Powershell from Java

    This should, however,but also in a file executable. So as a normal user the requested access from the Java process and inside the switch happened to the other users. Now test, but I think it should go. Tasting time tomorrow at work (if I find some time) and then sign up times.

Similar Threads

  1. Windows Vista Powershell
    By DeMario in forum Software Development
    Replies: 3
    Last Post: 14-11-2009, 09:34 PM
  2. What is Windows PowerShell
    By Antonio1 in forum Windows Software
    Replies: 3
    Last Post: 12-11-2009, 06:30 PM
  3. Windows Powershell Training
    By OBAMA in forum Education Career and Job Discussions
    Replies: 3
    Last Post: 26-06-2009, 06:57 PM
  4. Windows PowerShell Select-String
    By HP_Crook in forum Software Development
    Replies: 3
    Last Post: 02-06-2009, 10:51 AM
  5. Can't uninstall Windows Powershell 1.0
    By akhtar in forum Vista Setup and Install
    Replies: 3
    Last Post: 27-10-2008, 02:43 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,569,980.54234 seconds with 16 queries