Monday, November 30, 2015

How to control wireless vs wired priority in Windows

A Student asked recently how to control wireless vs. LAN priorities in Windows 7. Wireless was being used, even when on the LAN. One absolute way to do this is by disabling the Wireless when connected to the LAN – but this requires vendor support – like in some Dell BIOS’ there’s an option to do this. But a simpler method may be to override the default interface metric used by IP on the wired or wireless interface. Here's the what and why and how: 

If I go to the route print command on a system with wired and wireless I see the following :


I’ve highlighted the two interface IPs which show their bizarre local on-link metrics for local communications. (FWI, these are all derived from what we will be configuring directly)  What really matters here is the metric to the default gateway routes circled at the top – which one will be used?

In my case 192.168.2.9 will be used with the metric of 20. How did it get that metric of 20? It’s certainly not 20 hops to the default gateway! Well a metric does not mean hop count. A metric is the just the relative measure to determine preference among routing methodologies.
Well, as we would learn from http://support.microsoft.com/kb/299540 the metric for each interface to the default gateway is based upon a link speed range:

Link Speed Metrics for Operating Systems after XP sp2
10 = > 200 Mb 
20 = Between 80 Mb and 200 Mb 
25 = Between 20 Mb, and 80 Mb 
30 = Between 4 Mb, and 20 Mb 
40 = Between 500 Kb and 4 Mb 
50 = < 500 Kb 
So in my scenario it’s because it has the Link speed of 100mb/s which gives it an automatic metric of 20, which is better than the 192.168.2.7 which has a link speed of 72mb/s (wireless) which earns it an automatic metric of 25. So in my scenario, the LAN is preferred over the Wireless, and all is well.

The real problem shows up with a 802.11n interface that gets about 150mb/s and a LAN interface with 100mb/s. Then they both get a metric of 20, and it’s a toss up which one gets used, and you may find that it's the wireless!

This is the situation when you will override the automatic metric by going to the advanced interface property dialog box of the TCP/IP settings to lower the metric of the preferred NIC (or raise the metric of the the less preferred NIC)

In my scenario, I'm lowering the metric of my Wireless to force it to be the preferred Interface.  After making this change, we can see that the default gateway is now preferred to go through this interface that his this metric.
I’m going to undo this now so that my LAN is the preferred interface again!

Hopefully this deepens your understanding of how Microsoft is managing your multihomed system when it comes to routing. And these are really routing rules that apply to all routing devices and protocols as well, so this knowledge can serve you when administering any routing device and managing two routes to the same network based on the same protocol with differing metrics.

Good luck getting Windows to behave itself!

Monday, November 23, 2015

Building a SharePoint, SQL and Exchange Lab: Logfiles Tip

I work with a lot of lab or development scenarios. These situations are usually a fast buildup and a quick teardown with little connective tissue or infrastructure.However some of these environments may last a while, and when they do, they can start to trigger "DISK SPRAWL" (que dramatic music)

Here's the deal, both Microsoft Exchange and Microsoft SQL Server have log files that are used to ensure the integrity of their databases in case of disk failure or power outage. As a safety check, these logs are not cleared until they have been backed up. So backup of these log files enables them to be overwritten. Conversely, however, NOT performing log file backups on these servers (say in a lab or development environment) means that they grow... and grow... and grow... sometimes to terabytes in size!

Two solutions:
1) Perform backups as if you were in a production environment

2) Disable the safety check so that your lab/dev/test environment doesn't preserve the log files past the point in which data from memory is written to disk.

Here's how to do the latter for both Exchange and SQL

Exchange: Enable Circular Log Files on the Exchange Mailbox Database



1) Open Internet Explorer and Browse to the Exchange 2013 ECP URL (usually http://servername/ecp/
2) Log in with an administrative account.


3) Select "Servers" from the Lefthand Navigation bar
4) Select "Databases" from the Contextual Horizontal Navigation Bar
5) Select the database you want to enable Circular logging for and click the “Edit” pencil






6) Click on "Maintenance "
7) Click on "Enable circular logging"
8) Click on "save "
 

9) Click OK to the warning message that appears


