Is there an easy and fast way to find out if the local computer is joined to a domain with PowerShell?
I find lots of stuff about getting the current wo
This is simple. Works because if a computer is not in a domain, the default userdomain is the local computer
if ($env:computername -eq $env:userdomain) { echo " no AD domain" } else { echo "must be in AD"}