In windows machine, Do we have any way to enable the "Allow fonts to be installed using a shortcut (advanced)" option in Control Panel\Appearance and Personalization\Fonts\Font settings using powershell script.
Image of Font Settings Option
Highlighted checkbox should be enabled
Thanks in advance
if (-not (Test-Path "HKCU:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Font Management"))
{
New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Font Management" -Force
}
New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Font Management" -Name "InstallAsLink" -PropertyType DWord -Value 1 -Force
Related
BeyondTrust Privileged Remote Access has a button to send Ctrl+Alt+Del to the remote system. I've been able to block Ctrl+Alt+Del for non-remote use by using the HKLM:\SYSTEM\CurrentControlSet\Control\Keyboard Layout's Scancode Map property and/or Keyboard Filter. Neither of those block it when sent by Privileged Remote Access. Is there a way to block it when sent by Privileged Remote Access?
In the meantime, I've disabled all of the options on the Ctrl+Alt+Del screen by running the following PowerShell code:
# Disable Ctrl+Alt+Del screen Switch User option.
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name HideFastUserSwitching -Value 1
# Disable remaining Ctrl+Alt+Del screen options.
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name NoLogoff -Value 1
New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies -Name System
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name DisableChangePassword -Value 1
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name DisableLockWorkstation -Value 1
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name DisableTaskMgr -Value 1
There are probably two ways to trigger C+A+D in software:
Keyboard driver. Not sure if the scancode map would handle that.
Simulate. Microsoft used to provide a library on request with a function called SimulateSAS. Windows 7 added SendSAS for everyone to use. There is also 3rd-party stuff that does it.
The group policy "Disable or enable software Secure Attention Sequence" can disable the simulation. A driver can be disabled/removed.
I need to disable Windows defender in an old build of Windows 10 (en_windows_10_pro_10240_x64_dvd) without activating windows update,
The problem I'm facing is that the usual powershell commands to do that don't work, the command Get-Command -Module Defender has no output!
output of $PSVersionTable.PSVersion:
Major Minor Build Revision
----- ----- ----- --------
5 0 10240 16384
It looks like the Defender module is not installed then.
You can try disable it using the registry. Run this as Administrator. The computer needs to be restarted for the new setting to take effect:
$regpath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender"
if (!(Test-Path $regpath -PathType Container)) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft" -Name 'Windows Defender' -ItemType Container | Out-Null
}
Set-ItemProperty -Path $regpath -Name "DisableAntiSpyware" -Value 1 -Type DWord
You can enable Defender later bu using
Set-ItemProperty -Path $regpath -Name "DisableAntiSpyware" -Value 0 -Type DWord
I have a script that changes the internet proxy server. It is under HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer. The problem is, I seem to have to wait a while for the change to be reflected (so I can use the browser) or go into the Internet Options in Windows and click on Connections and open the Lan Settings and click Ok.
Is there something else I can do in my script to make the proxy reflected immediately in my browser? Closing and opening the browser doesn't seem to make it happen either.
I mostly use Chrome, but have the same issue with IE.
I do not experience any delay on Win8.1 with IE and Firefox, did you try it this way ?
Close the browsers before making the change.
$regPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
#Enable proxy
Set-ItemProperty -Path $regPath -Name "ProxyEnable" -Value 1
Set-ItemProperty -Path $regPath -Name "ProxyServer" -Value "proxy.domain:1080"
#Disable proxy
Set-ItemProperty -Path $regPath -Name "ProxyEnable" -Value 0
Set-ItemProperty -Path $regPath -Name "ProxyServer" -Value ""
Is there a way to set the default wallpaper for a new user logging into windows 10? I was supplied with the script below but only works for the current user. Is this possible to set it for any user that logs in?
Function Set-WallPaper($Value)
{
Set-ItemProperty -path 'HKCU:\Control Panel\Desktop\' -name wallpaper -value $value
rundll32.exe user32.dll, UpdatePerUserSystemParameters
}
For some reason that registry entry doesn't work with new profiles in Windows 10. Some other setup process clobbers it. I've seen scripts where the default .jpg is made writeable and then replaced. http://ccmexec.com/2015/08/replacing-default-wallpaper-in-windows-10-using-scriptmdtsccm/
You can access all loaded user registry hives through the HKEY_USERS hive.
It's not automatically mounted like HKCU: or HKLM:, but you can access it with a provider-qualified path, like this:
Get-ChildItem -Path Registry::HKEY_USERS
I'd also suggest that you declare your parameters properly as well:
function Set-WallPaper
{
param(
[Parameter(Mandatory=$true)]
[System.IO.FileInfo]$WallPaperFile,
[Parameter(Mandatory=$false)]
[switch]$All
)
if($All){
foreach($UserHive in Get-ChildItem Registry::HKEY_USERS){
$DesktopKeyPath = (Join-Path $UserHive.PSPath "Control Panel\Desktop")
if(Test-Path $DesktopKeyPath){
Set-ItemProperty -Path $DesktopKeyPath -Name Wallpaper -Value $WallPaperFile.FullName
}
}
} else {
Set-ItemProperty -Path 'HKCU:\Control Panel\Desktop\' -Name wallpaper -Value $WallPaperFile.FullName
}
rundll32.exe user32.dll, UpdatePerUserSystemParameters
}
Is it possible to edit a registry key remotely with a Powershell script? If it is, how?
I have a list of 7 servers in which I have to disable windows update settings. I've coded the following script but only can be used localy:
$regkey = "HKLM:\SOFTWARE\microsoft\......\auto update"
set-itemproperty -path $regkey -name AUOptions -value 1
set-itemproperty -path $regkey -name ElevateNonAdmins -value 0
set-itemproperty -path $regkey -name IncludeRecommendedUpdates -value 0
Any suggestion? Thanks!
Powershell's support for remote registry is done via .Net. There are lots of Google answers available. Here's one from right this site:
$Reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $computer1)
$RegKey= $Reg.OpenSubKey("SOFTWARE\\Veritas\\NetBackup\\CurrentVersion")
As for how to set the values is left as an exercise to the reader.