Link to home
Create AccountLog in
Avatar of khptech
khptechFlag for United States of America

asked on

Powershell query and windows forms

I'm not very good at scripting but I'm trying to create a powershell script with a form that contains a text box to enter a computer name. I would like the script to plug that computer name into a powershell Active Directory query and return the result to a RichTextBox at the bottom of the form. Does anyone out there have a basic script like this that I can use as a reference?

thanks.
Avatar of Neil Russell
Neil Russell
Flag of United Kingdom of Great Britain and Northern Ireland image

Heres a very good example of working with powershell and windows forms. Covers lots more than you ask but should give you ALL and more....

http://gigadom.wordpress.com/2012/04/23/get-your-feet-wet-with-powershell-gui/
And if you follow the link on that page, another good working example...

http://gigadom.wordpress.com/2012/04/24/powershell-gui-adding-bells-whistles/
Avatar of khptech

ASKER

Those are kind of where I'm at but I would like to get the results to write back to the form itself, not to the console.
The second example DOES. Look at how it posts the messages "Working", "DONE" etc onto the form, simple.
ASKER CERTIFIED SOLUTION
Avatar of Neil Russell
Neil Russell
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of khptech

ASKER

thanks