Ipv6 kinni Powershell

echo "Aimar kirjutas 24.02.2021 taiendas 26.02"
echo "keela ipv6"
C:\WINDOWS\system32>netstat -b -o -a -r -n
netsh int ipv6 isatap set state disabled
netsh int ipv6 6to4 set state disabled
netsh interface teredo set state disable
echo "CMD tcpip6 binding maha"
netsh interface teredo set state disabled
netsh interface ipv6 6to4 set state state=disabled undoonstop=disabled
netsh interface ipv6 isatap set state state=disabled
echo "flsuhdns"
ipconfig /flushdns
echo "PRINDI ROUTE"
Route print
echo "prindi aktiivsed routingud"
netstat -r
netstat -abno 
echo "kustuta ruuting"
netsh interface ip delete destinationcache
Route print
echo "näita ARP"
arp -a
echo "kustuta ARP"
netsh interface ip delete arpcache
echo "tee tracert"
tracert ::1
echo "kui vastab siis on jama - kustutame ära"
route delete ::1/128
route delete ff00::/8
Route print
echo "ruuting tabel puhtaks"
echo "TCIP SERVICE MAHA"
sc config TCPIP6 start=disabled
echo "registrist ka maha igasugused kahtlased tunnelid"
reg delete Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6TUNNEL /v /f
reg delete Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIPTUNNEL /v /f
reg delete Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\tunnel /v /f
reg delete Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UdkUserSvc /f
reg delete HKLM\SYSTEM\CurrentControlSet\Services\UdkUserSvc_15133e /v /f
ipconfig /flushdns
ipconfig /release
ipconfig /renew
netsh int ip stop
netsh int ip start
echo "mingid netsh asjad - näitavad interfeisse"
netsh int tcp show global
netsh interface ipv4 show interfaces
netsh interface ipv6 show interfaces
ipconfig /displaydns






echo "keela kõik võrguadapterid mis pole aktiivsed - ainult kasutajatel"
wmic path win32_networkadapter where PhysicalAdapter=True call disable


