We help IT Professionals succeed at work.
Get Started

Executing a local PS1 file in Exchange 2010 with VB.NET

Last Modified: 2012-05-11
I have an Exchange 2007 Management program written in VB.NET.  Many of the PS queries were PS1 files that I create on the fly and execute, redirecting the output to a simple text file.  This all worked just fine.

Now I have to update the tool to work with Exchange 2010.  I am looking for an example of executing a local PS1 file (i.e. c:\temp\myfile.ps1) in a VB.NET environment.  The PS1 file could be something as simple as a single line

get-mailboxpermission -identity me@mine.com  | where {$_.AccessRights -like "FullAccess"} export-csv "c:\temp\output.txt"

Or much more complex.

I know I can run the file interactively, I just can't figure out how to run it programmatically.,


Watch Question
Most Valuable Expert 2012
Top Expert 2014
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE