This file contains 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
$appname = "Git.Git" | |
$Mode = "Install" | |
$WingetFile = Get-ChildItem "$env:programfiles\WindowsApps" -Recurse -File | Where-Object { $_.name -like "AppInstallerCLI.exe" -or $_.name -like "Winget.exe" } | Select-Object -ExpandProperty fullname | |
switch ($Mode) { | |
"Install" { | |
# Install | |
try { $response = &"$WingetFile" install --id $appname --silent --log "$($env:Temp)\$($appname).log" --accept-package-agreements --accept-source-agreements --force --disable-interactivity } catch {} | |
} |
This file contains 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
# Reference: https://docs.microsoft.com/en-us/windows-server/storage/data-deduplication/advanced-settings | |
Set-DedupSchedule -Name BackgroundOptimization -Enabled $false | |
Set-DedupSchedule -Name PriorityOptimization -Enabled $false | |
Get-DedupSchedule -Type GarbageCollection | ForEach-Object { Remove-DedupSchedule -InputObject $_ } | |
Get-DedupSchedule -Type Scrubbing | ForEach-Object { Remove-DedupSchedule -InputObject $_ } | |
New-DedupSchedule -Name "NightlyOptimization" -Type Optimization -DurationHours 11 -Memory 100 -Cores 100 -Priority High -Days @(1, 2, 3, 4, 5) -Start (Get-Date "2016-08-08 19:00:00") | |
New-DedupSchedule -Name "WeeklyGarbageCollection" -Type GarbageCollection -DurationHours 23 -Memory 100 -Cores 100 -Priority High -Days @(6) -Start (Get-Date "2016-08-13 07:00:00") | |
New-DedupSchedule -Name "WeeklyIntegrityScrubbing" -Type Scrubbing -DurationHours 23 -Memory 100 -Cores 100 -Priority High -Days @(0) -Start (Get-Date "2016-08-14 07:00:00") |
This file contains 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
# Warning: PowerShell ternary operator (a ? b : c) in use. Needs PowerShell 7+! | |
# Install Microsoft Graph API module if not already there | |
# Install-Module Microsoft.Graph | |
# Need to select beta profile in order to get logon statistics | |
Select-MgProfile -Name "beta" | |
# You'll need auditlog read access for logon statistics | |
Connect-MgGraph -Scopes "User.Read.All", "Group.ReadWrite.All", "AuditLog.Read.All" | |
# Load SKU list |
This file contains 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
$Servers = Get-ADComputer -Filter { OperatingSystem -like "*server*" -and Enabled -eq $true } -Properties OperatingSystem | |
$Results = @() | |
foreach ($Server in $Servers) { | |
Write-Host $Server.Name -NoNewline | |
try { | |
Test-Connection -ComputerName $Server.DnsHostName -Count 1 -ErrorAction Stop | Out-Null | |
$found = $true | |
Write-Host "`tfound`t" -NoNewline -ForegroundColor Green | |
} catch { | |
$found = $false |
This file contains 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
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings] | |
"SecureProtocols"=dword:00000a80 |
This file contains 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
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v2.0.50727] | |
"SystemDefaultTlsVersions"=dword:00000001 | |
"SchUseStrongCrypto"=dword:00000001 | |
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319] | |
"SystemDefaultTlsVersions"=dword:00000001 | |
"SchUseStrongCrypto"=dword:00000001 |
This file contains 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
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp] | |
"DefaultSecureProtocols"=dword:00000A00 | |
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp] | |
"DefaultSecureProtocols"=dword:00000A00 |
This file contains 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
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2] | |
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client] | |
"DisabledByDefault"=dword:00000000 | |
"Enabled"=dword:00000001 | |
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server] | |
"DisabledByDefault"=dword:00000000 |