Welcome to ServerForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Remote instance of Powershell ?

 
   Windows Server (Home) -> Windows Server Scripting RSS
Next:  Vidio contro;;er  
Author Message
Varun Bansal

External


Since: Apr 27, 2006
Posts: 14



(Msg. 1) Posted: Thu Jul 20, 2006 1:34 pm
Post subject: Remote instance of Powershell ?
Archived from groups: microsoft>public>windows>server>scripting (more info?)

Hi all,

Scenario:

Machine A : Exhange 2007 and Powershell installed
Machine B : Powershell installed

I want to execute Exchange cmdlets programmatically from my application
which runs on Machine B. In my application code, I'm trying to add an
Exchange snapin to execute the cmdlets. The code looks like this.

rc = RunspaceConfiguration.Create();
snapInfo = rc.AddPSSnapIn("Microsoft.Exchange.Management.Msh.Admin", out
snapEx);

Is it possible to add a remote Exchange snapin this way? If not then the
other way may be to invoke a remote Powershell instance on Machine A and
then add the Exchange snapin. How can that be done? Does Powershell provide
remoting APIs?

Thanks in advance.
Varun

 >> Stay informed about: Remote instance of Powershell ? 
Back to top
Login to vote
Andrew Watt [MVP]

External


Since: Dec 15, 2005
Posts: 241



(Msg. 2) Posted: Thu Jul 20, 2006 7:08 pm
Post subject: Re: Remote instance of Powershell ? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Thu, 20 Jul 2006 13:34:08 -0400, "Varun Bansal"
<varun_bits.TakeThisOut@yahoo.com> wrote:

>
>Scenario:
>
>Machine A : Exhange 2007 and Powershell installed
>Machine B : Powershell installed

On Machine A do you mean that you have PowerShell installed? Or Monad
installed?

Exchange 2007 won't move from Monad conventions to PowerShell
conventions until a build some time afte Exchange 2007r Beta 2 as I
understand things.

Andrew Watt MVP

 >> Stay informed about: Remote instance of Powershell ? 
Back to top
Login to vote
Varun Bansal

External


Since: Apr 27, 2006
Posts: 14



(Msg. 3) Posted: Thu Jul 20, 2006 7:08 pm
Post subject: Re: Remote instance of Powershell ? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

You're right Andrew. And hence I'm currently using AddMshSnapin. Since,
Exchange 2k7 has not yet moved to Powershell, I'm using Monad.


"Andrew Watt [MVP]" <SVGDeveloper DeleteThis @aol.com> wrote in message
news:5jhvb2lmfq317qm4prfluf0gdc8q3i36b2@4ax.com...
> On Thu, 20 Jul 2006 13:34:08 -0400, "Varun Bansal"
> <varun_bits DeleteThis @yahoo.com> wrote:
>
>>
>>Scenario:
>>
>>Machine A : Exhange 2007 and Powershell installed
>>Machine B : Powershell installed
>
> On Machine A do you mean that you have PowerShell installed? Or Monad
> installed?
>
> Exchange 2007 won't move from Monad conventions to PowerShell
> conventions until a build some time afte Exchange 2007r Beta 2 as I
> understand things.
>
> Andrew Watt MVP
 >> Stay informed about: Remote instance of Powershell ? 
Back to top
Login to vote
Andrew Watt [MVP]

External


Since: Dec 15, 2005
Posts: 241



(Msg. 4) Posted: Thu Jul 20, 2006 8:13 pm
Post subject: Re: Remote instance of Powershell ? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I haven't had occasion to try mixing PS snapins and MSH snapins so
can't comment on the viability of that approach unfortunately.

Being more specific, what tasks do you want the Exchange cmdlets to
do? If you install run Exchange cmdlets on an Exchange server you
should be able to remotely access other Exchange machines, as I
understand the situation.

Are there reasons why your app can't or shouldn't run on a machine
with Exchange 2007 installed?

Andrew Watt MVP

On Thu, 20 Jul 2006 14:27:30 -0400, "Varun Bansal"
<varun_bits.TakeThisOut@yahoo.com> wrote:

