How to determine if current user is a domain or local user?
Assuming you need it in script, PowerShell:
(gwmiWin32_LogonSession).GetRelated("Win32_UserAccount")
If you expect more than one logon session, then
(gwmi Win32_Process -filter "Handle = $Pid").GetRelated("Win32_LogonSession") |% {$_.GetRelated("Win32_UserAccount")}
will give you Win32_UserAccount for the account used to run current powershell instance.