Link to home
Start Free TrialLog in
Avatar of tokarbill
tokarbill

asked on

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

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.,

Thanks,
bill


ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tokarbill
tokarbill

ASKER

I had already looked at that.  I did do my homework before asking the question.  This was more of a blow off answer.  I'll give the points as I was forced to dig much deeper and solve my own problem.