echo "powershell tcpip6 binding maha"
Get-NetAdapterBinding -ComponentID ms_tcpip6
Disable-NetAdapterBinding -Name "*" -ComponentID ms_tcpip6
Get-NetAdapterBinding -ComponentID ms_tcpip6
echo "eemaldaad üleliigsed adapterid"
Get-NetAdapter -Name * -IncludeHidden
Get-NetAdapter -Name vEthernet* | fl * | more
Get-NetAdapter -Name * -IncludeHidden | Format-List -Property *
Get-NetAdapter -Name * -IncludeHidden | where adminstatus -eq “up”
Get-NetAdapter -Name * -IncludeHidden | where adminstatus -eq “down”
Get-NetAdapter -Name vEthernet* | Disable-NetAdapter
Disable-NetAdapter -Name "*" 
echo "netbios maha üle tcp ip"
Set-ItemProperty HKLM:\SYSTEM\CurrentControlSet\services\NetBT\Parameters\Interfaces\tcpip* -Name NetbiosOptions -Value 2
echo "powershell alias otsimine"
C:\WINDOWS\system32> Get-alias
echo "powershell kustuta prügi"
echo "üleliigsed aliased maha"
Get-alias
Remove-Item -Path Alias:\wget
Remove-Item Alias:Curl
Remove-Item Alias:Curl
Start-Sleep -Seconds 5
Get-alias
echo "kustutada üleliigsed adapterid - hyperv häkkimist tehakse kuidagi läbi selle"
Get-NetAdapterAdvancedProperty
Disable-NetAdapter
Disable-NetAdapterBinding
get-wmiobject win32_networkadapter | select netconnectionid, name, InterfaceIndex, netconnectionstatus
echo "disable services xbox ja muu jama"
$services = @(
    "diagnosticshub.standardcollector.service" # Microsoft (R) Diagnostics Hub Standard Collector Service
    "DiagTrack"                                # Diagnostics Tracking Service
    "dmwappushservice"                         # WAP Push Message Routing Service (see known issues)
    "lfsvc"                                    # Geolocation Service
    "MapsBroker"                               # Downloaded Maps Manager
    "NetTcpPortSharing"                        # Net.Tcp Port Sharing Service
    "RemoteAccess"                             # Routing and Remote Access
    "RemoteRegistry"                           # Remote Registry
    "SharedAccess"                             # Internet Connection Sharing (ICS)
    "TrkWks"                                   # Distributed Link Tracking Client
    #"WbioSrvc"                                 # Windows Biometric Service (required for Fingerprint reader / facial detection)
    #"WlanSvc"                                 # WLAN AutoConfig
    "WMPNetworkSvc"                            # Windows Media Player Network Sharing Service
    #"wscsvc"                                  # Windows Security Center Service
    #"WSearch"                                 # Windows Search
    "XblAuthManager"                           # Xbox Live Auth Manager
    "XblGameSave"                              # Xbox Live Game Save Service
    "XboxNetApiSvc"                            # Xbox Live Networking Service
    "ndu"                                      # Windows Network Data Usage Monitor
    "RasMan"                                      # Windows REMOTE CONNECTION MANAGER
   "SSDPSRV"                                      # SSDP Discovery
   "SstpSvc"                                      # SECURE SOCKET TUNNELING PROTOCOL SERVICE
  "WinHttpAutoProxySvc"                           # web proxy autodiscovery service
 "UdkUserSvc_15c865"                           # kahtlane teenus lihtsalt
 "WinRM"                           # windows remote management vist ka maha
"workfolderssvc"          # windows work folders ei kasuta
"HvHost"		# hyperv jama kui pole vaja siis minema
"vmickvpexchange"	# hyperv jama kui pole vaja siis minema
"vmicguestinterface"	# hyperv jama kui pole vaja siis minema
"vmicshutdown"		# hyperv jama kui pole vaja siis minema
"vmicvmsession"		# hyperv jama kui pole vaja siis minema
"vmicrdv"		# hyperv jama kui pole vaja siis minema
"vmictimesync"		# hyperv jama kui pole vaja siis minema
"vmicvss"		# hyperv jama kui pole vaja siis minema
"NetTcpPortSharing"	#
"RemoteAccess"		#
"SCardSvr"		#
"AxInstSV"		#
"MapsBroker"		#
"lfsvc"		#
"SharedAccess"		#
"lltdsvc"		#
"wlidsvc"		#
"NgcSvc"		#
"NcbService"		#
"PhoneSvc"		#
"RmSvc"		#
"SSDPSRV"		#
"ShellHWDetection"		#
"ScDeviceEnum"		#
#SSDPSRV		# net discovery
"WiaRpc"		#
"OneSyncSvc"		#
"TabletInputService"		#
"upnphost"		#
"ShellHWDetection"		#
"TabletInputService"		#
"UserDataSvc"		#
"UnistoreSvc"		#
"WalletService"		#
"Audiosrv"		#
"AudioEndpointBuilder"		#
"FrameServer"		#
"stisvc"		#
"wisvc"		#
"icssvc"		#
"WpnService"		#
"WpnUserService"		#
"XblAuthManager"		#
"XblGameSave"		#
# Services which cannot be disabled
#"WdNisSvc"
)

foreach ($service in $services) {
    Write-Output "Trying to disable $service"
    Get-Service -Name $service | Set-Service -StartupType Disabled
}



