There are many examples here on the board

My string that I use all of the time is like this

If TranslateName (3,"",3,@domain+"\"+@User,1)[1] <> 0
MessageBox("Invalid User","Error",16)
EndIf
_________________________
Today is the tomorrow you worried about yesterday.