>You're right Andrew. And hence I'm currently using AddMshSnapin. Since,
>Exchange 2k7 has not yet moved to Powershell, I'm using Monad.
>
>
>"Andrew Watt [MVP]" <SVGDeveloper.TakeThisOut@aol.com> wrote in message
>news:5jhvb2lmfq317qm4prfluf0gdc8q3i36b2@4ax.com...
>> On Thu, 20 Jul 2006 13:34:08 -0400, "Varun Bansal"
>> <varun_bits.TakeThisOut@yahoo.com> wrote:
>>
>>>
>>>Scenario:
>>>
>>>Machine A : Exhange 2007 and Powershell installed
>>>Machine B : Powershell installed
>>
>> On Machine A do you mean that you have PowerShell installed? Or Monad
>> installed?
>>
>> Exchange 2007 won't move from Monad conventions to PowerShell
>> conventions until a build some time afte Exchange 2007r Beta 2 as I
>> understand things.
>>
>> Andrew Watt MVP
 >> Stay informed about: Remote instance of Powershell ? 
Back to top
Login to vote
Varun Bansal

External


Since: Apr 27, 2006
Posts: 14



(Msg. 5) Posted: Thu Jul 20, 2006 8:13 pm
Post subject: Re: Remote instance of Powershell ? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

My requirement is to run my app off-Exchange. If I don't mix, and use Monad
on both machines, is it possible to load the Exchange snapin in my
application given the scenario that Exchange is installed on machine A and
my app runs on machine B ?

Thanks for your quick responses.
Varun

"Andrew Watt [MVP]" <SVGDeveloper.TakeThisOut@aol.com> wrote in message
news:chkvb2hncl0gkg98n220tm0dejllo1ll9v@4ax.com...
>I haven't had occasion to try mixing PS snapins and MSH snapins so
> can't comment on the viability of that approach unfortunately.
>
> Being more specific, what tasks do you want the Exchange cmdlets to
> do? If you install run Exchange cmdlets on an Exchange server you
> should be able to remotely access other Exchange machines, as I
> understand the situation.
>
> Are there reasons why your app can't or shouldn't run on a machine
> with Exchange 2007 installed?
>
> Andrew Watt MVP
>
> On Thu, 20 Jul 2006 14:27:30 -0400, "Varun Bansal"
> <varun_bits.TakeThisOut@yahoo.com> wrote:
>
>>You're right Andrew. And hence I'm currently using AddMshSnapin. Since,
>>Exchange 2k7 has not yet moved to Powershell, I'm using Monad.
>>
>>
>>"Andrew Watt [MVP]" <SVGDeveloper.TakeThisOut@aol.com> wrote in message
>>news:5jhvb2lmfq317qm4prfluf0gdc8q3i36b2@4ax.com...
>>> On Thu, 20 Jul 2006 13:34:08 -0400, "Varun Bansal"
>>> <varun_bits.TakeThisOut@yahoo.com> wrote:
>>>
>>>>
>>>>Scenario:
>>>>
>>>>Machine A : Exhange 2007 and Powershell installed
>>>>Machine B : Powershell installed
>>>
>>> On Machine A do you mean that you have PowerShell installed? Or Monad
>>> installed?
>>>
>>> Exchange 2007 won't move from Monad conventions to PowerShell
>>> conventions until a build some time afte Exchange 2007r Beta 2 as I
>>> understand things.
>>>
>>> Andrew Watt MVP
 >> Stay informed about: Remote instance of Powershell ? 
Back to top
Login to vote
Varun Bansal

External


Since: Apr 27, 2006
Posts: 14



(Msg. 6) Posted: Thu Jul 20, 2006 8:13 pm
Post subject: Re: Remote instance of Powershell ? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Also, I'm just enumerating the Exchange resources like storage groups,
mailboxes etc.


