├── .gitattributes ├── AD DS Kurulumu ve Yapilandirmasi.ps1 ├── CPUinfo ├── ESXiCLI-RamInfo ├── Exchange | 421 4.4.2 Connection Dropped due Socket Error ├── Exchange | Get-MessageTrackingLog ├── Get-ADComputer ├── Get-Process ├── Hyper-V VM olusturma ├── InstallDocker ├── PortScan ├── PowerShell ile IIS Kurulumu ├── PowerShell ile IP tarama (tr-TR) ├── PowerShell ile RDP ataklarını engelleme (tr-TR) ├── PowerShell ile RDP session log kayitlari ├── PowerShell ile RDS Kurulumu ├── PowerShell ile RDS yapilandirmasi ├── PowerShell ile WSUS yapilandirma ├── PowerShell ile anlık kaynak kontrolü ├── PowerShell ile birden fazla IP'ye ping atmak ├── PowerShell ile dosya download (tr-TR) ├── PowerShell ile log arsivleme ├── Powershell ile RamInfo ├── ResolveIPtoName ├── Telnet ile STARWARS ├── WSUS CleanupWizard Command1 ├── WSUS Kurulumu ├── WSUS-CleanupWizard ├── Windows Server .Net3.5 için TLS 1.2 aktivasyonu ├── Windows Server .Net4.x için TLS 1.2 aktivasyonu └── Windows Terminal Install /.gitattributes: -------------------------------------------------------------------------------- 1 | *.ps1 linguist-language=PowerShell 2 | *.psm1 linguist-language=PowerShell 3 | *.psd1 linguist-language=PowerShell 4 | -------------------------------------------------------------------------------- /AD DS Kurulumu ve Yapilandirmasi.ps1: -------------------------------------------------------------------------------- 1 | Install-WindowsFeature AD-Domain-Services –IncludeManagementTools 2 | Install-ADDSForest –DomainName domain.com 3 | -------------------------------------------------------------------------------- /CPUinfo: -------------------------------------------------------------------------------- 1 | Get-WmiObject -Class Win32_Processor -ComputerName. | Select-Object -Property [a-z]* 2 | 3 | Get-WmiObject -Class Win32_ComputerSystem -ComputerName. | Select-Object -Property SystemType 4 | -------------------------------------------------------------------------------- /ESXiCLI-RamInfo: -------------------------------------------------------------------------------- 1 | smbiosDump |grep -A 12 'Memory Device' 2 | -------------------------------------------------------------------------------- /Exchange | 421 4.4.2 Connection Dropped due Socket Error: -------------------------------------------------------------------------------- 1 | Set-SendConnector -Identity “SendConnectorünüzünadınıyazınız” -IgnoreSTARTTLS $true 2 | -------------------------------------------------------------------------------- /Exchange | Get-MessageTrackingLog: -------------------------------------------------------------------------------- 1 | Get-MessageTrackingLog -ResultSize Unlimited -Start "09/16/2020 14:00:00" -End "09/16/2020 16:100:00" -Recipients "postmaster@domain.net" 2 | 3 | Get-MessageTrackingLog -ResultSize Unlimited -Start "05/10/2021 12:20:00" -End "05/10/2020 12:44:00" -sender "postmaster@domain.net" 4 | 5 | Get-Queue 6 | -------------------------------------------------------------------------------- /Get-ADComputer: -------------------------------------------------------------------------------- 1 | Get-ADComputer -Filter * -Properties OperatingSystem | ft -Property Name, OperatingSystem 2 | -------------------------------------------------------------------------------- /Get-Process: -------------------------------------------------------------------------------- 1 | # Selecting 2 | #Default 3 | Get-Process 4 | 5 | # All Properties 6 | Get-Process | Select-Object -Property * | Out-GridView 7 | 8 | # Sorting 9 | # Changes the default sorting order for Get-Process 10 | Get-Process | Sort-Object CPU 11 | 12 | # Minimize the data and sort 13 | Get-Process | Select-Object ProcessName, CPU | Sort-Object CPU -Descending 14 | 15 | ## Caution 16 | # Mission: Get the top 10 processes by CPU usage (which 10 processes have the most CPU usage) 17 | Get-Process | 18 | Select-Object ProcessName, CPU -First 10 | 19 | Sort-Object CPU -Descending 20 | 21 | # or 22 | 23 | Get-Process | 24 | Sort-Object CPU -Descending | 25 | Select-Object ProcessName, CPU -First 10 26 | 27 | # or 28 | 29 | 30 | Get-Process | Select-Object ProcessName, CPU | Sort-Object CPU -Descending 31 | -------------------------------------------------------------------------------- /Hyper-V VM olusturma: -------------------------------------------------------------------------------- 1 | # Bu script coklu vm acmak icin hazirlanmistir. 2 | 3 | #VM isimlerini okuyacagi dosya tanimlamasini yapiniz 4 | $VMismi = Get-Content (Read-Host "VM isimleri olan dosyanın path giriniz.") 5 | 6 | #Kurulum yapacaginiz isletim sistemi ISOsunu tanimlayiniz. 7 | $ISOpath = Read-Host "ISOnuzun bulundugu dosyanın path giriniz." 8 | 9 | #VM diskinin olusacagi path belirtiniz. 10 | $VMyeri = "$Home\Hyper-V\Virtural Machines" 11 | 12 | #Virtual switch olusturup adini ve turunu belirleiyin. 13 | New-VMSwitch -Name "PrivateNetwork" -SwitchType Private 14 | $VMNet = "PrivateNetwork" 15 | 16 | #VM olusturmak icin disk size, memory size ve pathleri tanimlayiniz. 17 | Foreach($vm in $VMismi) { New-VM -Name $VM -Generation 2 -SwitchName $VMNet 18 | New-VHD -Path "$VMyeri\$VM\$vm.vhdx" -Dynamic -SizeBytes 40GB 19 | ADD-VMHardDiskDrive -VMismi $vm -Path "$VMLOC\$VM\$vm.vhdx" 20 | Set-VM $VM -MemoryMinimumBytes 1GB 21 | Add-VMDvdDrive -VMismi $vm -Path $ISOpath 22 | } 23 | -------------------------------------------------------------------------------- /InstallDocker: -------------------------------------------------------------------------------- 1 | Install-Module -Name DockerMsftProvider -Repository PSGallery -Force 2 | Install-Package -Name docker -ProviderName DockerMsftProvider 3 | -------------------------------------------------------------------------------- /PortScan: -------------------------------------------------------------------------------- 1 | $port = (enter port value) 2 | $network = “enter network value” 3 | $range = 1..254 4 | $ErrorActionPreference= ‘silentlycontinue’ 5 | $(Foreach ($add in $range) 6 | { $ip = “{0}.{1}” –F $network,$add 7 | Write-Progress “Scanning Network” $ip -PercentComplete (($add/$range.Count)*100) 8 | If(Test-Connection –BufferSize 32 –Count 1 –quiet –ComputerName $ip) 9 | { $socket = new-object System.Net.Sockets.TcpClient($ip, $port) 10 | If($socket.Connected) { “$ip port $port open” 11 | $socket.Close() } 12 | else { “$ip port $port not open ” } 13 | } 14 | }) | Out-File C:\reports\portscan.csv 15 | -------------------------------------------------------------------------------- /PowerShell ile IIS Kurulumu: -------------------------------------------------------------------------------- 1 | Install-WindowsFeature NET-Framework-Core, NET-Framework-45-ASPNET, Web-WebServer,Web-Health, Web-Performance, Web-Security, Web-App-Dev, Web-Ftp-Server, Web-Mgmt-Tools, Web-Scripting-Tools, Web-Http-Redirect, Web-DAV-Publishing, Web-Custom-Logging, Web-Log-Libraries, Web-ODBC-Logging, Web-Request-Monitor, Web-Http-Tracing, Web-Dyn-Compression, Web-Basic-Auth, Web-IP-Security, Web-Windows-Auth, Web-Net-Ext, Web-Net-Ext45, Web-ASP, Web-Asp-Net, Web-Asp-Net45, Web-CGI, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Includes, Web-Ftp-Ext, Web-Mgmt-Compat, Web-Metabase, Web-Lgcy-Scripting, Web-WMI 2 | -------------------------------------------------------------------------------- /PowerShell ile IP tarama (tr-TR): -------------------------------------------------------------------------------- 1 | 1..254 | %{ping -n 1 -w 15 192.168.101.$_ | select-string "reply from"} 2 | 3 | // Diger code 4 | 5 | 1..255 | foreach-object { (new-object system.net.networkinformation.ping).Send("192.168.101.$_") } | where-object {$_.Status -eq "Success"} | select Address 6 | -------------------------------------------------------------------------------- /PowerShell ile RDP ataklarını engelleme (tr-TR): -------------------------------------------------------------------------------- 1 | # Firewall uzerinde tanimladiginiz kuralin adini yazınız 2 | $firewallRuleName = "RDP Atak Engelle" 3 | 4 | # Karalisteye eklenmetecek IP adreslerini yada hostnamelerini tanimlayiniz. 5 | $whiteList = @( 6 | [System.Net.Dns]::GetHostAddresses("powershell-ozan, Ozan-WI, 192.168.2.101").IPAddressToString 7 | ) 8 | 9 | 10 | ### kod ### 11 | Write-Host "Running at $(Get-Date)" 12 | $regExIp = "\d\d?\d?.\d\d?\d?.\d\d?\d?.\d\d?\d?" 13 | 14 | # RDS icin olusan Event loglardan 140 tanesini incele 15 | $currentAttackers = Get-Winevent Microsoft-Windows-RemoteDesktopServices-RdpCoreTS/Operational | Where-Object {$_.Id -eq 140} | Select Message -ExpandProperty Message 16 | 17 | # Response yok ise saldırı yoktur. 18 | if ($currentAttackers -eq $null) { 19 | Write-Host "No current attackers" 20 | return 21 | } 22 | 23 | # Her saldırı mesajını alın ve yukarıdaki regExIP'i kullanarak IP'yi filtreleyin 24 | for ($i = 0; $i -lt $currentAttackers.Count; $i++) { 25 | if ($currentAttackers[$i] -match $regExIp){ 26 | $currentAttackers[$i] = $Matches[0] 27 | } 28 | } 29 | 30 | # Bilinen saldırganları güvenlik duvarı kurallarından alın 31 | $knownAttackers = (Get-NetFirewallRule -DisplayName $firewallRuleName | Get-NetFirewallAddressFilter).RemoteAddress 32 | if ($knownAttackers -eq $null){ 33 | $knownAttackers = @() 34 | } 35 | $knownAttackers = $knownAttackers | Sort-Object -Unique 36 | 37 | # Kaydedilen her login kaydını kontrol et ve daha önce saldırgan olarak bilinip bilinmediğini kontrol et 38 | foreach($newAttacker in $currentAttackers) { 39 | if ($knownAttackers.Contains($newAttacker)) { #Bilinen bir IP ise işlem yapma 40 | continue 41 | } 42 | elseif ($whiteList -contains $newAttacker) { #Beyaz Listeye alınmış ise işlem yapma 43 | Write-Host "$newAttacker is dynamically whitelisted" 44 | continue 45 | } 46 | else{ #yeni bir saldırgan kara listeye ekle 47 | $knownAttackers += $newAttacker 48 | Write-Host "Added $newAttacker" 49 | } 50 | } 51 | 52 | # dublicate'leri kaldırın 53 | $knownAttackers = $knownAttackers | Sort-Object -Unique 54 | Write-Host "$($knownAttackers.Count) IPs on blacklist" 55 | 56 | # Tüm bilinen ve tüm yeni tespit edilen saldırganlarla Firwall kurallarını düzenle 57 | Set-NetFirewallRule -DisplayName $firewallRuleName "RDP Atak Engelle" -RemoteAddress $knownAttackers 58 | Write-Host "" 59 | -------------------------------------------------------------------------------- /PowerShell ile RDP session log kayitlari: -------------------------------------------------------------------------------- 1 | $logs = get-eventlog system -ComputerName powershell-ozan -source Microsoft-Windows-Winlogon -After (Get-Date).AddDays(-7); 2 | $res = @(); ForEach ($log in $logs) {if($log.instanceid -eq 7001) {$type = "Logon"} Elseif ($log.instanceid -eq 7002){$type="Logoff"} Else {Continue} $res += New-Object PSObject -Property @{Time = $log.TimeWritten; "Event" = $type; User = (New-Object System.Security.Principal.SecurityIdentifier $Log.ReplacementStrings[1]).Translate([System.Security.Principal.NTAccount])}}; 3 | $res 4 | -------------------------------------------------------------------------------- /PowerShell ile RDS Kurulumu: -------------------------------------------------------------------------------- 1 | Install-WindowsFeature Remote-Desktop-Services, RDS-Licensing, RDS-RD-Server -IncludeManagementTools 2 | -------------------------------------------------------------------------------- /PowerShell ile RDS yapilandirmasi: -------------------------------------------------------------------------------- 1 | $obj = gwmi -namespace "Root/CIMV2/TerminalServices" Win32_TerminalServiceSetting 2 | $obj.ChangeMode(value) 3 | $obj.SetSpecifiedLicenseServerList("LicServer") 4 | $obj.GetSpecifiedLicenseServerList() 5 | -------------------------------------------------------------------------------- /PowerShell ile WSUS yapilandirma: -------------------------------------------------------------------------------- 1 | ### WUSUS post-deplpyment yapilandirma ayarlari 2 | . "C:\Program Files\Update Services\Tools\WsusUtil.exe" postinstall CONTENT_DIR=C:\WSUS 3 | 4 | ### WSUS nesnesinin tanımlanması 5 | $wsus = Get-WSUSServer 6 | 7 | ### WSUS yapilandirma tanimlamasi 8 | $wsusConfig = $wsus.GetConfiguration() 9 | ### Microsoft güncellemelerinin yapilandirilamsi 10 | Set-WsusServerSynchronization –SyncFromMU 11 | 12 | ### Güncelleme paketi dil tanımlaması sadece ingilizce yapilandirilmisiti bu bölümde istediğiniz dilleri virgul ekleyerek kısa kodunu yazabilirsiniz. 13 | $wsusConfig.AllUpdateLanguagesEnabled = $false 14 | $wsusConfig.SetEnabledUpdateLanguages("en") 15 | $wsusConfig.Save() 16 | 17 | ### WSUS ve Microsoft güncelleme SYNC tanimlamasi 18 | $wsus.GetSubscription().StartSynchronizationForCategoryOnly() 19 | start-sleep 15 20 | 21 | ### SYNC tanimlamasi 22 | while ($wsus.GetSubscription().GetSynchronizationStatus() -ne "NotProcessing") { 23 | $time = get-date -UFormat "%H:%M:%S" 24 | $total = $wsus.GetSubscription().getsynchronizationprogress().totalitems 25 | $processed = $wsus.GetSubscription().getsynchronizationprogress().processeditems 26 | $process = $processed/$total 27 | $progress = "{0:P0}" -f $process 28 | Write-Host "" 29 | Write-Host "The first synchronization isn't completed yet $time" 30 | Write-Host "Kindly have patience, the progress is $progress" 31 | Start-Sleep 10 32 | } 33 | Write-Host "The synchronization has completed at $time" -ForegroundColor Green 34 | Write-Host "The WSUS Configuration will now continue" -ForegroundColor Green 35 | 36 | ### Guncelleme urunlerinin tanimlanmasi, bu bolumu genisletebilrisiniz. Ben örnek için sadece Windows Server 2019 ekledim scritpti genisleterek diger urunleride ekleyebilirsiniz. 37 | write-host 'Setting WSUS Products' 38 | Get-WsusProduct | where-Object { 39 | $_.Product.Title -in ( 40 | 'Windows Server 2019') 41 | } | Set-WsusProduct 42 | 43 | ### Guncelleme sinfilarinin tanimlanmasi yine bu bolumde de siniflari arttirabilir yada azaltabilirsiniz. 44 | write-host 'Setting WSUS Classifications' 45 | Get-WsusClassification | Where-Object { 46 | $_.Classification.Title -in ( 47 | 'Critical Updates', 48 | 'Definition Updates', 49 | 'Feature Packs', 50 | 'Security Updates', 51 | 'Service Packs', 52 | 'Update Rollups', 53 | 'Updates') 54 | } | Set-WsusClassification 55 | 56 | ### SYNC yapilandirmasi 57 | write-host 'Enabling WSUS Automatic Synchronisation' 58 | $subscription = $wsus.GetSubscription() 59 | $subscription.SynchronizeAutomatically=$true 60 | 61 | ### otomatik sync yapilandirmasi 62 | $subscription.SynchronizeAutomaticallyTimeOfDay= (New-TimeSpan -Hours 0) 63 | $subscription.NumberOfSynchronizationsPerDay=1 64 | $subscription.Save() 65 | 66 | ### Guncellenecek hedef grubun belirlenmesi 67 | $wsus.CreateComputerTargetGroup("Updates") 68 | 69 | ### Guncelleme paketlerinin onaylanmasi 70 | write-host 'Configuring default automatic approval rule' 71 | [void][reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration") 72 | $rule = $wsus.GetInstallApprovalRules() | Where { 73 | $_.Name -eq "Default Automatic Approval Rule"} 74 | $class = $wsus.GetUpdateClassifications() | ? {$_.Title -In ( 75 | 'Critical Updates', 76 | 'Security Updates')} 77 | $class_coll = New-Object Microsoft.UpdateServices.Administration.UpdateClassificationCollection 78 | $class_coll.AddRange($class) 79 | $rule.SetUpdateClassifications($class_coll) 80 | $rule.Enabled = $True 81 | $rule.Save() 82 | 83 | ### Computer groupların güncelleme islemi 84 | 85 | 86 | $wsusConfig.OobeInitialized = $true 87 | $wsusConfig.Save() 88 | 89 | ### SYNC baslamasi 90 | $wsus.GetSubscription().StartSynchronization() 91 | -------------------------------------------------------------------------------- /PowerShell ile anlık kaynak kontrolü: -------------------------------------------------------------------------------- 1 | while($true) 2 | { 3 | 4 | $ComputerCPU = (Get-WmiObject -Class win32_processor -ErrorAction Stop | Measure-Object -Property LoadPercentage -Average | Select-Object Average).Average 5 | 6 | $ComputerMemory = Get-WmiObject -Class win32_operatingsystem -ErrorAction Stop 7 | $UsedMemory = $ComputerMemory.TotalVisibleMemorySize - $ComputerMemory.FreePhysicalMemory 8 | $Memory = (($UsedMemory/ $ComputerMemory.TotalVisibleMemorySize)*100) 9 | $RoundMemory = [math]::Round($Memory, 2) 10 | 11 | #$disk = Get-PSDrive C | Select-Object Used,Free 12 | 13 | $TotalDisk = Get-WMIObject Win32_LogicalDisk -Filter "DeviceID='C:'" | ForEach-Object {[math]::truncate($_.Size / 1GB)} 14 | $FreeSpace = Get-WMIObject Win32_LogicalDisk -Filter "DeviceID='C:'" | ForEach-Object {[math]::truncate($_.freespace / 1GB)} 15 | 16 | $Date = Get-Date -DisplayHint Date -Format MM/dd/yyyy 17 | 18 | $Time = Get-Date -DisplayHint Time -Format HH:mm:ss 19 | 20 | Write-Host "Date: " $Date " Time: " $Time " CPU: " $ComputerCPU " Memory: " $RoundMemory " Free Space: " $Freespace " Total Size : " $TotalDisk 21 | 22 | sleep 2 23 | } 24 | -------------------------------------------------------------------------------- /PowerShell ile birden fazla IP'ye ping atmak: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | Param 3 | ( 4 | [Parameter(Mandatory=$true, 5 | ValueFromPipeline=$true, 6 | ValueFromPipelineByPropertyName=$true, 7 | Position=0)] 8 | [ValidateNotNullOrEmpty()] 9 | [string[]]$ComputerName, 10 | 11 | 12 | [Parameter(Position=1)] 13 | [int]$ResultCount = 150 14 | ) 15 | 16 | $PipelineItems = @($input) 17 | if ($PipelineItems.Count) 18 | { 19 | $ComputerName = $PipelineItems 20 | } 21 | 22 | $ComputerName | 23 | Where-Object { -not ($_ -as [ipaddress]) } | 24 | ForEach-Object { 25 | $null = Resolve-DnsName $_ -ErrorAction Stop 26 | } 27 | 28 | $UseClearHostWhenRedrawing = $false 29 | try { 30 | [System.Console]::SetCursorPosition(0, 0) 31 | } catch [System.IO.IOException] { 32 | $UseClearHostWhenRedrawing = $true 33 | } 34 | 35 | Clear-Host 36 | 37 | [array]$PingData = foreach($Computer in $ComputerName) 38 | { 39 | @{ 40 | 'Name' = $Computer 41 | 'Pinger' = New-Object -TypeName System.Net.NetworkInformation.Ping 42 | 'Results' = New-Object -TypeName System.Collections.Queue($ResultCount) 43 | 'LastResult' = @{} 44 | } 45 | } 46 | foreach ($Item in $PingData) 47 | { 48 | for ($Filler = 0; $Filler -lt $ResultCount; $Filler++) 49 | { 50 | $Item.Results.Enqueue('_') 51 | } 52 | } 53 | 54 | while ($true) 55 | { 56 | 57 | [array]$PingTasks = foreach($Item in $PingData) 58 | { 59 | $Item.Pinger.SendPingAsync($Item.Name) 60 | 61 | } 62 | 63 | try { 64 | [Threading.Tasks.Task]::WaitAll($PingTasks) 65 | } catch [AggregateException] { 66 | } 67 | 68 | 0..($PingTasks.Count-1) | ForEach-Object { 69 | 70 | $Task = $PingTasks[$_] 71 | $ComputerData = $PingData[$_] 72 | 73 | if ($Task.Status -ne 'RanToCompletion') 74 | { 75 | $ComputerData.Results.Enqueue('?') 76 | } 77 | else 78 | { 79 | $ComputerData.LastResult = $Task.Result 80 | 81 | switch ($Task.Result.Status) 82 | { 83 | 'Success' { $ComputerData.Results.Enqueue('.') } 84 | 'TimedOut' { $ComputerData.Results.Enqueue('x') } 85 | } 86 | 87 | } 88 | } 89 | 90 | foreach ($Item in $PingData) 91 | { 92 | while ($Item.Results.Count -gt $ResultCount) 93 | { 94 | $null = $Item.Results.DeQueue() 95 | } 96 | } 97 | 98 | 99 | if ($UseClearHostWhenRedrawing) 100 | { 101 | Clear-Host 102 | } 103 | else 104 | { 105 | $CursorPosition = $Host.UI.RawUI.CursorPosition 106 | $CursorPosition.X = 0 107 | $CursorPosition.Y = 0 108 | $Host.UI.RawUI.CursorPosition = $CursorPosition 109 | } 110 | 111 | foreach ($Item in $PingData) 112 | { 113 | Write-Host (($Item.Results -join '') + ' | ') -NoNewline 114 | 115 | $PingText = if ($Item.LastResult.Status -eq 'Success') 116 | { 117 | if (1000 -le $Item.LastResult.RoundTripTime) 118 | { 119 | '(999+ms)' 120 | } 121 | else 122 | { 123 | '({0}ms)' -f $Item.LastResult.RoundTripTime.ToString().PadLeft(4, ' ') 124 | } 125 | } 126 | else 127 | { 128 | '(----ms)' 129 | } 130 | Write-Host "$PingText | " -NoNewline 131 | if ($Item.LastResult.Status -eq 'Success') 132 | { 133 | Write-Host ($Item.Name) -BackgroundColor DarkGreen 134 | } 135 | else 136 | { 137 | Write-Host ($Item.Name) -BackgroundColor DarkRed 138 | } 139 | } 140 | $Delay = 1000 - ($PingData.lastresult.roundtriptime | Sort-Object | Select-Object -Last 1) 141 | Start-Sleep -MilliSeconds $Delay 142 | } 143 | -------------------------------------------------------------------------------- /PowerShell ile dosya download (tr-TR): -------------------------------------------------------------------------------- 1 | $WebClient = New-Object System.Net.WebClient 2 | $WebClient.DownloadFile("http://","C:\dosya isminiz.formatı") 3 | -------------------------------------------------------------------------------- /PowerShell ile log arsivleme: -------------------------------------------------------------------------------- 1 | $LogFolder=“Clog_Dosyasi” 2 | $Arcfolder=ClogsArsiv_Log_Dosyasi” 3 | $LastWrite=(get-date).AddDays(-7).ToString(MMddyyyy) 4 | If ($Logs = get-childitem $LogFolder Where-Object {$_.LastWriteTime -le $LastWrite -and !($_.PSIsContainer)} sort-object LastWriteTime) 5 | { 6 | foreach ($L in $Logs) 7 | { 8 | $FullName=$L.FullName 9 | $WMIFileName= $FullName.Replace(, ) 10 | $WMIQuery = Get-WmiObject -Query “SELECT FROM CIM_DataFile WHERE Name='$WMIFileName'“ 11 | If ($WMIQuery.Compress()) {Write-Host $FullName Arsivleme basarili.-ForegroundColor Green} 12 | else {Write-Host $FullName Arsivleme hatasi. -ForegroundColor Red} 13 | -------------------------------------------------------------------------------- /Powershell ile RamInfo: -------------------------------------------------------------------------------- 1 | Get-WmiObject Win32_PhysicalMemory | Format-Table BankLabel, Capacity, Manufacturer 2 | 3 | Get-WmiObject Win32_PhysicalMemory | Select-Object FormFactor 4 | 5 | Get-WmiObject Win32_PhysicalMemory | Select-Object Speed 6 | 7 | Get-WmiObject Win32_PhysicalMemory | Select-Object PartNumber, SerialNumber 8 | 9 | Get-WmiObject Win32_PhysicalMemory | Format-List * 10 | -------------------------------------------------------------------------------- /ResolveIPtoName: -------------------------------------------------------------------------------- 1 | ###Resolve IP to HostName### 2 | function ResolveIPtoName($IP) { 3 | $ResolvingResults = "" 4 | $ResolvingResults = @() 5 | $IPList += @($IP) 6 | foreach ($IP in $IPList) { 7 | try {$ResolvingResults += [System.Net.Dns]::GetHostEntry($IP)} 8 | catch{Write-Host $IP could not be Resolved -BackgroundColor Black -ForegroundColor Red} 9 | } 10 | 11 | $ResolvingResults | Select AddressList, HostName 12 | } 13 | 14 | 15 | 16 | ###PowerShell üzerinde#### 17 | ResolveIPtoName IPadresigiriniz 18 | -------------------------------------------------------------------------------- /Telnet ile STARWARS: -------------------------------------------------------------------------------- 1 | telnet towel.blinkenlights.nl 2 | -------------------------------------------------------------------------------- /WSUS CleanupWizard Command1: -------------------------------------------------------------------------------- 1 | Get-WsusServer | Invoke-WsusServerCleanup -CleanupObsoleteComputers 2 | 3 | Get-WsusServer | Invoke-WsusServerCleanup -CleanupObsoleteComputers -CleanupObsoleteUpdates 4 | 5 | 6 | Invoke-WsusServerCleanup 7 | [-UpdateServer ] 8 | [-CleanupObsoleteComputers] 9 | [-CleanupObsoleteUpdates] 10 | [-CleanupUnneededContentFiles] 11 | [-CompressUpdates] 12 | [-DeclineExpiredUpdates] 13 | [-DeclineSupersededUpdates] 14 | [-WhatIf] 15 | [-Confirm] 16 | [] 17 | -------------------------------------------------------------------------------- /WSUS Kurulumu: -------------------------------------------------------------------------------- 1 | Install-WindowsFeature UpdateServices -IncludeManagementTools 2 | -------------------------------------------------------------------------------- /WSUS-CleanupWizard: -------------------------------------------------------------------------------- 1 | # WSUSCleanupscript.ps1 2 | 3 | [reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration")` | out-null 4 | 5 | $wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer(); 6 | 7 | $cleanupScope = new-object Microsoft.UpdateServices.Administration.CleanupScope; 8 | 9 | $cleanupScope.DeclineSupersededUpdates = $true 10 | 11 | $cleanupScope.DeclineExpiredUpdates = $true 12 | 13 | $cleanupScope.CleanupObsoleteUpdates = $true 14 | 15 | $cleanupScope.CompressUpdates = $true 16 | 17 | $cleanupScope.CleanupObsoleteComputers = $true 18 | 19 | $cleanupScope.CleanupUnneededContentFiles = $true 20 | 21 | $cleanupManager = $wsus.GetCleanupManager(); 22 | 23 | $cleanupManager.PerformCleanup($cleanupScope); 24 | 25 | # Script END 26 | -------------------------------------------------------------------------------- /Windows Server .Net3.5 için TLS 1.2 aktivasyonu: -------------------------------------------------------------------------------- 1 | Windows Registry Editor Version 5.00 2 | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2] 3 | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client] 4 | "DisabledByDefault"=dword:00000000 5 | "Enabled"=dword:00000001 6 | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server] 7 | "DisabledByDefault"=dword:00000000 8 | "Enabled"=dword:00000001 9 | 10 | //.net3.5 için 11 | 12 | Windows Registry Editor Version 5.00 13 | [HKEY_LOCAL_MACHINESOFTWAREMicrosoft.NETFrameworkv2.0.50727] 14 | SystemDefaultTlsVersions=dword00000001 15 | [HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoft.NETFrameworkv2.0.50727] 16 | SystemDefaultTlsVersions=dword00000001 17 | -------------------------------------------------------------------------------- /Windows Server .Net4.x için TLS 1.2 aktivasyonu: -------------------------------------------------------------------------------- 1 | Windows Registry Editor Version 5.00 2 | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2] 3 | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client] 4 | "DisabledByDefault"=dword:00000000 5 | "Enabled"=dword:00000001 6 | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server] 7 | "DisabledByDefault"=dword:00000000 8 | "Enabled"=dword:00000001 9 | 10 | //.Net4.x için 11 | 12 | Windows Registry Editor Version 5.00 13 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319] 14 | "SystemDefaultTlsVersions"=dword:00000001 15 | [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319] 16 | "SystemDefaultTlsVersions"=dword:00000001 17 | -------------------------------------------------------------------------------- /Windows Terminal Install: -------------------------------------------------------------------------------- 1 | Invoke-WebRequest -Uri https://github.com/microsoft/terminal/releases/download/v1.7.1091.0/Microsoft.WindowsTerminal_1.7.1091.0_8wekyb3d8bbwe.msixbundle -outfile Microsoft.WindowsTerminal_1.7.1091.0_8wekyb3d8bbwe.msixbundle 2 | 3 | Add-AppxPackage -Path .\Microsoft.WindowsTerminal_1.7.1091.0_8wekyb3d8bbwe.msixbundle 4 | --------------------------------------------------------------------------------