Hi Bartosz,
in case you want to apply method 1 you could also try out this script.
I'm 90% sure that it works. There was a time, when the property value has been written incorrectly and we need to open the value and save it to fix something with the line breaks.
The alternative would be to not use the Designer Studio on the server at all. There's really no need for it and will just take up RAM.
Best regards,
Daniel
<#
Adding loopback exception for all bindings in IIS as well as the computer name.
There's no check what values are currently there.
If there are any, they will be replaced.
#>
#Note that you should be running PowerShell as an Administrator
$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
if (!$currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)){
throw "Must be executed as admin"
}
Import-Module Webadministration
#Using a hashtable to make sure we have no duplicate names
$urlsToExclude =@{}
$urlsToExclude[$env:COMPUTERNAME]= $true
$sites = [array](Get-ChildItem -Path IIS:\Sites)
foreach ($site in [array]$sites){
#$site = $sites[0]
Write-Host "Getting binding from site $($site.name)" -BackgroundColor cyan
foreach ($binding in $site.bindings.Collection){
Write-Host "Extracting hostname of '$($binding.bindingInformation)' from site $($site.name)" -BackgroundColor Cyan
$hostname = $binding.bindingInformation.Substring($binding.bindingInformation.LastIndexOf(":")+1).Trim()
if (![string]::IsNullOrEmpty($hostname) -and !($hostname.contains("localhost"))){
$urlsToExclude[$hostname.Trim()] = $true
}
}
}
Write-Host "Urls to exclude: '$($urlsToExclude.keys)'"
New-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0" -Name “BackConnectionHostNames” -value $urlsToExclude.keys -PropertyType ([Microsoft.Win32.RegistryValueKind]::MultiString) -Force
Read-Host -Prompt "Added loopback check exceptions, press key to exit."