"Varun Bansal" <varun_bits DeleteThis @yahoo.com> wrote in message
news:%23zClUfDrGHA.4988@TK2MSFTNGP04.phx.gbl...
> My requirement is to run my app off-Exchange. If I don't mix, and use
> Monad on both machines, is it possible to load the Exchange snapin in my
> application given the scenario that Exchange is installed on machine A and
> my app runs on machine B ?
>
> Thanks for your quick responses.
> Varun
>
> "Andrew Watt [MVP]" <SVGDeveloper DeleteThis @aol.com> wrote in message
> news:chkvb2hncl0gkg98n220tm0dejllo1ll9v@4ax.com...
>>I haven't had occasion to try mixing PS snapins and MSH snapins so
>> can't comment on the viability of that approach unfortunately.
>>
>> Being more specific, what tasks do you want the Exchange cmdlets to
>> do? If you install run Exchange cmdlets on an Exchange server you
>> should be able to remotely access other Exchange machines, as I
>> understand the situation.
>>
>> Are there reasons why your app can't or shouldn't run on a machine
>> with Exchange 2007 installed?
>>
>> Andrew Watt MVP
>>
>> On Thu, 20 Jul 2006 14:27:30 -0400, "Varun Bansal"
>> <varun_bits DeleteThis @yahoo.com> wrote:
>>
>>>You're right Andrew. And hence I'm currently using AddMshSnapin. Since,
>>>Exchange 2k7 has not yet moved to Powershell, I'm using Monad.
>>>
>>>
>>>"Andrew Watt [MVP]" <SVGDeveloper DeleteThis @aol.com> wrote in message
>>>news:5jhvb2lmfq317qm4prfluf0gdc8q3i36b2@4ax.com...
>>>> On Thu, 20 Jul 2006 13:34:08 -0400, "Varun Bansal"
>>>> <varun_bits DeleteThis @yahoo.com> wrote:
>>>>
>>>>>
>>>>>Scenario:
>>>>>
>>>>>Machine A : Exhange 2007 and Powershell installed
>>>>>Machine B : Powershell installed
>>>>
>>>> On Machine A do you mean that you have PowerShell installed? Or Monad
>>>> installed?
>>>>
>>>> Exchange 2007 won't move from Monad conventions to PowerShell
>>>> conventions until a build some time afte Exchange 2007r Beta 2 as I
>>>> understand things.
>>>>
>>>> Andrew Watt MVP
>
>
 >> Stay informed about: Remote instance of Powershell ? 
Back to top
Login to vote
Irfi




Joined: Dec 05, 2006
Posts: 1



(Msg. 7) Posted: Tue Dec 05, 2006 10:53 pm
Post subject: Re: Remote instance of Powershell ? [Login to view extended thread Info.]

Hi,

I am about to do the same thing that you had pointed out couple of months ago. Incase you know the solution, I would really appreciate if you could share it with me.

I have installed Exchange 2007 on Machine A, and my ASP.NET app is going to reside on Machine B.

I have installed the Monad on machine B.

What I am trying to achive is to create a mailbox for a user on Machine A using the following program -

RunspaceConfiguration rc = RunspaceConfiguration.Create();
MshSnapInException snapEx = null;

MshSnapInInfo info = rc.AddMshSnapIn("Microsoft.Exchange.Management.Msh.Admin", out snapEx);
Runspace r = RunspaceFactory.CreateRunspace(rc);

r.Open();
RunspaceInvoke ri = new RunspaceInvoke(r);
ri.Invoke("enable-mailbox -identity domain\\username –database \"Mailbox Database\"");

I am new to this and dont have much clue on how to run it and how this works. It would be great if you could help me out.

Thanks,
Irfi
 >> Stay informed about: Remote instance of Powershell ? 
Back to top
Login to vote
Harshada




Joined: Sep 05, 2007
Posts: 1



(Msg. 8) Posted: Wed Sep 05, 2007 6:31 am
Post subject: Re: Remote instance of Powershell ? [Login to view extended thread Info.]

Hi,

I am also facing the same problem.Has anyone found a solution?


Thanks
Harshada
 >> Stay informed about: Remote instance of Powershell ? 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Connecting to a remote machine - Hi, I am having trouble connecting to remote machines. My script will connect to a few of the machines on our network, but not others. I know this is a broad question, but any ideas on why this is happening? This is line it crashes on: Set oWMI =..

Remote comuter access + FileSystemObject? - Hi! :-) I'd like to know if it's possible to access the FileSystemObject on a remote machine. In this case to check the remainging space on the HDs of my file server. Right now I can only access the local machine with: Set objFileSystem =..

WMI Remote Script - Dear all, I would like to get help from you to demomstrate how to make a WMI script running in same domain for inventory collection. Regards and Thanks.

identifying remote services - I am totally in the dark as far as scripting goes. Hoping someone could help me. I would like a script that would query my AD for a list of machine names, then I want to use the "psservice find" or some other command that will return the machi...

geting drive details from Remote Computer - Is it possible to get freespace / drive details from Remote Computer or from a computer in a different Domain If so, how it is to be script
   Windows Server (Home) -> Windows Server Scripting All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]