Setting DNS for Windows Servers Using PowerShell

Setting DNS for Windows servers is straightforward using PowerShell. Utilizing Get-WMIObject Win32_NetworkAdapterConfiguration against a list of servers from a text file in a loop is the best way to handle a bulk dns change to your servers. I was prompted to share my PowerShell script after reading a post from Mike Tabor on his blog at MikeTabor.com titled How to update VMware Windows VM’s DNS using PowerCLI .

Mike Tabor goes through his process of taking an old script he found and updated it to more modern PowerCLI script. His script is very useful in that you can change the IP address in addition to setting dns for Windows servers in your VMware environment. He credits Jase McCarty who created the original script and helped Mike update it. I encourage you to go check it out.

Person's hand typing on a MacBook Pro with code on the screen
Scripting time

Set-ServersDNS

Here is my purely PowerShell script that I have been using for the past few years to make dns changes. It does not update IP addresses but does allow for changes to dns settings. Using a foreach loop with all the necessary dns settings through Get-WMIObject makes for a simplified script. But just because it is simplified doesn’t mean you can’t do mass amounts of damage to your environment. I always test against a few individual test servers just to make sure before I send this against all my Windows servers.

It does work on both physical and virtual Windows computers. Unfortunately we still have a few Windows physical servers so I will still utilize this script when setting dns for Windows servers. However, when I need to make a mass IP and dns change to virtual machine servers I will utilize Mike Tabor’s script. I expect that soon my environment will not have any physical Windows servers. All virtual is the goal!

Caution: Like all code you download from the internet, please understand and modify the code accordingly to prevent unforeseen production problems.  Also known as career-altering events. 

More From My Site

Schannel Set-Crypto PowerCLI Script

Backup VDS PowerCLI Script

vami_config_net To Change VCSA Hostname

Deleting Orphaned Virtual Desktops In VMware View

PowerShell SSL Certificate Script

Be social and share:
LINKEDIN

SEsparse Snapshot Data Inconsistencies

SEsparse snapshot data inconsistencies have been reported with databases. This is one of last week’s more interesting knowledge base articles. This is not something to take lightly. The knowledge base article is titled ‘Virtual Machines running on an SEsparse snapshot may report guest data inconsistencies (59216)’ . The good news is that it has been resolved and there is also a workaround. Please click on the link to see the entire kb article that includes the workaround.

Symptoms

  • Applications such as databases may report block-level data inconsistency.
  • Guest operating systems may report file system metadata inconsistencies
  • The VM fails to boot when it is running from an SEsparse snapshot.

SEsparse is a snapshot format introduced in vSphere 5.5 for large disks, and is the preferred format for all snapshots in vSphere 6.5 and above with VMFS-6.

Cause

VMware has identified an issue in SEsparse VM snapshots that can cause data inconsistencies.

This issue occurs when a VM is running on an SEsparse snapshot and experiences a burst of non-contiguous write IO in a very short period of time.

Impact / Risks

Impacted Configurations:

  • VMFS-5 or NFS Datastores: VMs with virtual disks >2TB and snapshots. On VMFS-5 and NFS, the SEsparse format is used for virtual disks that are 2 TB or larger
  • VMFS-6 Datastores: VMs with snapshots. SEsparse is the default format for all snapshots on VMFS-6 datastores.

Impacted vSphere releases:

  • vSphere 6.5 and above with VMFS-6 and any VM with snapshots.
  • vSphere 5.5 and above when VMs with virtual disks >2TB have snapshots.

Note: VMFS-5 or NFS datastores only use SEsparse with snapshots when virtual disks exceed 2 TB in size or SEsparse is explicitly configured.

silhouette with brain and gears turning
Knowledge is power

Resolution

The issue is resolved the following releases:

Be social and share:
LINKEDIN

Scratch File Location for VMHosts PowerCLi Script

I’ve been wanting to create a PowerCli script to automatically configure a scratch file location if one did not exist. This script would come in handy when moving to a new lun for the scratch location. After some quick google fu I came across a great script that met my requirements plus a little more.

Check out the post over at http://miklm.com/2018/01/configure-scratch-location-with-powercli/

In addition to creating the needed scratch file location this script indicates if it is already created and if the vmhost needs a reboot to complete the process. A csv file is created with a list of all the hosts that need a reboot. I made two small changes to the script. I added the cluster name to the exported name of the csv file. A disconnect-viserver command was added to the end of the script.

PowerCLi Script
Coding
Scripting Time

Feel free to comment and give suggestions on how to improve this script or any others I have shared. While you’re here check out my Schannel Set-Crypto PowerCLi Script Feedback is always appreciated.

Be social and share:
LINKEDIN

vCenter Server 6.7.0a Resolved Issues

Resolved Issues vCenter 6.7.0a

It is a good time to start planning your next upgrade so here are the highlights of all the Resolved Issues in 6.7.0a

