You’ve just installed and configured a SharePoint server and you fire-up IE on the server to see if everything works…..Oops, IE keeps asking for your credentials and eventually returns a HTTP 401. Then you notice that the sites are accessible from other machines. In this case you’re running into a security measure called the loopback check security feature. See http://support.microsoft.com/kb/896861 for the details.

Here’s how to disable the check just for your specific sites on that machine with a short PowerShell script:

$sites=@(
    "portal.contoso.com",
    "my.contoso.com"
)
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0" -PropertyType MultiString -Name BackConnectionHostNames -Value $sites

Here is how to completely disable the Loopback check on Windows using a single PowerShell command:

New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa" -Name DisableLoopbackCheck -Value 1 -PropertyType DWORD