Author: --Anand--

I am located at Silicon Valley working as IT Infrastructure Architect.

Windows 10: How to setup NAT network for Hyper-V guests?


Windows 10 Hyper-V has NAT (Network Address Translation) network feature, but it needs to setup using PowerShell now.  I will show you step by step instructions how to do it. NAT Switch provides Internet access to the VM without creating External Switch (linking the switch to physical wired or wireless adaptor).

Before we start, here are the requirements to prepare it ahead of time.

1.  IP Network to be used in Guests. You need to find a subnet that is not being using in your Office network. If you are setting up on your Home, you can choose any subnet that is not used in your home. E.g., 192.168.200.0/24

2. Guest VMs are needed to assign IP address/subnet/gateway manually from the subnet you choose on requirement 1 above. Or you may need to setup in DHCP server in one of the Guest VMs for automatic IP assignment. If you only have one or two guest VMs, you may set the IP address manually on NICs.

Now the step by step instruction.

Step 1: Open PowerShell with Administrative privileges.

Search PowerShell in Start menu search, right click on PowerShell and choose More ==> Run As Administrator.

Step 2: Create Hyper-V internal only switch.

Run this command on the PowerShell.

New-VMSwitch –SwitchName “NAT-Switch” –SwitchType Internal –Verbose

Step 3: Find the Interface Index number

Type this cmdlet and note down the interface index (ifIndex) for NAT-Switch adaptor.

Get-NetAdapter

Step 4: Create NAT Gateway

Run this cmdlet. Replace

  • IP Address (gateway) with your own (should be from the network subnet you chose in the requirements section above)
  • PrefixLength is the subnet mask number for the subnet you chose
  • Interface index you noted down on previous step.

New-NetIPAddress –IPAddress 192.168.200.1 -PrefixLength 24 -InterfaceIndex 16 –Verbose

Step 4: Create NAT Network

Run this cmdlet and replace InternelIPInterfaceAddressPrefix with your chosen network.

New-NetNat –Name NATNetwork –InternalIPInterfaceAddressPrefix 192.168.200.0/24 –Verbose

Step 5: Connect your VM to the NAT-Switch

You may manually assign the Guest NIC to the “NAT-Switch” which we created in Step-2.  Or you may run this cmdlet to assign NIC from all Guest VMs to the “NAT-Switch”

Get-VM | Get-VMNetworkAdapter | Connect-VMNetworkAdapter –SwitchName “NAT-Switch”

Step 6: Assign IP Address to the NICs in Guests

Open NIC properties in your Guest VMs, Assign IPv4 addresses from the network subject you setup in Step-4.  Or run DHCP server from one of your Guests to dish IP address automatically.

E.g.,

Guest VM 1:

IP Address: 192.168.200.11
Subnet: 255.255.255.0
Gateway: 192.168.200.1
DNS: 4.2.2.2 and 8.8.8.8 (or your own DNS server from the office network).

Guest VM 2:

IP Address: 192.168.200.12
Subnet: 255.255.255.0
Gateway: 192.168.200.1
DNS: 4.2.2.2 and 8.8.8.8 (or your own DNS server from the office network).

That’s all. By  now you guests should have access to External networks and Internet.

Hope this helped you. Leave me a reply below.

Advertisements

Windows 10 Hello: That fingerprint has already been set up on another account.


If you ditched an account that had a fingerprint setup in Windows Hello, Windows 10 won’t let you add the same fingerprint for another account, obliviously.  Or you are trying to use second account with same fingerprint. So you will get this error message:

clip_image001

The question is how do we delete the registered fingerprint(s ) with different unused account. It is easy as 20 second task. Here is how you do it.

1. Open Services console (Windows key + R and type Services.msc). Stop the service called  Windows BioMetric Service (WbioSrvc)

2. Open folder location in file explorer: C:\Windows\System32\WinBioDatabase\. On this location, there will GUID.dat files. Find the one with date you recognized you register the fingerprint. If not, just delete all DAT files.

