I have several windows 2003 boxes that I'm trying to get the output of gpresult in a text file format. Here is what I have so far:
$Computers = Import-Csv ".\GPResultComputers.csv" foreach ($Computer in $Computers) { GPResult /R /S $Computer.ComputerName > "GPResult $Computer.txt" }
The script starts, but hangs on the first computer object in the csv file. I've gotten this script to run if I take out all of the powershell and just run this with a single computer name in the actual code, running within a .ps1 powershell script file.
Any help in fixing the hang in the script is appreciated!
- Edited by Thomas Garrity 7 hours 16 minutes ago