Save the script in a file with a .ps1 extension.
The easiest way to do this would be to save the group list text file in the same directory. Excecute the script by dot sourcing it (prepend it with ./) from the shell. Eg: if your script is named find_groups.ps1 and your text file is groups.txt, and they're in the c:\scripts directory Set-location c:\scripts ./find_groups.ps1 You'll need to run the set-executionpolicy command first and set the execution policy to either remotesigned or unrestricted before it will run scripts from the shell. You only have to do this once. ________________________________ From: Naresh Kumar [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 10, 2008 4:00 AM To: Active Directory Admin Issues Subject: Re: Scripting ~ NEW: CounterSpy Enterprise: Centralized Antispyware - #1 in eWEEK Test! ~ ~ ~ ************************************************************************************************** Note: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. ************************************************************************************************** ~ NEW: CounterSpy Enterprise: Centralized Antispyware - #1 in eWEEK Test! ~ ~ <http://www.sunbelt-software.com/product.cfm?id=400> ~
