Using PS to change Edge Homepage on VM. Getting Error

I’m working on building a script that will change the Homepage in Edge for a bunch of VM’s running in Enterprise. I am looking for a way in powershell to do this, but nothing seems to make the change the will stick with the new image created proactively.

I tried many things, like this for instance:

# Ensure Edge key exists
$EdgeHome = 'HKCU:\Software\Policies\Microsoft\Edge'
If ( -Not (Test-Path $EdgeHome)) {
  New-Item -Path $EdgeHome | Out-Null
}
# Set RestoreOnStartup value entry
$IPHT = @{
  Path   = $EdgeHome 
  Name   = 'RestoreOnStartup' 
  Value  = 4 
  Type   = 'DWORD'
}
Set-ItemProperty @IPHT -verbose
# Create Startup URL's registry key
$EdgeSUURL = "$EdgeHome\RestoreOnStartupURLs"
If ( -Not (Test-Path $EdgeSUURL)) {
  New-Item -Path $EdgeSUURL | Out-Null
}
# Create a single URL startup page
$HOMEURL = 'https://duckduckgo.com'
Set-ItemProperty -Path $EdgeSUURL -Name '1' -Value $HomeURL

But had no luck.

Please help?!

Any reason why you cant do this VIA GPO?

\Computer Config\Admin Templates\Windows Components\Microsoft Edge\Configure Start Pages
\User Config\Admin Templates\Windows Components\Microsoft Edge\Configure Start Pages

I don’t believe the company uses Group Policy, or it almost seemed as though what’s preventing me from changing anything myself is that there is a GP that already exists and is blocking me.

I have no idea, I’m very in over my head

Well you cant be too much over your head if they gave you admin to write to registry values? Could that also be the issue why this is failing for you? Are you getting errors you can share?

I tried changing the GPO settings, which I did have access too, but the edge homepage did not change. Must be something overriding it?

Did you try a “gpudate /force” on the client system? Although by now, it should have replicated.