Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Running a powershell script in VB with custom variables

Posted on 2011-09-02
1
Medium Priority
?
199 Views
Last Modified: 2012-05-12
I have a script i run to query our exchange 2010 server in powershell,for me this is fine as i can ammend the code as i need etc, however some people in the org could use this feature but wouldnt have a clue where to begin.

Basically i want to be able to design i simple form in Visual Basic express 2010 which will have text boxes such as "Email Address" and drop down boxes that they can select the information they would like to recieve, and a few other things like date ranges etc.

However i then want them to be able to click a button and then it will build the script in VB and run it in powershell.

Is there an easy way to do this?

When it comes to VB.net however i am a complete novice, i have looked around the web and found a sample that can run a powershell file but i need to be able to dynamically update it as people select different reporting features.
0
Comment
Question by:CaptainGiblets
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 16

Accepted Solution

by:
Bryan Butler earned 2000 total points
ID: 36473085
You should be able to create the .ps1 file on the fly and then execute it.  Simply output the commands to the .ps1 file.  Here's a couple links that might help (not with creating the file, but using PS from VB....creating the file is the easy part)

http://social.msdn.microsoft.com/Forums/en/Vsexpressvb/thread/bdb25af6-4e59-49f3-a84d-224715b95a70

http://groups.google.com/group/microsoft.public.windows.powershell/browse_thread/thread/42d3a6addd93f4b8
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A brief introduction to what I consider to be the best editor for PowerShell.
In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question