10) Select the database and click the elipses (...) in the menu bar and choose "Dismount"


11) Click on "Yes"

12) Select the database and click the elipses (...) in the menu bar and choose Mount"
13) Click on "Yes"

And now you've enabled circular logging in Exchange.  That was the easy one.

SQL: Enabling Simple Recovery Mode in your databases

For more information on SQL's Transaction Log and the Simple Recovery mode check out these other articles:
Preventing Transaction Log Fires
My SQL Transaction Log is huge - should I switch to simple recovery mode?

1) Open the SQL Server Management Studio
 
 
2) Log into your SQL instance with sysadmin credentials
 
 
3) In the toolbar click "New Query"
 

4) You could now either open up the properties of the master database and each user database, go to the options section, and choose "simple" from the drop down menu for Recovery Mode or...

Copy and Paste the following script into the SQL Server Management Window

Use Master
alter database [model] set recovery simpleselect 'alter database ['+name+'] set recovery simple' from master.sys.databases where database_id > 4 and state_desc = 'online' 
select 'use ['+name+'] checkpoint' from master.sys.databases where database_id > 4 and state_desc = 'online'
select 'DBCC Shrinkdatabase (['+name+'], 0) ' from master.sys.databases where database_id > 4 and state_desc = 'online'
select 'DBCC Shrinkdatabase (['+name+'], 0, TRUNCATEONLY) ' from master.sys.databases where database_id > 4 and state_desc = 'online'


5) Click Execute -

NOTE: If you perform these actions BEFORE installing SharePoint then you are done!
Already installed SharePoint? Keep going! -

6) Right Click in the first results area below the script code and select "Select All"
7) Right Click in the first results area below the script code and select "Copy"



8) Click New Query
9) Paste the selected text into the query script window


10) Click Execute
11) Verify the commands completed successfully




12) Click the script file select drop down
13) Choose the first script file

14) Scroll down to the Second result block
15) Repeat steps 6-13 for the Second result block



16) Scroll down to the Third result block
17) Repeat steps 6-13 for the Third result block

18) Scroll down to the Fourth result block
19) Repeat steps 6-11 for the Fourth result block

You're done - your log files are now under control for your lab/test/dev environment!







Thursday, November 5, 2015

vCenter and VCSA database choices and Host and VM support in vCenter 6.0

It can get confusing trying to track down how many hosts and VMs can be hosted with a vCenter Server or vCenter Server Appliance based upon the choice of database model that I want to work with.

vCenter Server


embedded 5.5 vCenter - vPostgres (prior versions used SQL Express) - 5 Hosts and 50 VMs
embedded 6.0 vCenter - vPostgres - 20 Hosts and 200 VMs
external vCenter- Microsoft SQL - 1,000 Hosts and 10,000 VMs

vCenter Server Appliance


embedded 5.5 vCSA - vPostgres - 100 Hosts and 3,000 VMs
embedded 6.0 vCSA - vPostgres  - 1,000 Hosts and 10,000 VMs
external vCenter - ORACLE - 1,000 Hosts and 10,000 VMs (primarily for bringing in an existing database with content)

So... the vCSA now allows full size support and now supports Linked Mode, plus you avoid paying Windows License or MS SQL Licenses and the whole Windows Security attack vector.

If you are using the VCS and you would like to move to the VCSA you have two options:
Rebuild intelligently - really your best option
Use this fling: https://labs.vmware.com/flings/vcs-to-vcva-converter

So get to the VCSA - it's awesome!

Monday, November 2, 2015

Can I install windows 10 with a local account? YES!

I get asked this more often than Microsoft would like. Yes, it's great to have a system set up with a built-in cloud presence. But some systems just don't have Internet access or relate to a live body with an email address. And some people just don't want that much Microsoft, even when they are buying their OS.

So here's the trick to installing a local account on Windows 10 box during installation. Pretend to go along with the plan then chicken out at the last second.
Step 1

Step 2

Step 3
And you've installed with a local account! The process is similar when you go to create an account after installation - keep going and look for an option duck out and get your circa 1995 local user account groove on.

Hope it helps!