I am having trouble adding *.amazonaws.com to the trusted sites in Internet Explorer 11 (I am using the default browser shipped with Windows Server 2019)
I had tried the following combinations too, with the same error result:
*.amazonaws.com
*.amazonaws.*
*://*.amazonaws.com
http://*.amazonaws.com
https://*.amazonaws.com
etc
Since Internet Explorer is being difficult, I wanted to circumvent this by just adding the registry keys manually via PowerShell, using the following:
Set-Location "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
Set-Location "ZoneMap\EscDomains"
New-Item "amazonaws.com"
Set-Location "amazonaws.com"
New-ItemProperty . -Name * -Value 2 -Type DWORD
This doesn't seem to produce the correct output...
Not sure what I did wrong?
I also submitted the bug to the Microsoft Community here.
Related
I have a folder on a remote computer containing security camera video footage. I want to only search the *.mp4 files for those that are created between 2300 and 0600. The code:
$root = "F:\ispy\video\SWVL"
(Get-ChildItem -Path $root) | Where-Object {$_.lastWriteTime.TimeOfDay.Hours -gt 23 -or $_.LastWriteTime.TimeOfDay.Hours -lt 06} | ls | Out-GridView -PassThru
Does this perfectly, and passes the output (file list) to a PowerShell gridview.... BUT, I need the out to show the files in Windows Explorer.
I'm essentially trying to use a PowerShell script as an advanced search filter.
Hoping someone has some ideas. Eventually, I'm planning to use this as a flow -somehow- in power automate and power apps.... but need to crack this first part.
Thanks,
Gregg
AZ
Your use case is not valid. Windows Explorer
You can, in your script, do something like this.. (dropping the call to Out-GridView as it's not needed for your end results)
# find those files
Get-ChildItem -Path 'F:\ispy\video\SWVL' |
Where-Object {
$PSItem.lastWriteTime.TimeOfDay.Hours -gt 23 -or
$PSItem.LastWriteTime.TimeOfDay.Hours -lt 06} |
# copy them to a temp location
Copy-Item -Destination 'SomeTempPath' -Verbose
# open explorer in that location
Invoke-Item -Path 'SomeTempPath'
... then delete that location when you are done.
Windows Explorer-specific search/filtering is only possible in Windows Explorer. So, that means you can only search to get a specific property, then use GUI automation to send that to the Windows Explorer search box.
Otherwise, just skip the script and know this to avoid overcomplicating what you are after.
In Windows Explorer, you can filter the files by date in File Explorer using the date: keyword. You can use this keyword to find files created before, on or after a certain date. You can use the “>” and “<” signs to find files created after or before the given date. “>=” and “<=” also apply here. While you can manually type the date, File Explorer provides a simple calendar that will show up every time you type date: on the search box.
In a script, you'd have to duplicate the aforementioned. Thus capturing the date in your search, opening Windows Explorer and using SendKeys or AutoIT to select the search box and paste the info then sending enter.
Update as per my comment regarding the pop-up calendar. You can do this, in Windows Explorer to filter by date/date ranges
Manually type it in manually, which of course you could GUI automate via SendKeys or AutoIT.
Click the down arrow on any date column.
In the built-in Windows Sandbox on the latest WinOS builds, the popup still works from the Windows Explorer searchbox.
... but not on other host systems.
Update as per our last comments ...
Yet, if you are really trying to send to the Explore serachbox, then this kludge can do it,...
Start-Process -FilePath 'Explorer' 'd:\temp'
Add-Type -AssemblyName System.Windows.Forms
Start-Sleep -Seconds 2
[System.Windows.Forms.SendKeys]::SendWait('+{TAB}'*2)
[System.Windows.Forms.SendKeys]::SendWait('date: 04-Apr-20..11-Jan-21')
Start-Sleep -Seconds 1
[System.Windows.Forms.SendKeys]::SendWait('{Enter}')
... but warning SendKeys is quirky, timing-wise, etc. Sometimes is works, sometimes it does not.
I'm trying to place the taskbar location to the top with powershell and let it auto-hide.
I found this website with option three what works for most people. The only problem is I'm trying to get this fixed in Windows 10 build 14393.
https://www.sevenforums.com/tutorials/1066-taskbar-move-location-desktop-screen.html
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2]
I came across one forum who told that it was changing a registry value. I tried to do so but it didn't work. When I changed the location to the top, I looked in the regedit again and the same value was still here.
Does anyone know the location of where the registry key is stored in?
$RegKey = "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2"
$RegName = "Settings"
Set-ItemProperty -Path $RegKey -Name $RegName -Value $RegValue
Does anyone knows what I need to change?
A PS Script to toggle taskbar top or bottom, restarts Explorer in the process.
$RegistryPath = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3'
$Name = "Settings"
$NewValue = Get-ItemProperty -Path $RegistryPath
$NewValue.Settings[12] = 4-$NewValue.Settings[12]
Set-ItemProperty -Path $RegistryPath -Name $Name -Value $NewValue.Settings
Stop-Process -Name "Explorer"
I've recently been tasked with creating a PowerShell script that applies a bunch of specific settings to a Windows 10 system, many (but not all) of which require registry modifications, and I've run into some rather interesting behavior.
Here's the minimal test-case I've been using:
function set-regkey ($key, $name, $type, $value) {
if (!(test-path $key)) {
new-item -path $key -force
}
new-itemproperty -path $key -name $name -value $value -propertytype $type -force
}
set-regkey "HKCU:\SOFTWARE\Microsoft\TabletTip\1.7" "EnableAutocorrection" DWORD 0
set-regkey "HKCU:\SOFTWARE\Microsoft\TabletTip\1.7" "EnableSpellChecking" DWORD 0
This snippet should turn off the Spell Checking and Autocorrect features found in the Typing section of the Windows Settings application. When executed line-by-line by manually typing it into a Powershell window, it does exactly that. I can toggle them on manually, run the test-case by hand, and they get toggled off. However, when run from a script as the same user by right clicking on the script and selecting 'Run with Powershell', it doesn't work. I still get the exact same visible output from the New-ItemProperty calls, but the settings don't change at all, not even after logging out and back in or rebooting the system.
When trying to modify the exact same keys using the reg add command instead of New-ItemProperty, I get exactly the same results, it works when run line-by-line by hand, but fails when run as part of a script.
So far, all the Microsoft TechNet documentation I've found has been of no help, and I'm starting to suspect that I'm seeing the effects of registry virtualization, but I can't figure out why or how to prevent it.
During the course of day I often have to turn on and off "Use automatic configuration script" option in proxy settings to access web destinations that are otherwise blocked and vice versa. In other words, this checkbox:
I found that it changes AutoConfigURL property in HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings. When checkbox is on, the property is set to configuration script URL, when it's off the property is removed. So I wrote a simple PowerShell script to do the job:
$regKey = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
$propertyName = "AutoConfigURL"
$configurationScript = "http://example.com/config.dat"
$proxyStatus = (Get-ItemProperty -Path $regKey -ErrorAction SilentlyContinue).$propertyName
If ([string]::IsNullOrEmpty($proxyStatus)) {
Set-ItemProperty -Path $regKey -Name $propertyName -Value $configurationScript
} Else {
Remove-ItemProperty -Path $regKey -Name $propertyName
}
It changes the registry the way I need, however these changes have no effect. I need to open the LAN settings window under Internet properties / Connections and only then my proxy settings are changed (I don't even need to press OK or Cancel buttons, just open the window).
Are there any additional commands that should be executed after making changes to the registry to apply changes?
I found the answer to your question in the below Powershell script (It's a nicely written script).
https://github.com/majkinetor/posh/blob/master/MM_Network/Update-Proxy.ps1
This script actually forces/refreshes the internet settings. The above script refers to the msdn forum, where C# solution was mentioned.
https://social.msdn.microsoft.com/Forums/vstudio/en-US/19517edf-8348-438a-a3da-5fbe7a46b61a/how-to-change-global-windows-proxy-using-c-net-with-immediate-effect?forum=csharpgeneral
My question is, how do I find the location of the registry value that corresponds to a gpedit.msc setting. I know that there are some references on technet, but they are outdated.
For instance, if I were to try to modify the setting, configure automatic updates, through regedit, how would I be able to find the location of its value in the windows registry? Is there some kind of area in gpedit that will tell me its location?
I had the same problem and the solution I found was using PowerShell with the
PolicyFileEditor module. As far as PowerShell goes this is quite simple so don't worry about that. Taking it step by step this is what you have to do:
Start PowerShell in administrator mode
#Look up the module paths (you will probably get 3)
PS> $env:PSModulePath
#make sure you have the NuGet package
PS> Install-PackageProvider -Name NuGet -Force
#Enter the path with your username in it at the <path>
#(This only works if you have
PS> Save-Module -Name PolicyFileEditor -Path <path>
#Install the module
PS> Install-Module -Name PolicyFileEditor
#Get the machine policy registry value's
Get-PolicyFileEntry -Path "$env:windir\system32\GroupPolicy\Machine\registry.pol" -all
#Get the user policy registery valeu's
Get-PolicyFileEntry -Path "$env:windir\system32\GroupPolicy\User\registry.pol" -all
If this all works correctly than you should get something like this (Depend on gpedit settings):
The PolicyFileEditor is quite handy as it can also export the gpedit registry settings and then import them, look here for more information.
For more information on PowerShell itself I recommend the Microsoft virtual academe course.
There is however one problem with the PolicyFileEditor module and that is that while you can edit the registry these changes do not show up in the gpedit and you have to restart the computer for the changes to take effect (try testing with windows defender or something similar)
EDIT: after testing some more the LPG settings started showing up (After restart), i don't know what is up but you will have to test it for yourself.
Good luck.
There are different locations in registry for different settings in gpedit (Group Policies).
For the setting, "Configure Automatic updates", following registry gets edited.
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Group Policy Objects\<GUID key>
I realize now, but there's a really simple way to figure this out. Just go to the directory %windir%\System32\GroupPolicy\Machine and then look for the file Registry.pol. It will give you the registry keys that correspond to group policy items.
Instead of having to restart the computer, you can try the following command:
echo N | gpupdate.exe /target:Computer /force