Get public IP on a Windows Server via PowerShell

20160614150939Every so often I need a quick way of getting the public IP of a Windows server. There are several ways of doing this but my preferred method leverages PowerShell, specifically the Invoke-WebRequest CMDLET. It sends HTTP, HTTPS, FTP, and FILE requests to a web page or service and responds with elements that you have configured it to capture such as links, images etc.

To obtain the public IP via PowerShell run the simple one-liner below:

PS C:\> (Invoke-WebRequest -uri "http://ipecho.net/plain").Content

Running this command will successfully show your public IP:

20170529132213

There are numerous other services you can call to get the public IP, a few are below:

http://ipinfo.io/ip
http://icanhazip.com
http://ident.me
http://smart-ip.net/myip

Simply replace http://ipecho.net/plain in the PowerShell command above with one of the URLs above and you should get your public IP back in exactly the same way.

References:
Invoke-WebRequest

How to upgrade SQL Server 2012 Evaluation Edition to Standard or Enterprise

20170522112224SQL Server 2012 Evaluation Edition was installed on a server as a temporary measure with a view of upgrading it to Enterprise Edition at some stage in the future. Thankfully the steps were quite straight-forward and did not require building a new server and migrating data etc. I had no idea that SQL Server 2012 was still on the Evaluation Edition until one day the backups started failing, no doubt after the 180 evaluation period had expired. When opening SQL Server Management Studio I saw the following warning:

20170425204909

The steps below will show you how to upgrade SQL Server 2012 Evaluation Edition to Enterprise Edition (same steps apply for Standard Edition).

The Upgrade Process

1. Locate the SQL Server 2012 install media and mount it to the desired server.

2. Run the media, select Maintenance and click on Edition Upgrade:

20170425205141

3. On the Setup Support Rules section, click OK:

20170425205245

4. Then click Next:

20170425205448

5. Enter your product key then click Next :

20170425205604

6. Check I accept the license terms and click Next:

20170425205857

7. Select the instance that needs to be upgraded, in my case it was SANDBOX, then click Next:

20170425210108

8. Assuming no failures are detected during the compatibility check, click Next to proceed:

20170425210302

9. Click Upgrade for the upgrade process to begin:

20170425210434

10. Once the upgrade process has completed click on Close:

20170425212020

11. To verify SQL Server 2012 has been upgraded successfully, login to the instance via SQL Server Management Studio:

20170425212144

12. Within Server Properties you will observe the Product is now listed as Microsoft SQL Server Enterprise (64-bit):

20170425212837

That’s it! :)

References:
Upgrade to a Different Edition of SQL Server (Setup)