In my lab, I often have the need to quickly set up various servers from scratch. One type of server is an Active Directory Domain Controller. So I slapped together a simple script to completely automate (light touch) the process of setting up a complete AD DC in a new forest. I also did the…
Get Network card driver version remotely
1 2 3 4 5 6 7 8 9 10 11 12 |
# Get Network card driver version remotely and only for a specific vendor $cred = Get-Credential domain\user Invoke-Command -Credential $cred -ScriptBlock {Get-WmiObject Win32_PnPSignedDriver -Filter "DeviceClass = 'NET'" | Where-Object devicename -Match qlogic | ft DeviceName,DriverVersion} -ComputerName computernamehere #sample output: #DeviceName DriverVersion #---------- ------------- #QLogic FastLinQ QL45412H 40GbE Adapter (VBD Client) 8.37.6.0 #QLogic FastLinQ QL45412H 40GbE Adapter (VBD Client) 8.37.6.0 #QLogic FastLinQ QL45412H 40GbE Adapter (VBD Client) 8.37.6.0 #QLogic FastLinQ QL45412H 40GbE Adapter (VBD Client) 8.37.6.0 |
System Center Virtual Machine Manager build numbers
For those of you who are looking for System Center Virtual Machine Manager build numbers, there is a great wiki article on technet about this. https://social.technet.microsoft.com/wiki/contents/articles/15361.system-center-virtual-machine-manager-list-of-build-numbers.aspx
Set up fullscreen video on linux in Hyper-V
I don’t know about you, but i find myself sometimes wanting to run linux GUI desktop as a VM in Hyper-V. By default, the screen resolution is horrifying. So, I always change it so i can get at least a 1920×1080 resolution. To do that I enter the VM from the Hyper-V console, open up…
Set custom property on all guests in VMM
In my lab I have several types of storage for my guests, like 7K over SMB3, SSD over SMB3 or local storage. I thought it would be nice to see which storage my guests were on right there in the VMM console, so i created custom property and made myself a simple little powershell function…
VMM UR12 may break the ability to set VLAN on VMs
I had a strange issue today. In my lab, I have a hyper-v 2012 R2 cluster with VMM 2012 R2 that i use as a dev/test environment. Among other things, i let this rig take in all patches and what not before doing anything with production systems. I recently updated the VMM 2012 R2 server…
Having fun cleaning up Hyper-V checkpoints
I was cleaning up some checkpoints in my home data-center lab today, and started tinkering with a script to automate the task. I put together a couple of short “script-lets” i can put in my task scheduler.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
###################### #Using AD ###################### #Note: The user running the script must have at least read permissions in the AD where the #Hyper-V cluster "lives" and be a member of the "Hyper-V Administrators" group on each cluster node. #Import Modules ipmo ActiveDirectory ipmo Hyper-V #Get servers $hyperv = Get-ADObject -SearchBase "DC=domain,DC=com" -Filter 'ObjectClass -eq "serviceConnectionPoint" -and Name -eq "Microsoft Hyper-V"' $servers = $hyperv | ForEach-Object { $_.DistinguishedName.Split(",")[1].replace("CN=","") } #Remove old snapshots Get-VM -ComputerName $servers | Get-VMSnapshot | Where-Object {$_.CreationTime -lt (Get-Date).AddDays(-2) } | Remove-VMSnapshot |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
###################### #Using cluster ###################### #Note: Can be run from a computer/by a user in any domain or forrest that has two way trust #with the domain of the cluster. The user running the script must have at least read #permissions on the cluster and be a member of the "Hyper-V Administrators" group on each #cluster node. #Import Modules ipmo Hyper-V #Get servers $nodes = Get-ClusterNode -Cluster hpvclu.domain.com | Select -Expand Name #Remove old snapshots Get-VM -ComputerName $nodes | Get-VMSnapshot | Where-Object {$_.CreationTime -lt (Get-Date).AddDays(-2) } | Remove-VMSnapshot |