Function: New-TrustedIESite – Add URLs to IE’s Security Zones
Description
This function probably doesn’t have a lot of users to most people. But in Lync, adding the Simple URL for the Lync Server Control Panel to the Local Intranet zone resolves the issue of having to enter credentials each time. Of course, I like to automate the configuration of things, so I whipped up this little function, and it will be included in some of my build scripts. The script basically creates the required registry entries under HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains. Immediately after running the function, we can see the new entry in Internet Explorer
Syntax
New-TrustedIESite [[-url] ] [[-zone] ] []
Zones are as follows:
1 Local Intranet
2 Trusted Sites
3 Internet
4 Restricted Sites
example:
New-TrustedIESite -url https://lyncadmin.contoso.com -zone 1
Will add https://www.lyncadmin.contoso.com to the Local Intranet zone
Download
v1.0 – 02-08-2014 – New-TrustedIESite.v1.0.zip
It has minor flaw, it does not accept wildcard addresses (Domains) for example all “contoso.com†subdomains: https://*.contoso.com as [System.Uri] does not support wildcards.
Quick and dirty workaround for this problem:
$uri = [System.URI] $Url.Replace(‘*’,’wildcard-means-all-hosts’)
$split = $fqdn.Trim(‘wildcard-means-all-hosts’).Split(‘.’)
Using string “wildcard-means-all-hosts†as an replacement. (Strange naming is on purpose, to minimize a chance that I would actually hit and subdomain with that name)
Other than that, excellent script.
Hmmm… that doesn’t seem to work for me. I end up with https://contoso. as the entry. I’ll see if I can track down the issue.
Did you ever revisit this? Due to formatting, I can’t see what PassingBy changed. Do you have this where it allows wild cards now?