1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
<#
.SYNOPSIS
Hi Guys Here's a Script which i created to extract the MPIO.SYS and MSISCSI.SYS Information
across My Virtual Machine's and my Hyper-V Hosts (Service Pack Details) Using PowerShell SCVMM Cmdlets
Currently i have not updated the script to an advanced function as i did long back, i guess its a good project
for you guys to figure it out :)
.EXAMPLE
Log into an SCVMM Server
Run
Get-VMMServer <Server Name> to establish connection to the SCVMM server and run the command's below the function
to extract the required data
#>
function Get-Mpio {
[CmdletBinding()]
param(
[Parameter(Mandatory=$true,ValueFromPipeline=$True,HelpMessage="Computer Name")]
$compname
)
$session = New-PSSession -ComputerName $compname
Invoke-Command -Session $session -ScriptBlock {
Set-Location "c:Windowssystem32drivers"
$mpio = get-childitem * -include mpio.sys | foreach-object { "{0}`t{1}" -f $_.Name, [System.Diagnostics.FileVersionInfo]::GetVersionInfo($_).fileversion }
}
$mpfinal= (Invoke-Command -Session $session -ScriptBlock { $mpio })
Get-PSSession | Remove-PSSession
return $mpfinal
}
function Get-MSIscsi {
[CmdletBinding()]
param(
[Parameter(Mandatory=$true,ValueFromPipeline=$True,HelpMessage="Computer Name")]
$compname
)
$session = New-PSSession -ComputerName $compname
Invoke-Command -Session $session -ScriptBlock {
Set-Location "c:Windowssystem32drivers"
$msiscsi = get-childitem * -include msiscsi.sys | foreach-object { "{0}`t{1}" -f $_.Name, [System.Diagnostics.FileVersionInfo]::GetVersionInfo($_).fileversion }
}
$msiscsifinal= (Invoke-Command -Session $session -ScriptBlock { $msiscsi })
Get-PSSession | Remove-PSSession
return $msiscsifinal
}
<#MPIO_MSISCSI_SERVICEPACK_VM#>
Get-VM -VMMServer scvmm01 |?{$_.operatingsystem -match "Windows Server 2008 R2"} | Select-Object @{Name="ComputerName";Expression={$_.Name}}, `
operatingsystem,@{Name="MPIO_FileVersion";Expression={get-mpio -compname $_.computernamestring}} `
, @{Name="MSISCSI_FileVersion";Expression={get-msiscsi -compname $_.computernamestring}} | Export-Csv "c:VM_MPIO_MSISCI.csv"
<#MPIO_MSISCSI_Hyper-V-HOSTS#>
Get-VMHost -VMMServer scvmm01 | Select-Object computername, operatingsystem `,@{Name="MPIO_FileVersion";Expression={get-mpio -compname $_.name}} `
, @{Name="MSISCSI_FileVersion";Expression={get-msiscsi -compname $_.name}} | Sort-Object -Descending computername | Export-Csv "c:MPIO_MSISCSI_VMHOST.csv"
# SIG # Begin signature block
# MIID8QYJKoZIhvcNAQcCoIID4jCCA94CAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR
# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQU95d3NsvJJnkiQdAzYf2mtOkG
# UGygggIQMIICDDCCAXmgAwIBAgIQhlfUKTyJ+75Jv/MCo3iQ8zAJBgUrDgMCHQUA
# MBcxFTATBgNVBAMTDFZpbml0aCBNZW5vbjAeFw0xMjEwMjMxMjQ0MDFaFw0zOTEy
# MzEyMzU5NTlaMBcxFTATBgNVBAMTDFZpbml0aCBNZW5vbjCBnzANBgkqhkiG9w0B
# AQEFAAOBjQAwgYkCgYEA1omAIG/bEKCbtgavJtjjh30PIFGzBi+HU2b16f+NqXiA
# vW7OzeiG60M36Ni7hfX8ANak6WfwV0pTiOZXxA65Gml/xU/hdDsM/2BcBRn7X836
# l53KcV3h7c0epM4kifOe5NESk63rkIPxVMjiG+4iGLa6VFbawJ+Tpg0DjlcpnLcC
# AwEAAaNhMF8wEwYDVR0lBAwwCgYIKwYBBQUHAwMwSAYDVR0BBEEwP4AQS11gR8gM
# 74mXY/Q289zhx6EZMBcxFTATBgNVBAMTD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