This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setx.exe SEE_MASK_NOZONECHECKS 1 /M |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setx.exe SEE_MASK_NOZONECHECKS 0 /M |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$timeZone = 'Romance Standard Time' | |
$proc = New-Object System.Diagnostics.Process | |
$proc.StartInfo.WindowStyle = "Hidden" | |
$proc.StartInfo.FileName = "tzutil.exe" | |
$proc.StartInfo.Arguments = "/s `"$timeZone`"" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$obj = Get-WmiObject -Class "Win32_TerminalServiceSetting" -Namespace root\cimv2\terminalservices | |
if ($obj -eq $null) {return} | |
$obj.SetAllowTsConnections(1,1) | out-null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wevtutil sl Application /ms:55000000 /rt:false /ab:false | |
wevtutil sl Security /ms:135000000 /rt:false /ab:false | |
wevtutil sl System /ms:55000000 /rt:false /ab:false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$AdminKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}" | |
$UserKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}" | |
if (Test-Path $AdminKey) {Set-ItemProperty -Path $AdminKey -Name "IsInstalled" -Value 0} | |
if (Test-Path $UserKey) {Set-ItemProperty -Path $UserKey -Name "IsInstalled" -Value 0} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Powerplans = Get-WmiObject -Query "SELECT ElementName,InstanceID,ISActive FROM win32_powerplan" -Namespace root\cimv2\power | |
$Target = "High performance" | |
foreach ($Powerplan in $Powerplans) { | |
if ($Powerplan.ElementName -eq $Target) { | |
$Powerplan.ElementName | |
$Powerplan.InstanceID | |
$Powerplan.ISActive | |
$Changer = $Powerplan | |
break |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Configure WinRM client | |
winrm qc | |
winrm set winrm/config/service/auth '@{Basic="true"}' | |
winrm set winrm/config/service/auth '@{Kerberos="false"}' | |
winrm set winrm/config/service '@{AllowUnencrypted="true"}' | |
winrm set winrm/config/client '@{TrustedHosts="*"}' | |
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="1024"}' | |
start-service WinRM | |
set-service WinRM -StartupType Automatic |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set-ExecutionPolicy without confirmation | |
$shell = New-Object -ComObject Wscript.Shell | |
Set-ExecutionPolicy Unrestricted | Echo $shell.sendkeys("Y`r`n") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Change all public profile NICs to become Work Network NICs | |
$nlm = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]”{DCB00C01-570F-4A9B-8D69-199FDBA5723B}”)) | |
$connections = $nlm.getnetworkconnections() | |
$connections |foreach { | |
if ($_.getnetwork().getcategory() -eq 0) { | |
$_.getnetwork().setcategory(1) | |
} | |
} |