J R
J R

Reputation: 55

Powershell script to enable the cookies in Internet Explorer

We are creating a Windows EC2 instance, installing gateway in pipeline and then registering Microsoft on-premises gateway manually. While registering the gateway, it expects cookies enabled in IE. We are enabling the cookies in IE manually. We want to automate this step and include it in the pipeline. Can someone suggest a powershell script to enable the cookies in IE?

I am currently enabling the cookies as follows:

Select 'Internet Options' from the Tools menu.
Click on the 'Privacy' tab.
Select the 'Advanced' button
Under 'First-party Cookies' and 'Third-party Cookies', choose Accept
Select 'OK' when done

Upvotes: 0

Views: 55

Answers (1)

Nifriz
Nifriz

Reputation: 1244

Try with this:

# Path to Internet Explorer's Privacy settings in the Windows registry
$registryPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3"

# Set the value for '1A10' to controls cookies
# 0 = Allow all cookies, 1 = Block all cookies, 2 = Prompt for cookies

Set-ItemProperty -Path $registryPath -Name "1A10" -Value 0

Upvotes: 0

Related Questions