Register
: :
Login
Home
News
Forums
Scripts
User Groups
Resources
About
Forums
Search
Members
Unanswered
Active Topics
Forums
>
PowerShell Development
>
Cmdlet Development
Problem running cmdlet from Java code
Last Post 19 Jul 2010 03:34 AM by
sp
. 5 Replies.
Sort:
Oldest First
Most Recent First
Prev
Next
You are not authorized to post a reply.
Author
Messages
lounge
New Member
Posts:11
11 Nov 2009 07:04 AM
Hello
This is the line I want to run:
C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\bin\exshell.psc1" Enable-Mailbox -Alias 'XXXXXXX' -identity 'XXX.XX\XXXXX' -Database 'XXXXXX\SG1\MDB1' -ManagedFolderMailboxPolicyAllowed -domainController XXXX.XXXXXXXX.XXX'
It works perfect when I run it in the console, and I get an output that the mailbox has been enabled. But when I try to run the same line from my Java application in a Process, nothing happens.
Any thoughts on this?
Thanks in advance.
Fred.
Marco Shaw (MVP)
Veteran Member
Posts:1642
11 Nov 2009 08:14 AM
You're not trying to do any kind of Java remoting? Are you using the current user's credentials in your Java app? Are those the same credentials that are able to run the command OK?
Marco
*Microsoft MVP - Windows PowerShell
https://mvp.support.microsoft.com/profile/Marco.Shaw
*Co-Author - Sams Windows PowerShell Unleashed 2nd Edition
*Blog - http://marcoshaw.blogspot.com
lounge
New Member
Posts:11
13 Nov 2009 12:34 AM
Hi, thank you for your reply
The application is connected to Active Directory, so it uses the same credentials that I use when I run the script in the console.
Isn't this very strange?
Fred.
Marco Shaw (MVP)
Veteran Member
Posts:1642
13 Nov 2009 05:34 AM
Sorry, again... No remoting involved? Have you tried some simpler PowerShell commands to see if it will even run basic stuff?
Marco
*Microsoft MVP - Windows PowerShell
https://mvp.support.microsoft.com/profile/Marco.Shaw
*Co-Author - Sams Windows PowerShell Unleashed 2nd Edition
*Blog - http://marcoshaw.blogspot.com
lounge
New Member
Posts:11
17 Nov 2009 04:17 AM
No there is no remoting, the application is running on the same server that the powershell script is being (or should be) executed on.
sp
New Member
Posts:5
19 Jul 2010 03:34 AM
Hi marco.shaw,
I too face the same issue tried to create mailbox in Outlook live using powerhsell command and it works. But, when i execute the same from java class it's hanging out.
Environment: Win 2003 server SP2, Powershell 2.0.
Please suggest.
Thanks
SP
You are not authorized to post a reply.
Using PowerShell
--General PowerShell
--Books, Tools, and Videos
--Exchange Server
--Active Directory
--System Center Family
--Non-Microsoft Products
--SharePoint
--SQL Server
--Working with .NET
--Peer Review
--Testing, Testing...
PowerShell Development
--Cmdlet Development
--PSDrive Provider Development
--Hosting the Shell
Looking Ahead
--Using PowerShell v2.0
--Developing for PowerShell v2.0
PowerShellCommunity.org
--Community Announcements and Assistance
--Completely Unrelated
--User Groups
--Community Business
----Suggestion Box
Forums
>
PowerShell Development
>
Cmdlet Development
Active Forums 4.3
Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2