I'm not very knowledgeable with PowerShell, but I was wondering how you could write the output of the script (excerpt below) to a file in my local directory, instead of to the screen?
{
$userEntry = $result.GetDirectoryEntry()
Write-Host "User Name = " $userEntry.name
foreach ($SPN in $userEntry.servicePrincipalName)
{
Write-Host "SPN = " $SPN
}
Write-Host ""
}