I am pretty new to the powershell world. I have the following for adding users to a group from a source CSV file. I would like output errors to a text file. Can some point me in the right direction here as I am not seeing how to accomplish this. Thanks again.
Import-Csv ".\dept.csv" | %{
Add-ADGroupMember -Identity $_.Groups -Members $_.loginid