Saturday, October 28, 2017

PowerShell Script to Disable Specific "Spying" Services in Microsoft Windows

Run PowerShell as Administrator


1. Enable script execution in PowerShell

powershell "Set-ExecutionPolicy Unrestricted"
2. Save the below script in a file names disable_services.ps1 then execute it from Powershell by typing at the prompt: ./disable_services.ps1
#requires -version 4.0#requires -runasadministrator
$services = @(    # Services Considered To Have Spying Capabilities    "DcpSvc"                                   # Data Collection and Publishing Service    "diagnosticshub.standardcollector.service" # Microsoft (R) Diagnostics Hub Standard Collector Service    "DiagTrack"                                # Diagnostics Tracking Service    "SensrSvc"                                 # Monitors Various Sensors    "dmwappushservice"                         # WAP Push Message Routing Service    "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    "WMPNetworkSvc"                            # Windows Media Player Network Sharing Service    "WSearch"                                  # Windows Search    # Gaming Based Services    "XblAuthManager"                           # Xbox Live Auth Manager    "XblGameSave"                              # Xbox Live Game Save Service    "XboxNetApiSvc"                            # Xbox Live Networking Service    # Windows HomeGroup Services    "HomeGroupListener"                        # HomeGroup Listener    "HomeGroupProvider"                        # HomeGroup Provider    # Other Optional    #"bthserv"                                 # Bluetooth Support Service    #"wscsvc"                                  # Security Center Service    #"WlanSvc"                                 # WLAN AutoConfig    "OneSyncSvc"                               # Sync Host Service    "AeLookupSvc"                              # Application Experience Service    "PcaSvc"                                   # Program Compatibility Assistant    "WinHttpAutoProxySvc"                      # WinHTTP Web Proxy Auto-Discovery    "UPNPHOST"                                 # Universal Plug & Play Host    "ERSVC"                                    # Error Reporting Service    "WERSVC"                                   # Windows Error Reporting Service    "SSDPSRV"                                  # SSDP Discovery Service    "CDPSvc"                                   # Connected Devices Platform Service    "DsSvc"                                    # Data Sharing Service    "DcpSvc"                                   # Data Collection and Publishing Service    "lfsvc"                                    # Geolocation service)
foreach ($service in $services) {    if ( Get-Service "$service*" -Include $service ) {        Write-Host " Disabling Service $service ..."        Get-Service -Name $service | Stop-Service -Force        Get-Service -Name $service | Set-Service -StartupType Disabled    }}



Saturday, October 14, 2017

Change / Check / Clear DNS from Command Line of Mac OSX

How to Set DNS Servers from the Command Line of OS X with networksetup


Set OpenDNS for the first two DNS servers, and Google DNS as the third fallback:
networksetup -setdnsservers Wi-Fi 208.67.222.222 208.67.220.220 8.8.8.8


Checking DNS Settings with networksetup

This will report back whatever the current DNS settings are, if any:

networksetup -getdnsservers Wi-Fi

Clear the local DNS cache

When URLs are just not resolving the way you want it, to time to clear or flush the dns nameserver local cache:
sudo killall -HUP mDNSResponder


Revert Back and Clear All DNS Servers with networksetup

Remove any existing custom DNS server settings:
sudo networksetup -setdnsservers Wi-Fi empty