Resolved Installation and Upgrade Issues

  • Upgrade to vCenter Server 6.7 might fail with an error 
  • The GUI installer might display one and the same error message caused by firstboot failures during stage 2 of the vCenter Server Appliance upgrade
  • Installation or upgrade to vCenter Server 6.7 might fail with an error “Failed to register Auto Deploy” during firstboot

Resolved vSphere Web Client and vSphere Client Issues

  • The vSphere Web Client might stop responding when you try to log in
  • You might not be able to disable the deduplication or encryption features by using the Allow Reduced Redundancy option in the Configure vSAN wizard in the vSphere Client
  • In a deployment without Internet connection, the VMware vSAN health service might alert that the Hardware Compatibility List (HCL) database is out of date

For more information including patches and isos for 6.7.0a please click the source link or picture below.

Source: VMware vCenter Server 6.7.0a Release Notes

Planning

Be social and share:

LINKEDIN

4 Months Till vSphere 5.5 Support Ends

As usual VMware magnanimously offers to provide extended support for a ‘small’ purchase price.

“In the event you are unable to upgrade before the End of General Support (EOGS) and are active on Support and Subscription, you have the option to purchase extended support in one year increments for up to two years beyond the EOGS date. Visit VMware Extended Support for more information.”

If support is just a best-case scenario and you can stomach going it alone (with Google searching) then Technical Guidance with be available for another year until September 19, 2020.

Google Support
Google Support

“Technical Guidance for vSphere 5.5 is available until September 19, 2020 primarily through the self-help portal. During the Technical Guidance phase, VMware does not offer new hardware support, server/client/guest OS updates, new security patches or bug fixes unless otherwise noted. For more information, visit VMware Lifecycle Support Phases.”

Technical Support is always a good option to have and for all of you knowledge seekers it is a great way to learn the nuances of VMware products.  See my previous post Tech Support is Not a Dirty Word for my take.

Be social and share:

LINKEDIN

Finally – VMware Cloud on Amazon Web Services

Amazon Web Services and VMware have finally launched their much anticipated VMware Cloud on Amazon Web Services. What does this mean for traditional VMware shops?  In my opinion it means that the ease of exploring the cloud for enterprises has become much more likely to happen. In other words this will accelerate the move to the cloud for vSphere deployments everywhere. 

VMware Cloud on AWS Key feature

The ability to manage applications across your private-on-premises cloud and AWS becomes seamless. The ability to see your Amazon vSphere clusters in your vCenter just like any other cluster is awesome.  This is what I have been clamoring for and I can’t wait to try this.

Hurdles to overcome using VMware Cloud on AWS

I hope that this will also mean that I can go out and purchase Amazon Web Services through VMware which is already a trusted partner for our enterprise.  At my enterprise we have been exploring the possibility of moving some services to the cloud but we are running into issues with our legal team and the Amazon Web Services contract.  Amazon has been very resistant to changing any of the legal language that our lawyers are insisting upon.  The result has been that we are stuck in limbo.  I hope to explore this further in the coming months and will update here what I find.

 

 

Be social and share:

LINKEDIN

Review of VMware vSphere: Optimize and Scale 6.5

I had the opportunity a few months ago to take the VMware vSphere: Optimize and Scale [6.5] class. The class was held at MicroTek Atlanta Training. The facility was very nice and not far from the hotel I stayed at for the week. The instructor was Brian Perry who is the Managing Partner with VUmbrella. He is a member of a very exclusive club VMworld Alumni Elite. Alumni Elite members (21) have attended every VMworld event and now have been given a free pass for life as long as they continue to go to each VMworld event and do not miss one.

The course is broken down into 11 sections. (You can get the outline from the course link above in the first paragraph) Going into this class after reading the outline I was worried that there wouldn’t be enough new material to justify taking this class in the first place. For experienced VMware admins this class is great because it allowed me to test drive many of the new feature of vSphere 6.5 before implementing in my lab.  In my case, whether intentional or not, I had been exposed to many of the more advanced parts of this class through VMware Support requests.  (Just a little training tidbit: If you can’t get your organization to pay for advanced VMware training, use VMware Support to get educated when you invariably have issues in your environment.  Most of the techs are more than happy to explain to you the why behind the what.  The other excellent resource is VMware Hands-On Labs which is free to everyone. If you need some free resources please refer to my previous article Top 13 Free VMware Training Resources)

Training2

Out of the 11 different sections the 4 sections on Optimization and the vCenter Server Availability and Performance were the best for me.  The Optimization sections cover CPU, Memory, Storage, and Network.  They especially get into the use of esxtop to troubleshoot and analyze your environment.  Setting up vCenter HA in the class was a great experience and within a couple of weeks after attending this class it was setup in my production environment.  Great Stuff!

The bottom line is that this class was great especially the instructor Brian Perry. After talking with Brian I think I found my next VMware training class.  VMware vSphere: Troubleshooting Workshop .  His description was that the instructor runs scripts to break various parts of vSphere and you have to fix it.  What better way to learn is there?

Be social and share:

LINKEDIN