Migrate Pass-Through Disk storage attached hyper- v virtual machines

September 6, 2015 Leave a comment

Cause :

Pass through Disk attached Hyper-V virtual machine may not start and you receive a “‘Failed to Power on with Error ‘General access denied error’ (0x80070005)”.

Pass disk 3

Scenario :

Pass through disk  attached  hyper-v VM’s is failed to start when change storage systems or migrate to new host/cluster.

Resolution :

The above error is receive  when reattach pass through GUI from failover manager settings or Hyper-V manager. So need to add the disk using PowerShell with elevated permission.

Command syntax : Add-VMHardDiskDrive -VMName VMName -ControllerType SCSI -ControllerNumber 0 -DiskNumber 1 -AllowUnverifiedPaths -Passthru


Replace ‘VMName’ with your affected virtual machine. Get disk Number and controller number from disk management or failover cluster manager.

Export AD Users Password Expiration Report to CSV with PowerShell from Domain controller

July 29, 2015 2 comments

This Post describes of exporting all active directory users password expiry date in CSV format using windows PowerShell.

Step 1 : Copy below PowerShell command to a notepad and save with the name ADusersexpiryreport.ps1

Import-Module ActiveDirectory
Get-ADUser -filter {Enabled -eq $True -and PasswordNeverExpires -eq $False} `
–Properties “SamAccountName”,”mail”,”pwdLastSet”,”msDS-UserPasswordExpiryTimeComputed” |
Select-Object -Property “SamAccountName”,”mail”,@{Name=”Password Last Set”;`
Expression={[datetime]::FromFileTime($_.”pwdLastSet”)}}, @{Name=”Password Expiry Date”;`
Expression={[datetime]::FromFileTime($_.”msDS-UserPasswordExpiryTimeComputed”)}} |
Export-CSV “C:\\PasswordExpirationReport.csv” -NoTypeInformation -Encoding UTF8

Step 2 : Login to Domain controller and open windows PowerShell as an administrator.

Step 3 : Run the script and the result will be saved in ‘C’ drive

Categories: Active Directory

How to disable SMB/NETBIOS NULL Session on domain controllers

July 29, 2015 Leave a comment

Applies to : Windows 2008, windows 2008 r2 and Windows 2012/R2

By default null sessions (unauthenticated ) are enabled on windows 2000 and 2003 servers . As a result anyone can use these NULL connections to enumerate potentially sensitive information from the servers. Null session vulnerability is disabled on fresh Windows 2008 and earlier versions

This post explain the steps for disabling SMB/NETBIOS NULL Session on domain controllers using group policy.

Step 1 : Apply below group policy settings to Default Domain Controller policy object or to the GPO object that is applied to your domain controllers.

Edit GPO- Go to Computer configuration\Policies\Windows settings\Security Settings\Local Policies\SecurityOptions

Network access: Restrict Anonymous access to Named Pipes and Shares
Network access: Do not allow anonymous enumeration of SAM accounts
Network access: Do not allow anonymous enumeration of SAM accounts and shares
Network access: Shares that can be accessed anonymously
Network access: Let Everyone permissions apply to anonymous users
Network access: Allow anonymous SID/Name translation

Step 2 : Update the registry key values to restrict null session as below:

RestrictAnonymous = 1
Restrict AnonymousSAM = 1
EveryoneIncludesAnonymous = 0

Categories: Active Directory Tags:

Hyper-V virtual Fibre Channel – Virtual machine direct storage array connectivity with HBA

June 15, 2015 Leave a comment

With windows 2012 and earlier OS , it can use virtual Fibre adapter feature to provide direct storage array connectivity from virtual machine

  • Optimal Storage performance and full protocol access
  • Supports guest clustering
  • Must use NPIV enabled HBA adapters and FC switches
  • Create Fibre channel SAN within hyper –v Virtual SAN manager
  • Use same virtual SAN configuration and naming convention on Hyper-V failover cluster environment

The below session describes how to configure a Hyper-V hosts to provision virtual machine with  virtual Fibre Channel adapter.

Platform : A servers with Hyper-V on Windows 2012 R2. Two Dual Port HBA Adapter is installed on this host.

Step 1 : Open Hyper-V manager – Virtual SAN manager- Create Virtual HBA ( VHBA1)  for first physical adapter as shown below:


Note: There are two Physical HBA is installed on host .So created Virtual HBA for first physical adapter. You can configure both HBA for redundancy

After Victual HBA is created , configure Virtual HBA controllers to the Virtual Server

From the virtual server settings – Add Hardware –Select Fibre channel Adapter

Assign the virtual Fibre adapter to the virtual server


Then next step is do the zoning on Fibre switch and register the host on storage array.

Hyper-V guest failover cluster- Provisioning Shared Virtual Disk

June 7, 2015 Leave a comment

This post describes how to create shared volume disk for virtual servers. Using shared disk feature easily can implement virtual server’s cluster known as guest cluster. Virtual hard disk allows to share same disk between multiple virtual machines and this ideal solution when host SQL 2012/2014 cluster in virtual servers.

Note: SQL 2012 and earlier version doesn’t support cluster shared volume (CSV) disks.

Virtualization Platform: Windows Server 2012 R2 Failover Cluster using Cluster Shared Volumes (CSV)

Step 1  :  Go to first guest Virtual machine from failover cluster manager.

Step 2: Add new VHDX virtual Hard Disk with desired size in the host CSV shared Disk

Example: C:\ClusterStorage\VolumeX, where C:\ represents the system drive, and X represents the desired CSV volume number.

Step 3: In the virtual machine settings, under SCSI Controller, expand the hard drive that you created in the previous procedure.

Click Advanced Features.

In the details pane, select the Enable virtual hard disk sharing check box.



Step 4: Go to the Second Guest virtual server and add the same VHDX files you created on the first Guest virtual server and share them also like in previous steps

Step 5: Login to first guest virtual server and then go to disk management

Step 6: Initialize the Bring the disk online, partition and format the drive with NTFS


Hyper-v virtual machines lose randomly network connections

January 14, 2015 Leave a comment

Issue :

Virtual machines running on hyper-v is randomly disconnected from networks. Live migration will restore network connectivity of affected Virtual machines

Affected Platforms :

Windows Server 2012 R2 Hyper-V & HP Servers


Disable VMQ on the physical network adapters on the host servers including teaming if any.


  • Open device manager
  • Expand each Network Adapters
  • Select network adapters and go to properties –Advanced- then select virtual machine Queues- then set value is disable
  • VMQ
Categories: HYPER V Tags:

SCOM – Servers Logical Disk Free Space monitoring and Alert

October 20, 2014 1 comment

One of my favorite monitor in SCOM is server logical drives free space monitoring . It’s very important of having automated server logical disk space monitoring in place.

In this post describes , how to configure Logical Disk Free Space Monitor to alert on less than 25% free space on logical drives.

Open operation Manager Console → Then Go to Authoring.

Then Click on Monitors, then click Scope. Type Logical Disk in the Look for input box, and check all three  operating systems targets . Then click OK

1 scom

Expand Windows server 2008 logical Disk as Shown below:


Then select Windows Server 2008 Logical Disk Free Space (%) Low monitor   .Then  override it for all objects of class.

2 scom

Evaluate the default settings for the following parameters and compare them against your business needs.
Thresholds are  split into to types of drives; System and non-System.System type drives host the operating system. Non-System type drives are all other drives.

Please follow the below image and apply the adjustments to monitor and alert windows 2008 logical disks ( Apply same for windows 2003 & 2012 monitors ).Do not use default Management Pack.

3 scom

Now you can use Operations Console to proactively monitor free disk space. Checking this state view once per day will be a part of the daily routine .See below example.


%d bloggers like this: