Via Browser:
https://ifconfig.me/ip
Via cURL:
curl http://ifconfig.me/ip
Via PowerShell:
(Invoke-WebRequest -uri "http://ifconfig.me/ip").Content
| [System.Net.ServicePointManager]::SecurityProtocol = 'Tls,Tls11,Tls12'; | |
| function Test-Administrator | |
| { | |
| $CurrentUser = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent()) | |
| $CurrentUser.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) | |
| } | |
| # Download file | |
| function Get-File |
| -- Create a new database | |
| CREATE DATABASE database_name; | |
| -- Create a new user | |
| CREATE USER 'username'@'%' IDENTIFIED BY 'password'; | |
| -- Allow user connections to server | |
| GRANT USAGE ON *.* TO 'username'@'%'; | |
| -- Grant user privileges on database |
| [Reflection.Assembly]::LoadWithPartialName("System.Drawing") | |
| function CaptureScreenshot([Drawing.Rectangle]$Bounds, $Path) { | |
| # Initialize image | |
| $Image = New-Object Drawing.Bitmap $Bounds.Width, $Bounds.Height | |
| $Graphics = [Drawing.Graphics]::FromImage($Image) | |
| $Graphics.CopyFromScreen($Bounds.Location, [Drawing.Point]::Empty, $Bounds.Size) | |
| # Save screenshot | |
| $Image.Save($Path) |
Via Browser:
https://ifconfig.me/ip
Via cURL:
curl http://ifconfig.me/ip
Via PowerShell:
(Invoke-WebRequest -uri "http://ifconfig.me/ip").Content
| # Disable Firewall | |
| Set-NetFirewallProfile -Profile Domain, Public, Private -Enabled False | |
| # Enable Firewall | |
| Set-NetFirewallProfile -Profile Domain, Public, Private -Enabled True |