Get PC from AD which are not renamed

PowerShell Script which find PC with wrong name.  Default name MiniNT etc.

 

$body = Get-ADComputer -Filter “Name -like ‘minint*'” -SearchBase ‘OU=Desktop,OU=Computers,OU=company,DC=company,DC=local’
If ($body -ne $Null) {
$emailFrom = “alert@mail.com”
$emailTo = “somebody@company.com”
$subject = “Wrong name PC in Active Directory”
$body = $body
$smtpServer = “webmail.com”
$smtp = new-object Net.Mail.SmtpClient($smtpServer)
$smtp.Send($emailFrom, $emailTo, $subject, $body)
}