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


PowershellExchangeVisual Basic.NET

Avatar of undefined
Last Comment

8/22/2022 - Mon