3. Start the service Windows BioMetric Service again.

There was no reboot required on my case. Try registering your fingerprint now. Enjoy. Smile

Outlook goes blank and unresponsive when new email arrives


I believe Outlook windows seems to hang at times due to difference between hardware or software graphics acceleration setting. By default Hardware graphics acceleration is enabled.

If your Outlook goes blank or unreponsive or hangs, try disabling the hardware graphics acceleration. To do it, go to Outlook advanced settings (File ==> Settings ==>Advanced), uncheck the box for Disable hardware graphics acceleration.

OutlookAdvancedSetting

Active Directory: How to delegate the right to unlock accounts?


This information is to provide rights to unlock accounts in a OU or domain for a user WITHOUT giving any other administrative rights. so here is how to do it?

  1. Right-click the OU or domain in Active Directory Users and Computers console and select Delegate Control from the context menu
  2. Click Next on the Welcome dialog
  3. Click Add to select the user or group and click OK
  4. Click Next
  5. Select Create a custom task to delegate and click Next
  6. Select Only the following objects in the folder. In the list, check User objects and click Next
  7. Clear the General checkbox and check the Property-specific box
  8. Check both the Read lockoutTime and Write lockoutTime boxes and press Next and Finish button.

clip_image001

Exchange: Meeting room disappears after adding to the meeting request in Outlook


Almost every one complained they can’t add a particular conference room to a meeting request in Outlook. They said the meeting room disappears from their meeting request. Strange, huh! When I checked it myself, sure the resource is added and after a second it did disappeared or removed automatically.

Without boring details of analysis, I found the conference room calendar settings is messed up (or someone messing things around). To test if this happened to you, do this:

1. Connect to Exchange Server (or Exchange Online) by PowerShell

2. Type this cmdlet to see if you get an error:  Get-MailboxCalendarConfiguration –Identity <Conference Room Display Name or email address>

If you get this error, that is our/your problem.

WARNING: The object “…” has been corrupted, and it’s in an inconsistent state. The following validation errors happened:
WARNING: The end time that you entered occurs before the start time. The start time must occur before the end time.

so as per the warning says working hours are setup wrong. Correct it by using this below cmdlet. I specified the working hours for the room is morning 8am to evening 6pm. Change the timings to your needs.

Set-MailboxCalendarConfiguration -Identity <Conference Room Display Name or email address> -WorkingHoursStartTime 08:00:00 -WorkingHoursEndTime 18:00:00

That’s all folks. No more disappearing of the resource. If this fixed your issue, leave me a reply below. Smile

Exchange: How to search by an email address?


What if you have an email address, you want to know which object that email address belongs to? Mailbox or Distribution Group or Contact or Public Folder?

You have to keep searching by the following commands till you find your object. Open PowerShell and connect to Exchange (or Exchange Online).

Get-Mailbox | %{$_.EmailAddresses | ?{$_ -like “*<email address>*”}}

Get-RemoteMailbox | %{$_.EmailAddresses | ?{$_ -like “*<email address>*”}}
Get-DistributionGroup | %{$_.EmailAddresses | ?{$_ -like “*<email address>*”}}

Get-MailContact| %{$_.EmailAddresses | ?{$_ -like “*<email address>*”}}
Get-MailPublicFolder | %{$_.EmailAddresses | ?{$_ -like “*<email address>*”}}

 

Hope you saved some time and found your Exchange Object. Enjoy!!

Find SQL Servers on the network by PowerShell


I will make simple and short. PowerShell command uses SQL Browser service to populate the local SQL servers and instances on the network.

So the requirements are:

  1. SQL Browser service installed and running (or run it on a SQL server)
  2. You should be a Administrator (preferably domain admin)
  3. You have to run this command on each site (on one of the local server)

Open PowerShell and run this command.

[System.Data.Sql.SqlDataSourceEnumerator]::Instance.GetDataSources()

Things are getting much easier these days. 🙂