#clear-recyclebin - võibolla siiski ei taha roti jälgi kustutada
Disable-WindowsOptionalFeature -Online -FeatureName MicrosoftWindowsPowerShellV2Root /norestart
Disable-WindowsOptionalFeature -Online -FeatureName WCF-TCP-PortSharing45 /norestart
Disable-WindowsOptionalFeature -Online -FeatureName WCF-Services45 /norestart
Disable-WindowsOptionalFeature -Online -FeatureName WorkFolders-Client /norestart
Disable-WindowsOptionalFeature -Online -FeatureName Printing-XPSServices-Features /norestart 
Disable-WindowsOptionalFeature -Online -FeatureName Printing-Foundation-InternetPrinting-Client /norestart 
DISM /online /get-features /format:table
Dism /Online /Disable-Feature /FeatureName:AppServerClient /norestart 
Dism /Online /Disable-Feature /FeatureName:Client-DviceLockdown /norestart 
Dism /Online /Disable-Feature /FeatureName:Client-EmbeddedBootExp /norestart 
Dism /Online /Disable-Feature /FeatureName:Client-EmbeddedLogon /norestart 
Dism /Online /Disable-Feature /FeatureName:Client-EmbeddedShellLauncher /norestart 
Dism /Online /Disable-Feature /FeatureName:ClientForNFS-Infrastructure /norestart 
Dism /Online /Disable-Feature /FeatureName:Client-KeyboardFilter /norestart 
Dism /Online /Disable-Feature /FeatureName:Client-ProjFS /norestart 
Dism /Online /Disable-Feature /FeatureName:Client-UnifiedWriteFilter /norestart
Dism /Online /Disable-Feature /FeatureName:Containers /norestart 
Dism /Online /Disable-Feature /FeatureName:DataCenterBridging /norestart 
Dism /Online /Disable-Feature /FeatureName:DirectoryServices-ADAM-Client /norestart 
Dism /Online /Disable-Feature /FeatureName:DirectPlay /norestart 
Dism /Online /Disable-Feature /FeatureName:FaxServicesClientPackage /norestart 
Dism /Online /Disable-Feature /FeatureName:HostGuardian /norestart 
Dism /Online /Disable-Feature /FeatureName:HypervisorPlatform /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-ApplicationDevelopment /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-ApplicationInit /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-ASP /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-ASPNET /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-ASPNET45 /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-BasicAuthentication /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-CertProvider /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-CGI /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-ClientCertificateMappingAuthentication /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-CommonHttpFeatures /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-CustomLogging /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-DefaultDocument /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-DigestAuthentication /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-DirectoryBrowsing /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-FTPExtensibility /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-FTPServer /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-FTPSvc /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-HealthAndDiagnostics /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-HostableWebCore /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-HttpCompressionDynamic /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-HttpCompressionStatic /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-HttpErrors /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-HttpLogging /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-HttpRedirect /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-HttpTracing /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-IIS6ManagementCompatibility /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-IISCertificateMappingAuthentication /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-IPSecurity /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-ISAPIExtensions /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-ISAPIFilter /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-LegacyScripts /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-LegacySnapIn /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-LoggingLibraries /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-ManagementConsole /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-ManagementScriptingTools /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-ManagementService /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-Metabase /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-NetFxExtensibility /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-NetFxExtensibility45 /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-ODBCLogging /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-Performance /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-RequestFiltering /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-RequestMonitor /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-Security /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-ServerSideIncludes /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-StaticContent /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-URLAuthorization /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-WebDAV /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-WebServer /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-WebServerManagementTools /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-WebServerRole /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-WebSockets /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-WindowsAuthentication /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:IIS-WMICompatibility /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:Internet-Explorer-Optional-amd64 /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:LegacyComponents /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:MediaPlayback /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:Microsoft-Hyper-V /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:Microsoft-Hyper-V-All /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:Microsoft-Hyper-V-Hypervisor /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:Microsoft-Hyper-V-Management-Clients /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:Microsoft-Hyper-V-Management-PowerShell /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:Microsoft-Hyper-V-Services /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:Microsoft-Hyper-V-Tools-All /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:Microsoft-Windows-Client-EmbeddedExp-Package /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:Microsoft-Windows-NetFx3-OC-Package /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:Microsoft-Windows-NetFx3-WCF-OC-Package /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:Microsoft-Windows-NetFx4-US-OC-Package /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:Microsoft-Windows-NetFx4-WCF-US-OC-Package /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:Microsoft-Windows-NetFx-VCRedist-Package /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:MicrosoftWindowsPowerShellV2 /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:MicrosoftWindowsPowerShellV2Root /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:Microsoft-Windows-Printing-PrintToPDFServices-Package /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:Microsoft-Windows-Printing-XPSServices-Package /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:Microsoft-Windows-Subsystem-Linux /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:MSMQ-ADIntegration /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:MSMQ-Container /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:MSMQ-DCOMProxy /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:MSMQ-HTTP /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:MSMQ-Multicast /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:MSMQ-Server /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:MSMQ-Triggers /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:MSRDC-Infrastructure /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:MultiPoint-Connector /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:MultiPoint-Connector-Services /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:MultiPoint-Tools /Remove /norestart 
Dism /online /Disable-Feature /featurename:Microsoft-Windows-NetFx3-OC-Package /Remove /norestart 
Dism /online /Disable-Feature /featurename:Microsoft-Windows-NetFx3-WCF-OC-Package /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:NetFx3 /All /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:NetFx4-AdvSrvs /Remove /norestart  
Dism /online /Disable-Feature /featurename:Microsoft-Windows-NetFx4-US-OC-Package /Remove /norestart 
Dism /online /Disable-Feature /featurename:Microsoft-Windows-NetFx4-WCF-US-OC-Package /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:NetFx4Extended-ASPNET45 /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:NFS-Administration /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:Printing-Foundation-Features /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:Printing-Foundation-InternetPrinting-Client /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:Printing-Foundation-LPDPrintService /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:Printing-Foundation-LPRPortMonitor /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:Printing-PrintToPDFServices-Features /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:Printing-XPSServices-Features /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:RasCMAK /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:RasRip /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:ScanManagementConsole /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:SearchEngine-Client-Package /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:ServicesForNFS-ClientOnly /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:SimpleTCP /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:SMB1Protocol /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:SMB1Protocol-Client /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:SMB1Protocol-Server /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:SmbDirect /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:SNMP /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:TelnetClient /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:TFTP /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:TIFFIFilter /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:WAS-ConfigurationAPI /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:WAS-NetFxEnvironment /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:WAS-ProcessModel /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:WAS-WindowsActivationService
Dism /Online /Disable-Feature /FeatureName:WCF-HTTP-Activation /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:WCF-HTTP-Activation45 /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:WCF-MSMQ-Activation45 /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:WCF-NonHTTP-Activation /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:WCF-Pipe-Activation45 /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:WCF-Services45 /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:WCF-TCP-Activation45 /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:WCF-TCP-PortSharing45 /Remove /norestart 
Dism /Online /Disable-Feature /FeatureName:Windows-Defender-ApplicationGuard
Dism /Online /Disable-Feature /FeatureName:Windows-Defender-Default-Definitions
Dism /Online /Disable-Feature /FeatureName:Windows-Identity-Foundation
Dism /Online /Disable-Feature /FeatureName:WindowsMediaPlayer
Dism /Online /Disable-Feature /FeatureName:WMISnmpProvider
Dism /Online /Disable-Feature /FeatureName:WorkFolders-Client /Remove /norestart 
DISM /online /get-features /format:table
DISM /online /get-features /format:table | find """Enabled""" | more
Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All
Disable-WindowsOptionalFeature -Online -FeatureName "Hearts"
get-windowsoptionalfeature -online
Dism /Online /Cleanup-Image /RestoreHealth
DISM /Online /Cleanup-Image /ScanHealth


echo "kontrolli integrity üle"






sfc /scannow

Dism /Online /Cleanup-Image /RestoreHealth

kui DVD ON SEES
DISM /Online /Cleanup-Image /RestoreHealth /Source:WIM:X:\sources\Install.wim:1


Services maha
REMOTE ACCESS CONNECTION MANAGER 
SECURE SOCKET TUNNELING PROTOCOL SERVICE 
SSDP Discovery
PROXY MAHA
Open the host file in the following location as an administrator: %systemdrive%\Windows\System32\Drivers\etc\
Create the following entry for WPAD in the host file: 255.255.255.255 wpad.
IPRoute
ipstat
Netinfo
EnableRouter
iparp