Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $fcAdapters = get-pnpdevice -PresentOnly | ? {$_.FriendlyName -match "Fibre" }
- $fcAdapters | % { Disable-PnpDevice -InstanceId $_.InstanceId -Confirm:$false }
- # Disable-PnpDevice : Generic failure
- PS C:\Users\Administrator> get-winevent -ListLog '*'| % { Get-WinEvent -FilterHashtable @{LogName=$_.LogName;StartTime=(get-date).AddMinutes(-5);Level=3} -ErrorAction
- SilentlyContinue} | ft -AutoSize -Wrap
- # ProviderName: Microsoft-Windows-Kernel-PnP
- # TimeCreated Id LevelDisplayName Message
- # ----------- -- ---------------- -------
- # 7/10/2018 10:28:58 AM 225 Warning The application \Device\HarddiskVolume1\Program Files\QLogic Corporation\QLRemote\qlremote.exe with process id 3220
- # stopped the removal or ejection for the device PCI\VEN_1077&DEV_2031&SUBSYS_17E8103C&REV_02\4&257301f0&0&0110.
- # 7/10/2018 10:28:52 AM 225 Warning The application \Device\HarddiskVolume1\Program Files\QLogic Corporation\QLRemote\qlremote.exe with process id 3220
- # stopped the removal or ejection for the device PCI\VEN_1077&DEV_2031&SUBSYS_17E8103C&REV_02\4&257301f0&0&0010.
- stop-service QLManagementAgentJava
- get-vm | Get-VMFibreChannelHba | Remove-VMFibreChannelHba
- get-vmsan | remove-vmsan
- $fcAdapters = get-pnpdevice -PresentOnly | ? {$_.FriendlyName -match "Fibre" }
- $fcAdapters
- # Status Class FriendlyName InstanceId
- # ------ ----- ------------ ----------
- # OK SCSIAdapter QLogic Fibre Channel Adapter PCI\VEN_1077...
- # OK SCSIAdapter QLogic Fibre Channel Adapter PCI\VEN_1077...
- $fcAdapters | % { Disable-PnpDevice -InstanceId $_.InstanceId -Confirm:$false }
- $fcAdapters = get-pnpdevice -PresentOnly | ? {$_.FriendlyName -match "Fibre" }
- $fcAdapters
- Status Class FriendlyName InstanceId
- ------ ----- ------------ ----------
- Error SCSIAdapter QLogic Fibre Channel Adapter PCI\VEN_1077...
- Error SCSIAdapter QLogic Fibre Channel Adapter PCI\VEN_1077...
- Get-VMHostAssignableDevice
- $locationPath = ($fcAdapters[1] | Get-PnpDeviceProperty DEVPKEY_DEVICE_LOCATIONPATHS).Data[0]
- Dismount-VMHostAssignableDevice -LocationPath $locationPath -Force
- # Dismount-VMHostAssignableDevice : The operation failed.
- # The device cannot be assigned to a virtual machine as the firmware (BIOS or UEFI) on this host computer system indicates that the device must remain in contact with
- # the firmware running in the host. The device can only be used in the management operating system. You should contact your OEM to determine if a firmware upgrade is
- # available, or if the PCI Express device can be reconfigured to be independent of the host firmware.
- wget https://raw.githubusercontent.com/Microsoft/Virtualization-Documentation/master/hyperv-samples/benarm-powershell/DDA/survey-dda.ps1 -Us
- eBasicParsing -OutFile survey-dda.ps1
- #
- # QLogic Fibre Channel Adapter
- # BIOS requires that this device remain attached to BIOS-owned memory. Not assignable.
- # QLogic Fibre Channel Adapter
- # BIOS requires that this device remain attached to BIOS-owned memory. Not assignable.
- InstanceID : PCIP\VEN_1077&DEV_2031&SUBSYS_17E8103C&REV_02\4&257301F0&0&0010
- LocationPath : PCIROOT(0)#PCI(0200)#PCI(0000)
- CimSession : CimSession: .
- ComputerName : R05-U10-UCC
- IsDeleted : False
- InstanceID : PCIP\VEN_1077&DEV_2031&SUBSYS_17E8103C&REV_02\4&257301F0&0&0110
- LocationPath : PCIROOT(0)#PCI(0200)#PCI(0001)
- CimSession : CimSession: .
- ComputerName : R05-U10-UCC
- IsDeleted : False
- Add-VMAssignableDevice -VMName "instance-0000065f" -LocationPath "PCIROOT(0)#PCI(0200)#PCI(0000)"
- # Add-VMAssignableDevice : 'instance-0000065f' failed to add resources to 'instance-0000065f'.
- # Cannot perform the operation.
- # 'instance-0000065f' failed to add resources. (Virtual machine ID E83EF271-2872-45D9-A1B8-14F25D919B83)
- # Cannot add the device to 'instance-0000065f' as that virtual machine is configured to go to saved state on host
- # shutdown. (Virtual machine ID E83EF271-2872-45D9-A1B8-14F25D919B83)
- set-vm "instance-0000065f" -AutomaticStopAction TurnOff
- Add-VMAssignableDevice -VMName "instance-0000065f" -LocationPath "PCIROOT(0)#PCI(0200)#PCI(0000)"
- get-winevent -ListLog '*'| % { Get-WinEvent -FilterHashtable @{LogName=$_.LogName;StartTime=(get-date).AddMinutes(-5);Level=2} -ErrorAction SilentlyContinue} | ft -AutoSize -Wrap
- # ProviderName: Application Error
- # TimeCreated Id LevelDisplayName Message
- # ----------- -- ---------------- -------
- # 7/10/2018 1:06:56 PM 1000 Error Faulting application name: python.exe, version: 0.0.0.0, time stamp:
- # 0x5488ac1c
- # Faulting module name: hbaapi.dll, version: 10.0.14393.0, time stamp:
- # 0x57898eff
- # Exception code: 0xc0000005
- # Fault offset: 0x0000cf2f
- # Faulting process id: 0x1aec
- # Faulting application start time: 0x01d4184eb82203ed
- # Faulting application path: c:\python27\python.exe
- # Faulting module path: C:\windows\SYSTEM32\hbaapi.dll
- # Report Id: 607bf28f-3e71-4124-a51f-b502b029650f
- # Faulting package full name:
- # Faulting package-relative application ID:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement