Hello,
I need to create a script that deletes conflcting objects within AD, and then append that info into a log. Below is what I have, however, I cannot get what is being deleted to be appended to the text file. I've tried variations and combos, including trying to use Export-Excel, or putting the line after the brackets. I've Bing'ed and consulted friends, and they do not understand why Out-File just doesn't work.
Any suggestions?
$test = dsquery * forestroot -gc -attr distinguishedname,whenchanged,whencreated -limit 0 -scope subtree -filter "(name=*\0ACNF:*)" foreach ($object in $test){ Remove-QADObject -Identity $object -Force -Verbose | Out-File -Append "c:\scripts\ConflictingObjectLog.txt" -noclobber }