Tag Archive: PowerShell

Aug 16 2017

PowerShell Script: Report-VMWareVMs

I’m working on migration of a few hundred VMs from VMWare to Hyper-V and one requirement I have is to take a snapshot of the current VMs configuration in VMWare for future reference for after we decommission the VMWare environment. Collecting VM specs, virtual disk information, network MAC addresses, etc… for hundreds of VMs using …

Continue reading »

Permanent link to this article: http://almoselhy.azurewebsites.net/2017/08/powershell-script-report-vmwarevms/

Aug 14 2017

PowerShell Script: Convert-VMWareVM

In the past couple of days, I have been busy working on a new script to automate migration of VMs from VMWare to Hyper-V, or more precisely to System Center Virtual Machine Manager (VMM). You may ask why on earth would I use a script to “automate” a function that already exists in VMM and …

Continue reading »

Permanent link to this article: http://almoselhy.azurewebsites.net/2017/08/powershell-script-convert-vmwarevm/

Jul 31 2017

PowerShell Function: Copy-VMFolder

Hyper-V in Windows Server 2016 and Windows 10 came with some very cool features that makes interacting with VMs easier than ever. The ability to copy files into a VM directly from host is such a blessing. The Hyper-V Module now includes the cmdlet copy-VMFile which can copy any “File” from the host to a …

Continue reading »

Permanent link to this article: http://almoselhy.azurewebsites.net/2017/07/powershell-function-copy-vmfolder/

Jun 29 2017

Migrate from NIC Teaming to SET in Windows Server 2016 and VMM

So you just upgraded your Hyper-V hosts to Windows Server 2016 and read about the new Switch Embedded Teaming (SET) switches and how they make life all roses and butterflies. In this post, we will discuss how to migrate from the traditional teaming in previous versions of Windows Server to the amazing SET virtual switch …

Continue reading »

Permanent link to this article: http://almoselhy.azurewebsites.net/2017/06/migrate-from-nic-teaming-to-set-in-windows-server-2016-and-vmm/

Jun 29 2017

Ping all VMs in a Hyper-V Cluster

In a perfect world, everyone trusts that their VMs are working properly if Hyper-V or VMM are reporting that it is in a running state. However, sometimes we need to double check things using the most basic tool, PING! In this post, we will walk through a few PowerShell snippets that do the following, Finds …

Continue reading »

Permanent link to this article: http://almoselhy.azurewebsites.net/2017/06/ping-all-vms-in-a-hyper-v-cluster/

Feb 06 2017

Orchestrator Runbook: Select Domain Controller with Minimum PS Sessions

Many of the Runbooks I have connect to domain controller to perform an activity using a PowerShell script, and usually this means multiple instance of the Runbook may be running at the same time. These Runbooks require the FQDN of the domain controller to work on. Two challenges lie there, Load balancing: I want to …

Continue reading »

Permanent link to this article: http://almoselhy.azurewebsites.net/2017/02/orchestrator-runbook-select-domain-controller/

Nov 13 2015

Using Set-VMNetworkAdapterVlan with clustered VMs

I recently needed to assign VLANs to a group of virtual machines on a Hyper-V cluster, tried to use the Set-VMNetworkAdapterVlan  cmdlet directly only to find that it needs the current host of each VM to work, so here’s a small script to get it done. The script select only VMs where no VLAN is …

Continue reading »

Permanent link to this article: http://almoselhy.azurewebsites.net/2015/11/using-set-vmnetworkadaptervlan-with-clustered-vms/

Sep 22 2015

Delete phantom records of an old domain controller from DNS

Sometimes after demoting a DC the NS records in DNS are kept! These records may cause issues if not deleted. Here’s a PowerShell three liner to remove the obsolete records from all zones, you need to change the server names according to your environment.  

  Cheers!

Permanent link to this article: http://almoselhy.azurewebsites.net/2015/09/delete-phantom-records-of-an-old-domain-controller-from-dns/

Dec 21 2014

Compare contents of two folders using PowerShell Get-FileHash

I needed to check that two folders are identical using a hash algorithm. Luckily enough, PowerShell 4.0 came equipped with a new cmdlet, Get-FileHash. This easy command can produce a hash for any file using an array of different algorithms. One issue is when comparing with, Compare-Object, the difference in folder paths will be an …

Continue reading »

Permanent link to this article: http://almoselhy.azurewebsites.net/2014/12/compare-contents-of-two-folders-using-powershell-get-filehash/

Nov 27 2014

Collect installed updates on many computers using PowerShell

I wanted to collect the currently installed updated on a group of servers using PowerShell. This can be more accurate that WSUS or SCCM reports since it depends on WIM to get the current data, not the last reported ones. The – very small – script gets the computer objects from active directory, then use …

Continue reading »

Permanent link to this article: http://almoselhy.azurewebsites.net/2014/11/collect-installed-updates-on-many-computers-using-powershell/

Older posts «