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
$wsus = Get-WsusServer -name localhost -PortNumber 8530 | |
$ia64 = $wsus.GetUpdates() | Where-Object {$_.title.indexof("Itanium") -gt 1 -and $_.title.indexof("x64") -eq -1 -and $_.ArrivalDate -gt [datetime]::Now.AddDays(-7)} | |
foreach($patch in $ia64) { | |
Get-WsusUpdate -UpdateId $patch.id.updateid | Deny-WsusUpdate | |
} | |
$wsus | Invoke-WsusServerCleanup -CleanupObsoleteUpdates -CleanupUnneededContentFiles -CompressUpdates -DeclineExpiredUpdates |
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
import-module WebAdministration | |
$iisroot = 'IIS:\Sites\' | |
$sites = get-itemproperty $iisroot | |
foreach($site in $sites.children) { | |
foreach($webroot in $sites.Children.Keys) { | |
$WebSite = join-path $iisroot $webroot | |
$logpath = get-itemproperty $WebSite -name logfile.directory.value | |
if($logpath -ne $null) { | |
$logpath = [environment]::ExpandEnvironmentVariables($logpath) | |
$files = get-childitem $logpath -include "*.log" -recurse |
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
Install-WindowsFeature -name Web-Common-Http,Web-Windows-Auth,Web-Basic-auth,Web-Performance,Web-Dyn-Compression,Web-Net-Ext,Web-Net-Ext45,Web-AppInit,Web-Asp-Net,Web-Asp-Net45,Web-ISAPI-Filter,Web-ISAPI-Ext,Web-WebSockets,Web-Mgmt-Tools,Web-Mgmt-Console,Web-Scripting-Tools,Web-Mgmt-Service,AS-NET-Framework,AS-Web-Support,AS-WAS-Support,FS-FileServer,NET-Framework-Features,NET-Framework-Core,NET-HTTP-Activation,NET-Non-HTTP-Activ,NET-Framework-45-ASPNET,NET-WCF-HTTP-Activation45,NET-WCF-TCP-Activation45,NET-WCF-Pipe-Activation45,ManagementOData,WAS-Process-Model,WAS-NET-Environment,WAS-Config-APIs,WinRM-IIS-Ext,Web-Request-Monitor,Web-Http-Tracing -source d:\sources\sxs |
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
$AutoUpdate = new-object -ComObject "Microsoft.Update.AutoUpdate" | |
# 4 is Scheduled Install | |
# Be carefull.If you enabled Group Policy when setting NotificationLevel is abort. | |
$AutoUpdate.Settings.NotificationLevel = 4 | |
# 0 is EveryDay | |
$AutoUpdate.Settings.ScheduledInstallationDay = 0 | |
# 0 is 0:00 AM | |
$AutoUpdate.Settings.ScheduledInstallationTime = 0 | |
$AutoUpdate.Settings.save() |
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
using System.Diagnostics; | |
using Microsoft.Practices.EnterpriseLibrary.Logging; | |
using Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners; | |
namespace LogBlock | |
{ | |
class Program | |
{ | |
public void FlatText() | |
{ |
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
setup.exe /ACTION=Install /QS /UpdateEnabled=1 /FEATURES=SQLEngine,FullText,AS,RS,ADV_SSMS /IACCEPTSQLSERVERLICENSETERMS /ERRORREPORTING=1 /INSTANCEDIR="D:\MSSQL" /INSTANCENAME="MSSQLServer" /SQMREPORTING=1 /AGTSVCACCOUNT="domain\account" /AGTSVCPASSWORD="password" /AGTSVCSTARTUPTYPE=Automatic /ASCOLLATION="Japanese_XJIS_100_CI_AS" /ASSVCACCOUNT="domain\account" /ASSVCPASSWORD="password" /ASSYSADMINACCOUNTS="domain\administrator" /BROWSERSVCSTARTUPTYPE=Automatic /SQLCOLLATION="Japanese_XJIS_100_CI_AS" /SQLSVCACCOUNT="domain\account" /SQLSVCPASSWORD="password" /SQLSVCSTARTUPTYPE=Automatic /TCPENABLED=1 /RSSVCACCOUNT="domain\account" /RSSVCPASSWORD="password" /SQLSYSADMINACCOUNTS="domain\administrator" |
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
$patches = get-item $foldername | |
$process = new-object System.Diagnostics.Process | |
foreach($patch in $patches){ | |
if($PSVersionTable.PSVersion.Major -ge 4) { | |
unblock-file $patch | |
} | |
if([string]::compare($patch.extension, ".exe", $true) -eq 0) { | |
$process.StartInfo.Arguments = "/passive /norestart" | |
$process.StartInfo.FileName = $patch.fullname | |
}else if([string]::compare($patch.extension, ".msu", $true) -eq 0) { |
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
$fontregistory = 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts\' | |
$fonts = get-item -Path $fontregistory | Select-Object -expandProperty Property | |
foreach($font in $fonts){ | |
$fontpath = get-ItemProperty -path $fontregistory | select-Object -property $font | |
#if font path is full path and exist | |
$FontExist = Test-Path $fontpath.$font | |
if($FontExist -eq $true){ | |
if($fontpath.$font.EndsWith('.otf', $true, $null) -eq $true){ | |
Write-Host "Your environmet will trouble with MS14-045. See https://support.microsoft.com/kb/2982791" | |
return |
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
<system.net> | |
<defaultProxy useDefaultCredentials="true" enabled="true"> | |
<proxy usesystemdefault="True"/> | |
</defaultProxy> | |
<settings> | |
<ipv6 enabled="true"/> | |
</settings> | |
</system.net> |
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
#Reset Network Adapter for Windows 8.1/Windows Server 2012 R2 | |
Diable-NetAdapter -name "Local Area Network" -confirm:$false | |
Enable-NetAdapter -name "Local Area Network" -confirm:$false |
OlderNewer