<#
$computers = "sd\_kanderson2"
$yes = "It worked!"
$no = "Did not work :("

If ($computers -eq (hostname)) {$yes}
    else
    {
If ($computers -ne (hostname)) {$no}  
    }
    #>

#Variable
$username = "kanderson"
$computername2 = "sd\_kanderson"
$error = "No user account assigned to this hostname"

If ($computername2 -eq (hostname)) {write-host $username}
    else
    {
If ($computername2 -ne (hostname)) {write-host $error} 
    }