I'm trying to get this script to output the results to a txt file, but I still have a lot to learn about Powershell. This includes how to output the results of a for loop to a txt file. Any help would be appreciated. Is this the right command? Out-File -filepath C:\Test1\process.txt. If so, I'm just not sure where to put it at.
$strCategory = "computer"
$strOperatingSystem = "Windows*Server*"
$objDomain = New-Object System.DirectoryServices.DirectoryEntry("LDAP://DC=Domain,DC=com")
$objSearcher = New-Object System.DirectoryServices.DirectorySearcher
$objSearcher.SearchRoot = $objDomain
$objSearcher.Filter = ("OperatingSystem=$strOperatingSystem")
$colProplist = "name"
foreach ($i in $colPropList){$objSearcher.PropertiesToLoad.Add($i)}
$colResults = $objSearcher.FindAll()
foreach ($objResult in $colResults)
{
$objComputer =...