When setting up new users we have 6 pages that are requested to be readily accessible. i have a script that works 33% of the way
[pre]$HomeURL = “http://site1.com "
$HomeURL2 = “https://site2.com ”
$HomeURL3 = “https://site3.com ”
$HomeURL4 = “https://site4.com ”
$HomeURL5 = “https://site5.com ”
$HomeURL6 = “http://site6.com ”
set-ItemProperty -Path ‘HKCU:\Software\Microsoft\Internet Explorer\main’ -Name “Start Page” -Value $HomeURL
set-ItemProperty -Path ‘HKCU:\Software\Microsoft\Internet Explorer\main’ -Name “Secondary Start Pages” -Value $HomeURL2,$HomeURL3,$HomeURL4,$HomeURL5,$HomeURL6,[/pre]
the first two URLs are opened but 3-6 are not. i have tried the , and the ; to separate the secondary start pages but no luck.
if you could let me know how i can reformat so that all the tabs open with their respective URL i would be thankful
Olaf
May 1, 2019, 6:45am
2
$Path = 'HKCU:\Software\Microsoft\Internet Explorer\main'
$StartPage = 'http://site1.com'
$SecondaryStartPageList = @(
'https://site2.com',
'https://site3.com',
'https://site4.com',
'https://site5.com',
'http://site6.com'
)
Set-ItemProperty -Path $Path -Name 'Start Page' -Value $StartPage
Set-ItemProperty -Path $Path -Name 'Secondary Start Pages' -Value $SecondaryStartPageList
Thank you for the help
it opens up the tabs but the urls are all strung along in the address bar and cannot open the page correctly
for example on the second tab the url is https://site2.com %https://site3.com %https//site4.com
i tried changing the , to ; with no luck
When you create the reg entry, is the type “REG_MULTI_SZ”? May be a silly question, but maybe why the second tab is combining the rest of the urls into a single string.
pwshliquori
they are REG_SZ not REG_MULTI_SZ
a simple way around it is i just copied the desired urls to notepad to a public drive and copy and pasted it. but now this is going to bug me where its going wrong in script form
If you set the type to REG_MULTI_SZ and use the example from @Olaf-Soyk , it should work. I have tested and confirmed working in my lab environment.
Start Page
type should be REG_SZ
and
Secondary Start Pages
type should be REG_MULTI_SZ
pwshliquori
thank you i will give that a test. i do appreciate the help on this
If you set the type to REG_MULTI_SZ and use the example from @olaf-soyk , it should work. I have tested and confirmed working in my lab environment.
Start Page
type should be REG_SZ
and
Secondary Start Pages
type should be REG_MULTI_SZ
going by the code below where would the reg_multi_sz go?
Set-ItemProperty -Path $Path -Name ‘Start Page’ -Value $StartPage
Set-ItemProperty -Path $Path -Name ‘Secondary Start Pages’ -Value $SecondaryStartPageList
Set-ItemProperty
cannot update the type of a registry entry. You can use the New-ItemProperty
, -Type
and -Force
to update the type of the entry.
You can find more information about New-ItemProperty
from here
pwshliquori