Src/Public/Invoke-AsBuiltReport.Cisco.UcsManager.ps1
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 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 |
function Invoke-AsBuiltReport.Cisco.UcsManager { <# .SYNOPSIS PowerShell script to document the configuration of Cisco UCS infrastucture in Word/HTML/XML/Text formats .DESCRIPTION Documents the configuration of Cisco UCS infrastucture in Word/HTML/XML/Text formats using PScribo. .NOTES Version: 0.2.1 Author: Tim Carman Twitter: @tpcarman Github: tpcarman Credits: Brandon Beck (robbeck@cisco.com) - Cisco UCS Health Check Script Martijn Smit (@smitmartijn) - Cisco UCS Inventory Script Iain Brighton (@iainbrighton) - PScribo module .LINK https://github.com/AsBuiltReport/AsBuiltReport.Cisco.UcsManager #> param ( [String[]] $Target, [PSCredential] $Credential, [String]$StylePath ) # Import JSON Configuration for Section and InfoLevel $InfoLevel = $ReportConfig.InfoLevel $Section = $ReportConfig.Section #region Configuration Settings # If custom style not set, use default style if (!$StylePath) { & "$PSScriptRoot\..\..\AsBuiltReport.Cisco.UcsManager.Style.ps1" } foreach ($UCS in $Target) { # Connect to Cisco UCS domain using supplied credentials $UCSM = @() try { $UCSM = Connect-Ucs -Name $UCS -Credential $Credential -ErrorAction Stop } catch { Write-Error $_ } #endregion Configuration Settings #region Script Body #---------------------------------------------------------------------------------------------# # SCRIPT BODY # #---------------------------------------------------------------------------------------------# # Generate report if connection to UCS Manager is successful if ($UCSM) { #region Collect UCS Info $UcsLicense = Get-UcsLicense -Ucs $UCSM $UcsLanCloud = Get-UcsLanCloud -Ucs $UCSM $UcsSanCloud = Get-UcsSanCloud -Ucs $UCSM $UcsSystem = Get-UcsStatus -Ucs $UCSM $UcsFi = Get-UcsNetworkElement -Ucs $UCSM | Sort-Object Id $UcsBlade = Get-UcsBlade -Ucs $UCSM $UcsRackUnit = Get-UcsRackUnit -Ucs $UCSM | Sort-Object Id #endregion Collect UCS Info Section -Style Heading1 -Name "$($UcsSystem.Name)" { #region System Section if ($Section.System) { if ($UcsSystem) { Section -Style Heading2 -Name 'System' { #region Cluster Summary Table $ClusterStatus = [PSCustomObject]@{ 'Name' = $UcsSystem.Name 'Virtual IP Address' = $UcsSystem.VirtualIpv4Address 'HA Configuration' = $UcsSystem.HaConfiguration 'HA Ready' = $UcsSystem.HaReady 'Ethernet State' = $UcsSystem.EthernetState 'Backup Policy' = (Get-UcsMgmtBackupPolicy -Ucs $UCSM).AdminState 'Config Policy' = (Get-UcsMgmtCfgExportPolicy -Ucs $UCSM).AdminState 'Call Home State' = (Get-UcsCallhome -Ucs $UCSM).AdminState 'UCSM System Version' = (Get-UcsMgmtController -Ucs $UCSM -Subject system | Get-UcsFirmwareRunning).Version | Select-Object -Last 1 } if ($Healthcheck.Cluster.HAReady) { $ClusterStatus | Where-Object { $_.'HA Ready' -ne 'yes' } | Set-Style -Style Critical -Property 'HA Ready' } $ClusterStatus | Table -Name 'Cluster Status' -List -ColumnWidths 50, 50 #endregion Cluster Summary Table BlankLine #region Fabric Interconnect A Summary Table $UcsStatusFiA = [PSCustomObject]@{ 'Fabric Interconnect A Role' = $UcsSystem.FiALeadership 'Fabric Interconnect A IP Address' = $UcsSystem.FiAOobIpv4Address 'Fabric Interconnect A Subnet Mask' = $UcsSystem.FiAOobIpv4SubnetMask 'Fabric Interconnect A Default Gateway' = $UcsSystem.FiAOobIpv4DefaultGateway 'Fabric Interconnect A State' = $UcsSystem.FiAManagementServicesState } if ($Healthcheck.FI.State) { $ClusterStatus | Where-Object { $_.'Fabric Interconnect A State' -ne 'up' } | Set-Style -Style Critical -Property 'Fabric Interconnect A State' } $UcsStatusFiA | Table -Name 'Fabric Interconnect A Information' -List -ColumnWidths 50, 50 #endregion Fabric Interconnect A Summary Table BlankLine #region Fabric Interconnect B Summary Table $UcsStatusFiB = [PSCustomObject]@{ 'Fabric Interconnect B Role' = $UcsSystem.FiBLeadership 'Fabric Interconnect B IP Address' = $UcsSystem.FiBOobIpv4Address 'Fabric Interconnect B Subnet Mask' = $UcsSystem.FiBOobIpv4SubnetMask 'Fabric Interconnect B Default Gateway' = $UcsSystem.FiBOobIpv4DefaultGateway 'Fabric Interconnect B State' = $UcsSystem.FiBManagementServicesState } if ($Healthcheck.FI.State) { $ClusterStatus | Where-Object { $_.'Fabric Interconnect B State' -ne 'up' } | Set-Style -Style Critical -Property 'Fabric Interconnect B State' } $UcsStatusFiB | Table -Name 'Fabric Interconnect B Information' -List -ColumnWidths 50, 50 #endregion Fabric Interconnect B Summary Table BlankLine #region Fault Summary Table $UcsFault = Get-UcsFault -Ucs $UCSM if ($UcsFault -and $Options.ShowFaultSummary) { $UcsFaults = [PSCustomObject]@{ 'Critical Faults' = ($UcsFault | Where-Object { $_.Severity -eq 'critical' }).Count 'Major Faults' = ($UcsFault | Where-Object { $_.Severity -eq 'major' }).Count 'Minor Faults' = ($UcsFault | Where-Object { $_.Severity -eq 'minor' }).Count 'Warnings' = ($UcsFault | Where-Object { $_.Severity -eq 'warning' }).Count } $UcsFaults | Table -Name 'UCS Faults' -ColumnWidths 25, 25, 25, 25 } #endregion Fault Summary Table } } } #endregion System Section #region Equipment Section if ($Section.Equipment) { Section -Style Heading2 -Name 'Equipment' { #region Faric Interconnect Section if ($InfoLevel.Equipment.FabricInterconnects -ge 1) { Section -Style Heading3 -Name 'Fabric Interconnects' { #region Faric Interconnect Summary Table $UcsFiSummary = foreach ($Fi in $UcsFi) { $FiBoot = Get-UcsMgmtController -Ucs $UCSM -Dn "$($fi.Dn)/mgmt" | Get-UcsFirmwareBootDefinition | Get-UcsFirmwareBootUnit -Filter 'Type -ieq system -or Type -ieq kernel' | Select-Object Type, Version [PSCustomObject]@{ 'Fabric' = $Fi.Id 'Cluster Role' = Switch ($Fi.Id) { 'A' { $UcsSystem.FiALeadership } 'B' { $UcsSystem.FiBLeadership } } 'Model' = $Fi.Model 'Serial' = $Fi.Serial 'System' = ($FiBoot | Where-Object { $_.Type -eq "system" }).Version 'Kernel' = ($FiBoot | Where-Object { $_.Type -eq "kernel" }).Version 'Ports Used' = ((Get-UcsLicense -Ucs $UCSM -Scope $Fi.Id).UsedQuant | Measure-Object -Sum).Sum 'Ports Licensed' = ((Get-UcsLicense -Ucs $UCSM -Scope $Fi.Id).AbsQuant | Measure-Object -Sum).Sum 'Ethernet Mode' = $UcsLanCloud.Mode 'FC Mode' = $UcsSanCloud.Mode 'Status' = $Fi.Operability 'Thermal' = $Fi.Thermal } } $UcsFiSummary | Sort-Object 'Fabric' | Table -Name 'Fabric Interconnects' #endregion Faric Interconnect Summary Table #region Faric Interconnect Detailed Section if ($InfoLevel.Equipment.FabricInterconnects -ge 2) { foreach ($Fi in $UcsFi) { Section -Style Heading3 "Fabric Interconnect $($Fi.Id)" { $FiBoot = Get-UcsMgmtController -Ucs $UCSM -Dn "$($Fi.Dn)/mgmt" | Get-UcsFirmwareBootDefinition | Get-UcsFirmwareBootUnit -Filter 'Type -ieq system -or Type -ieq kernel' | Select-Object Type, Version #region Fabric Interconnect Detailed Table $UcsFiDetailed = [PSCustomObject]@{ 'Fabric' = $Fi.Id 'Cluster Role' = Switch ($Fi.Id) { 'A' { $UcsSystem.FiALeadership } 'B' { $UcsSystem.FiBLeadership } } 'IP Address' = $Fi.OobIfIp 'Subnet Mask' = $Fi.OobIfMask 'Default Gateway' = $Fi.OobIfGw 'MAC Address' = $Fi.OobIfMac 'Model' = $Fi.Model 'Serial' = $Fi.Serial 'Total Memory (GB)' = [math]::Round(($Fi.TotalMemory / 1024), 3) 'System' = ($FiBoot | Where-Object { $_.Type -eq "system" }).Version 'Kernel' = ($FiBoot | Where-Object { $_.Type -eq "kernel" }).Version 'State' = Switch ($Fi.Id) { 'A' { $UcsSystem.FiAManagementServicesState } 'B' { $UcsSystem.FiBManagementServicesState } } 'Ports Used' = ((Get-UcsLicense -Ucs $UCSM -Scope $Fi.Id).UsedQuant | Measure-Object -Sum).Sum 'Ports Licensed' = ((Get-UcsLicense -Ucs $UCSM -Scope $fi.Id).AbsQuant | Measure-Object -Sum).Sum 'Ethernet Mode' = $UcsLanCloud.Mode 'FC Mode' = $UcsSanCloud.Mode 'Status' = $Fi.Operability 'Thermal' = $Fi.Thermal 'Admin Evac Mode' = Switch ($Fi.AdminEvacState) { 'fill' { 'off' } default { $Fi.AdminEvacState } } 'Oper Evac Mode' = Switch ($Fi.OperEvacState) { 'fill' { 'off' } default { $Fi.OperEvacState } } } $UcsFiDetailed | Sort-Object 'Fabric' | Table -List -Name "Fabric Interconnect $($Fi.Id)" #endregion Fabric Interconnect Detailed Table #region Fabric Interconnect Fixed Module Section $UcsFiModule = $Fi | Get-UcsFiModule -Ucs $UCSM Section -Style Heading4 -Name 'Fixed Module' { $UcsFiFixedModule = [PSCustomObject]@{ 'ID' = $UcsFiModule.Id 'Model' = $UcsFiModule.Model 'Serial' = $UcsFiModule.Serial 'Description' = $UcsFiModule.Descr 'Max Number of Ports' = $UcsFiModule.NumPorts 'Status' = $UcsFiModule.OperState } $UcsFiFixedModule | Sort-Object 'ID' | Table -Name 'Fixed Modules' } #endregion Fabric Interconnect Fixed Module Section #--- Sort Expression to filter port id to be just the numerical port number and sort ascending ---# $sortExpr = { if ($_.Dn -match "(?=port[-]).*") { ($matches[0] -replace ".*(?<=[-])", '') -as [int] } } #--- Get Fabric Port Configuration and sort by port id using the above sort expression ---# #region Fabric Interconnect Ethernet Ports Section $UcsEthernetPorts = Get-UcsFabricPort -Ucs $UCSM -SwitchId "$($fi.Id)" | Sort-Object $sortExpr if ($UcsEthernetPorts) { Section -Style Heading4 -Name 'Ethernet Ports' { $UcsFiEthernetPorts = foreach ($UcsEthernetPort in $UcsEthernetPorts) { [PSCustomObject]@{ 'Slot' = $UcsEthernetPort.SlotId 'Port ID' = $UcsEthernetPort.PortId 'MAC' = $UcsEthernetPort.Mac 'State' = $UcsEthernetPort.AdminState 'If Role' = $UcsEthernetPort.IfRole 'If Type' = $UcsEthernetPort.IfType 'Status' = $UcsEthernetPort.OperState 'Peer' = $UcsEthernetPort.PeerDn } } $UcsFiEthernetPorts | Sort-Object 'Slot', 'Port ID' | Table -Name "Fabric Interconnect Ethernet Ports" } } #endregion Fabric Interconnect Ethernet Ports Section #region Fabric Interconnect FC Uplink Ports Section $UcsFcUplinkPorts = Get-UcsFiFcPort -Ucs $UCSM -SwitchId "$($fi.Id)" -IfRole 'network' if ($UcsFcUplinkPorts) { Section -Style Heading4 -Name 'FC Uplink Ports' { $UcsFiFcUplinkPorts = foreach ($UcsFcUplinkPort in $UcsFcUplinkPorts) { [PSCustomObject]@{ 'Slot' = $UcsFcUplinkPort.SlotId 'Port ID' = $UcsFcUplinkPort.PortId 'WWPN' = $UcsFcUplinkPort.WWN 'State' = $UcsFcUplinkPort.AdminState 'If Role' = $UcsFcUplinkPort.IfRole 'If Type' = $UcsFcUplinkPort.IfType 'Status' = $UcsFcUplinkPort.OperState } } $UcsFiFcUplinkPorts | Sort-Object 'Slot', 'Port ID' | Table -Name "Fabric Interconnect FC Uplink Ports" } } #endregion Fabric Interconnect FC Uplink Ports Section #region Fabric Interconnect Fans Section $UcsFiFans = Get-UcsFan -NetworkElement $Fi -Ucs $UCSM if ($UcsFiFans) { Section -Style Heading4 -Name 'Fans' { $FiFans = foreach ($UcsFiFan in $UcsFiFans) { [PSCustomObject]@{ 'Name' = "Fan Module $($UcsFiFan.Module)" 'Fan' = $UcsFiFan.Id 'Model' = $UcsFiFan.Model 'Power' = $UcsFiFan.Power 'Thermal' = $UcsFiFan.Thermal 'Presence' = $UcsFiFan.Presence 'Operability' = $UcsFiFan.OperState } } $FiFans | Sort-Object 'Name', 'Fan' | Table -Name "Fabric Interconnect Fans" } } #endregion Fabric Interconnect Fans Section #region Fabric Interconnect PSUs Section $UcsFiPSUs = Get-UcsPsu -NetworkElement $Fi -Ucs $UCSM if ($UcsFiPSUs) { Section -Style Heading4 -Name 'PSUs' { $FiPSUs = foreach ($UcsFiPSU in $UcsFiPSUs) { [PSCustomObject]@{ 'Name' = "PSU $($UcsFiPSU.Id)" 'ID' = $UcsFiPSU.Id 'Model' = $UcsFiPSU.Model 'Power' = $UcsFiPSU.Power 'Voltage' = $UcsFiPSU.Voltage 'Performance' = $UcsFiPSU.Perf 'Thermal' = $UcsFiPSU.Thermal 'Presence' = $UcsFiPSU.Presence 'Operability' = $UcsFiPSU.OperState } } $FiPSUs | Sort-Object 'Id', 'Name' | Table -Name "Fabric Interconnect PSUs" } } #endregion Fabric Interconnect PSUs Section } } } #endregion Faric Interconnect Detailed Section } } #endregion Faric Interconnect Section #region UCS Chassis Section $UcsChassis = Get-UcsChassis -Ucs $UCSM if ($UcsChassis) { if ($InfoLevel.Equipment.Chassis -ge 1) { Section -Style Heading3 -Name 'Chassis' { #region UCS Chassis Summary Table $UcsChassisSummary = ForEach ($Chassis in $UcsChassis) { $ChassisSlotCount = 0 $ChassisSlotCount = (Get-UcsBlade -Chassis $Chassis).Count $ChassisPsuCount = 0 $ChassisPsuCount = (Get-UcsPsu -Chassis $Chassis).Count [PSCustomObject]@{ 'Chassis ID' = $Chassis.Id 'Model' = $Chassis.Model 'Serial' = $Chassis.Serial 'Slots Used' = $ChassisSlotCount 'Slots Available' = (8 - $ChassisSlotCount) 'PSUs' = $ChassisPsuCount 'Power' = $Chassis.Power 'Power Redundancy' = (Get-UcsComputePsuControl -Chassis $Chassis).Redundancy 'Thermal' = $Chassis.Thermal 'State' = $Chassis.AdminState 'Status' = $Chassis.OperState 'Operability' = $Chassis.Operability } } $UcsChassisSummary | Sort-Object 'Chassis ID' | Table -Name 'Chassis Summary' #endregion UCS Chassis Summary Table #region UCS Chassis Detailed Section if ($InfoLevel.Equipment.Chassis -ge 2) { ForEach ($Chassis in $UcsChassis) { Section -Style Heading3 -Name "$($Chassis.Rn)" { #region UCS Chassis Detailed Table $ChassisSlotCount = 0 $ChassisSlotCount = (Get-UcsBlade -Chassis $Chassis).Count $ChassisPsuCount = 0 $ChassisPsuCount = (Get-UcsPsu -Chassis $Chassis).Count $ChassisDetailed = [PSCustomObject]@{ 'Chassis ID' = $Chassis.Id 'Model' = $Chassis.Model 'Serial' = $Chassis.Serial 'Slots Used' = $ChassisSlotCount 'Slots Available' = (8 - $ChassisSlotCount) 'PSUs' = $ChassisPsuCount 'Power' = $Chassis.Power 'Power Redundancy' = (Get-UcsComputePsuControl -Chassis $Chassis).Redundancy 'Thermal' = $Chassis.Thermal 'License State' = $Chassis.LicState 'State' = $Chassis.AdminState 'Status' = $Chassis.OperState 'Operability' = $Chassis.Operability } $ChassisDetailed | Table -List -Name "$($Chassis.Rn) Detailed Information" -ColumnWidths 50, 50 #endregion UCS Chassis Detailed Table #region UCS Chassis Fan Section $UcsChassisFans = Get-UcsFanModule -Chassis $Chassis -Ucs $UCSM if ($UcsChassisFans) { Section -Style Heading4 -Name 'Fans' { $ChassisFans = foreach ($UcsChassisFan in $UcsChassisFans) { [PSCustomObject]@{ 'Name' = "Fan Module $($UcsChassisFan.Id)" 'ID' = $UcsChassisFan.Id 'Power' = $UcsChassisFan.Power 'Voltage' = $UcsChassisFan.Voltage 'Performance' = $UcsChassisFan.Perf 'Thermal' = $UcsChassisFan.Thermal 'Presence' = $UcsChassisFan.Presence 'Operability' = $UcsChassisFan.OperState } } $ChassisFans | Sort-Object 'Id', 'Name' | Table -Name "$($Chassis.Rn) Fans" } } #endregion UCS Chassis Fan Section #region UCS Chassis IOM Section $UcsChassisIoms = Get-UcsIom -Chassis $Chassis -Ucs $UCSM if ($UcsChassisIoms) { Section -Style Heading4 -Name 'IO Modules' { #region Chassis IOM Inventory Table $UcsChassisIom = foreach ($Iom in $UcsChassisIoms) { [PSCustomObject]@{ 'Name' = "IO Module $($Iom.Id)" 'Chassis ID' = "$($Iom.ChassisId)" 'Fabric' = $Iom.SwitchId 'Side' = $Iom.Side 'Model' = $Iom.Model 'Serial' = $Iom.Serial 'Discovery' = $Iom.Discovery 'Config State' = $Iom.ConfigState 'Operability' = $Iom.OperState 'Thermal' = $Iom.Thermal 'Presence' = $Iom.Presence 'Running Firmware' = (Get-UcsMgmtController -Ucs $UCSM -Dn "$($Iom.Dn)/mgmt" | Get-UcsFirmwareRunning -Deployment system | Select-Object Version).Version 'Backup Firmware' = (Get-UcsMgmtController -Ucs $UCSM -Dn "$($iom.Dn)/mgmt" | Get-UcsFirmwareUpdatable | Select-Object Version).Version } } $UcsChassisIom | Sort-Object 'Chassis', 'Name' | Table -Name 'IOM Inventory' #endregion Chassis IOM Inventory Table if ($InfoLevel.Equipment.Chassis -ge 3) { #region Chassis IOM Fabric Ports Section $FabricPorts = Get-UcsEtherSwitchIntFIo -Ucs $UCSM | Where-Object { $_.ChassisId -eq "$($Iom.ChassisId)" } if ($FabricPorts) { Section -Style Heading4 -Name 'Fabric Ports' { $IomFabricPorts = foreach ($FabricPort in $FabricPorts) { [PSCustomObject]@{ 'Name' = 'Fabric Port ' + $FabricPort.SlotId + '/' + $FabricPort.PortId 'Oper State' = $FabricPort.OperState 'Port Channel' = $FabricPort.EpDn 'Peer Slot ID' = $FabricPort.PeerSlotId 'Peer Port ID' = $FabricPort.PeerPortId 'Fabric' = $FabricPort.SwitchId 'Peer' = $FabricPort.PeerDn } } $IomFabricPorts | Table -Name 'IOM Fabric Ports' } } #endregion Chassis IOM Fabric Ports Section #region Chassis IOM Backplane Ports Section $BackplanePorts = Get-UcsEtherServerIntFIo -Ucs $UCSM | Where-Object { $_.ChassisId -eq "$($Iom.ChassisId)" } # -and $_.SwitchId -eq "$($Iom.SwitchId)"} $BackplanePorts = $BackplanePorts | Sort-Object { ($_.SlotId) -as [int] }, { ($_.PortId) -as [int] } if ($BackplanePorts) { Section -Style Heading4 -Name 'Backplane Ports' { $IomBackplanePorts = foreach ($BackplanePort in $BackplanePorts) { [PSCustomObject]@{ 'Name' = 'Backplane Port ' + $BackplanePort.SlotId + '/' + $BackplanePort.PortId 'Oper State' = $BackplanePort.OperState 'Port Channel' = $BackplanePort.EpDn 'Fabric' = $BackplanePort.SwitchId 'Peer' = $BackplanePort.PeerDn } } $IomBackplanePorts | Table -Name 'IOM Backplane Ports' } } #endregion Chassis IOM Backplane Ports Section } } } #endregion UCS Chassis IOM Section #region UCS Chassis PSU Section $UcsChassisPSUs = Get-UcsPsu -Chassis $Chassis -Ucs $UCSM if ($UcsChassisPSUs) { Section -Style Heading4 -Name 'PSUs' { $ChassisPSUs = foreach ($UcsChassisPSU in $UcsChassisPSUs) { [PSCustomObject]@{ 'Name' = "PSU $($UcsChassisPSU.Id)" 'ID' = $UcsChassisPSU.Id 'Model' = $UcsChassisPSU.Model 'Power' = $UcsChassisPSU.Power 'Voltage' = $UcsChassisPSU.Voltage 'Performance' = $UcsChassisPSU.Perf 'Thermal' = $UcsChassisPSU.Thermal 'Presence' = $UcsChassisPSU.Presence 'Operability' = $UcsChassisPSU.OperState } } $ChassisPSUs | Sort-Object 'Id', 'Name' | Table -Name "$($Chassis.Rn) PSUs" } } #endregion UCS Chassis PSU Section #region UCS Chassis Blades Section $UcsChassisBlades = Get-UcsBlade -Chassis $Chassis -Ucs $UCSM if ($UcsChassisBlades) { Section -Style Heading4 -Name 'Servers' { $UcsChassisBlade = foreach ($Blade in $UcsChassisBlades) { [PSCustomObject]@{ 'Name' = "Server $($Blade.SlotId)" 'Chassis ID' = $Blade.ChassisID 'Model' = $Blade.Model 'Serial' = $Blade.Serial 'CPUs' = $Blade.NumOfCpus 'Cores' = $Blade.NumOfCores 'Threads' = $Blade.NumOfThreads 'Memory GB' = $Blade.AvailableMemory / 1024 'Adapters' = $Blade.NumOfAdaptors 'NICs' = $Blade.NumOfEthHostIfs 'HBAs' = $Blade.NumOfFcHostIfs 'Power State' = $Blade.OperPower 'Status' = $Blade.OperState 'Assoc State' = $Blade.Association 'Operability' = $Blade.Operability } } $UcsChassisBlade | Sort-Object 'Chassis ID', 'Name' | Table -Name "$($Chassis.Rn) Servers" } } #endregion UCS Chassis Blades Section } } } #endregion UCS Chassis Detailed Section } } } #endregion UCS Chassis Section #region UCS Rack-Mounts Section #TODO: Rack Mounts if ($UcsRackUnit) { if ($InfoLevel.Equipment.RackMounts -ge 1) { Section -Style Heading3 -Name 'Rack-Mounts' { if ($InfoLevel.Equipment.RackMounts -ge 2) { #region FEX Section $UcsFex = Get-UcsFex -Ucs $UCSM if ($UcsFex) { Section -Style Heading4 -Name 'FEX' { foreach ($Fex in $UcsFex) { Section -Style Heading4 -Name "$($Fex.Rn)" { $FabricExtender = [PSCustomObject]@{ 'Name' = $Fex.Rn 'FEX ID' = $Fex.Id 'Model' = $Fex.Model 'Serial' = $Fex.Serial 'Power' = $Fex.Power 'Voltage' = $Fex.Voltage 'Thermal' = $Fex.Thermal 'License State' = $Fex.LicState 'State' = $Fex.AdminState 'Status' = $Fex.OperState 'Operability' = $Fex.Operability } $FabricExtender | Sort-Object 'Name' | Table -List -Name "Fabric Extender $($Fex.Id)" -ColumnWidths 50, 50 $UcsFexFans = Get-UcsFan -Fex $Fex -Ucs $UCSM if ($UcsFexFans) { Section -Style Heading4 -Name 'Fans' { $FexFans = foreach ($UcsFexFan in $UcsFexFans) { [PSCustomObject]@{ 'Name' = "Fan $($UcsFexFan.Id)" 'Module' = $UcsFexFan.Module 'Model' = $UcsFexFan.Model 'Serial' = $UcsFexFan.Serial 'Power' = $UcsFexFan.Power 'Thermal' = $UcsFexFan.Thermal 'Presence' = $UcsFexFan.Presence 'Operability' = $UcsFexFan.OperState } } $FexFans | Sort-Object 'Module', 'Name' | Table -Name "Fabric Extender $($Fex.Id) Fans" } } $UcsFexIoms = Get-UcsIom -Fex $Fex -Ucs $UCSM if ($UcsFexIoms) { Section -Style Heading4 -Name 'IO Modules' { $FexIoms = foreach ($UcsFexIom in $UcsFexIoms) { [PSCustomObject]@{ 'Name' = "IO Module $($UcsFexIom.Id)" 'Fabric' = $UcsFexIom.SwitchId 'Side' = $UcsFexIom.Side 'Model' = $UcsFexIom.Model 'Serial' = $UcsFexIom.Serial 'Discovery' = $UcsFexIom.Discovery 'Config State' = $UcsFexIom.ConfigState 'Operability' = $UcsFexIom.OperState 'Thermal' = $UcsFexIom.Thermal 'Presence' = $UcsFexIom.Presence 'Running Firmware' = (Get-UcsMgmtController -Ucs $UCSM -Dn "$($UcsFexIom.Dn)/mgmt" | Get-UcsFirmwareRunning -Deployment system | Select-Object Version).Version 'Backup Firmware' = (Get-UcsMgmtController -Ucs $UCSM -Dn "$($UcsFexIom.Dn)/mgmt" | Get-UcsFirmwareUpdatable | Select-Object Version).Version } } $FexIoms | Sort-Object 'Name' | Table -Name "Fabric Extender $($Fex.Id) IO Modules" } } $UcsFexPSUs = Get-UcsPsu -Fex $Fex -Ucs $UCSM if ($UcsFexPSUs) { Section -Style Heading4 -Name 'PSUs' { $FexPSUs = foreach ($UcsFexPSU in $UcsFexPSUs) { [PSCustomObject]@{ 'Name' = "PSU $($UcsFexPSU.Id)" 'Model' = $UcsFexPSU.Model 'Power' = $UcsFexPSU.Power 'Voltage' = $UcsFexPSU.Voltage 'Performance' = $UcsFexPSU.Perf 'Thermal' = $UcsFexPSU.Thermal 'Presence' = $UcsFexPSU.Presence 'Operability' = $UcsFexPSU.OperState } } $FexPSUs | Sort-Object 'Name' | Table -Name "Fabric Extender $($Fex.Id) PSUs" } } } } } } #endregion FEX Section #region Rack-Mount Servers if ($UcsRackUnit) { Section -Style Heading4 -Name 'Servers' { $UcsRackMountServers = foreach ($RackUnit in $UcsRackUnit) { [PSCustomObject]@{ 'Name' = "Server $($RackUnit.Id)" 'Model' = $RackUnit.Model 'Serial' = $RackUnit.Serial 'CPUs' = $RackUnit.NumOfCpus 'Cores' = $RackUnit.NumOfCores 'Threads' = $RackUnit.NumOfThreads 'Memory GB' = $RackUnit.AvailableMemory / 1024 'Adapters' = $RackUnit.NumOfAdaptors 'NICs' = $RackUnit.NumOfEthHostIfs 'HBAs' = $RackUnit.NumOfFcHostIfs 'Power State' = $RackUnit.OperPower 'Status' = $RackUnit.OperState 'Assoc State' = $RackUnit.Association 'Operability' = $RackUnit.Operability } } $UcsRackMountServers | Table -Name 'Rack-Mount Servers' } } #endregion Rack-Mount Servers } } } } #endregion UCS Rack-Mounts Section <# #region UCS Server Inventory if ($InfoLevel.Equipment.ServerInventory -ge 1) { Section -Style Heading3 -Name 'Server Inventory' { #region UCS Blade Server Inventory if ($UcsBlade) { Section -Style Heading4 -Name 'Blade Servers' { $UcsBladeInventory = foreach ($Blade in $UcsBlade) { [PSCustomObject]@{ 'Name' = "Server $($Blade.SlotId)" 'Chassis ID' = $Blade.ChassisID 'Model' = $Blade.Model 'Serial' = $Blade.Serial 'CPUs' = $Blade.NumOfCpus 'Cores' = $Blade.NumOfCores 'Threads' = $Blade.NumOfThreads 'Memory GB' = $Blade.AvailableMemory / 1024 'Adapters' = $Blade.NumOfAdaptors 'NICs' = $Blade.NumOfEthHostIfs 'HBAs' = $Blade.NumOfFcHostIfs 'Power State' = $Blade.OperPower 'Status' = $Blade.OperState 'Assoc State' = $Blade.Association 'Operability' = $Blade.Operability } } $UcsBladeInventory | Sort-Object 'Chassis ID', 'Name' | Table -Name 'Server Inventory' } } #endregion UCS Blade Server Inventory #region UCS Rack-Mount Server Inventory if ($UcsRackUnit) { Section -Style Heading4 -Name 'Rack-Mount Servers' { $UcsRackMountInventory = foreach ($RackUnit in $UcsRackUnit) { [PSCustomObject]@{ 'Name' = "Server $($RackUnit.Id)" 'Model' = $RackUnit.Model 'Serial' = $RackUnit.Serial 'CPUs' = $RackUnit.NumOfCpus 'Cores' = $RackUnit.NumOfCores 'Threads' = $RackUnit.NumOfThreads 'Memory GB' = $RackUnit.AvailableMemory / 1024 'Adapters' = $RackUnit.NumOfAdaptors 'NICs' = $RackUnit.NumOfEthHostIfs 'HBAs' = $RackUnit.NumOfFcHostIfs 'Power State' = $RackUnit.OperPower 'Status' = $RackUnit.OperState 'Assoc State' = $RackUnit.Association 'Operability' = $RackUnit.Operability } } $UcsRackMountInventory | Table -Name 'Rack-Mount Servers' } } #endregion UCS Rack-Mount Server Inventory #region UCS Adaptor Inventory $UcsAdaptorUnit = Get-UcsAdaptorUnit -Ucs $UCSM if ($UcsAdaptorUnit) { Section -Style Heading3 -Name 'Server Adaptor Inventory' { $UcsAdaptorInventory = foreach ($AdaptorUnit in $UcsAdaptorUnit) { [PSCustomObject]@{ 'Chassis Id' = $AdaptorUnit.ChassisId 'Blade Id' = $AdaptorUnit.BladeId 'Relative Name' = $AdaptorUnit.Rn 'Model' = $AdaptorUnit.Model } } $UcsAdaptorInventory | Sort-Object 'Chassis Id', 'Blade Id' | Table -Name 'Server Adaptor Inventory' } } #endregion UCS Adaptor Inventory $UcsAdaptorUnitExtn = Get-UcsAdaptorUnitExtn -Ucs $UCSM if ($UcsAdaptorUnitExtn) { Section -Style Heading3 -Name 'Servers with Adaptor Port Expanders' { $UcsAdaptorUnitExtn = $UcsAdaptorUnitExtn | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Model, Presence $UcsAdaptorUnitExtn | Table -Name 'Servers with Adaptor Port Expanders' } } $UcsProcessorUnit = Get-UcsProcessorUnit -Ucs $UCSM if ($UcsProcessorUnit) { Section -Style Heading3 -Name 'Server CPU Inventory' { $UcsProcessorUnit = $UcsProcessorUnit | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, @{L = 'Socket Designation'; E = {$_.SocketDesignation}}, Cores, @{L = 'Cores Enabled'; E = {$_.CoresEnabled}}, Threads, Speed, @{L = 'Operability'; E = {$_.OperState}}, Thermal, Model | Where-Object {$_.OperState -ne 'removed'} $UcsProcessorUnit | Table -Name 'Server CPU Inventory' } } $UcsMemoryUnit = Get-UcsMemoryUnit -Ucs $UCSM if ($UcsMemoryUnit) { Section -Style Heading3 -Name 'Server Memory Inventory' { $UcsMemoryUnit = $UcsMemoryUnit | Sort-Object Dn, Location | Where-Object {$_.Capacity -ne 'unspecified'} | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Location, Capacity, Clock, @{L = 'Operability'; E = {$_.OperState}}, Model $UcsMemoryUnit | Table -Name 'Server Memory Inventory' } } $UcsStorageController = Get-UcsStorageController -Ucs $UCSM if ($UcsStorageController) { Section -Style Heading3 -Name 'Server Storage Controller Inventory' { $UcsStorageController = $UcsStorageController | Sort-Object Dn | Select-Object Vendor, Model $UcsStorageController | Table -Name 'Server Storage Controller Inventory' } } $UcsStorageLocalDisk = Get-UcsStorageLocalDisk -Ucs $UCSM if ($UcsStorageLocalDisk) { Section -Style Heading3 -Name 'Server Local Disk Inventory' { $UcsStorageLocalDisk = $UcsStorageLocalDisk | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Model, Size, Serial | Where-Object {$_.Size -ne 'unknown'} $UcsStorageLocalDisk | Table -Name 'Server Storage Controller Inventory' } } } } #endregion UCS Server Inventory #> #region UCS Policies Section if ($InfoLevel.Equipment.Policies -ge 1) { #region Global Policies Section -Style Heading3 -Name 'Global Policies' { #region Chassis/FEX Discovery Policy Section $UcsChassisDiscoveryPolicy = Get-UcsChassisDiscoveryPolicy -Ucs $UCSM if ($UcsChassisDiscoveryPolicy) { Section -Style Heading4 -Name 'Chassis/FEX Discovery Policy' { $UcsChassisFexDiscoveryPolicy = [PSCustomObject]@{ 'Action' = $UcsChassisDiscoveryPolicy.Action 'Link Aggregation Preference' = $UcsChassisDiscoveryPolicy.LinkAggregationPref 'Backplane Speed Preference' = $UcsChassisDiscoveryPolicy.BackplaneSpeedPref } $UcsChassisFexDiscoveryPolicy | Table -List -Name 'Chassis/FEX Discovery Policy' -ColumnWidths 50, 50 } } #endregion Chassis/FEX Discovery Policy Section #region Rack Server Discovery Policy Section $UcsRackServerDiscPolicy = Get-UcsRackServerDiscPolicy -Ucs $UCSM if ($UcsRackServerDiscPolicy) { Section -Style Heading4 -Name 'Rack Server Discovery Policy' { $UcsRackServerDiscoveryPolicy = [PSCustomObject]@{ 'Action' = $UcsRackServerDiscPolicy.Action 'Scrub Policy' = Switch ($UcsRackServerDiscPolicy.ScrubPolicyName) { '' { 'not set' } default { $UcsRackServerDiscPolicy.ScrubPolicyName } } } $UcsRackServerDiscoveryPolicy | Table -List -Name 'Rack Server Discovery Policy' -ColumnWidths 50, 50 } } #endregion Rack Server Discovery Policy Section #region Rack Management Connection Policy Section #TODO #endregion Rack Management Connection Policy Section #region Power Policy Section $UcsPowerControlPolicy = Get-UcsPowerControlPolicy -Ucs $UCSM if ($UcsPowerControlPolicy) { Section -Style Heading4 -Name 'Power Policy' { $UcsPowerControlPol = [PSCustomObject]@{ 'Redundancy' = $UcsPowerControlPolicy.Redundancy } $UcsPowerControlPol | Sort-Object 'Chassis' | Table -List -Name 'Power Policy' -ColumnWidths 50, 50 } } #endregion Power Policy Section #region Global Power Allocation Policy Section $UcsPowerMgmtPolicy = Get-UcsPowerMgmtPolicy -Ucs $UCSM if ($UcsPowerMgmtPolicy) { Section -Style Heading4 -Name 'Global Power Allocation Policy' { $UcsGlobalPowerPolicy = [PSCustomObject]@{ 'Allocation Method' = Switch ($UcsPowerMgmtPolicy.Style) { 'intelligent-policy-driven' { 'Policy Driven Chassis Group Cap' } 'manual-per-blade' { 'Manual Blade Level Cap' } } } $UcsGlobalPowerPolicy | Table -List -Name 'Global Power Allocation Policy' -ColumnWidths 50, 50 } } #endregion Global Power Allocation Policy Section } #endregion Global Policies Section } #endregion UCS Policies Section <# Section -Style Heading3 -Name 'Firmware' { $UcsFirmware = Get-UcsFirmwareRunning if ($UcsFirmware) { Section -Style Heading2 -Name 'Firmware Management' { Section -Style Heading3 -Name 'UCS Manager' { $UcsmFirmware = $UcsFirmware | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Type, Version | Sort-Object Dn | Where-Object {$_.Type -eq 'mgmt-ext'} $UcsmFirmware | Table -Name 'UCS Manager Firmware' } Section -Style Heading3 -Name 'Fabric Interconnect' { $UcsFiFirmware = $UcsFirmware | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Type, Version | Sort-Object Dn | Where-Object {$_.Type -eq 'switch-kernel' -OR $_.Type -eq 'switch-software'} $UcsFiFirmware | Table -Name 'Fabric Interconnect Firmware' } Section -Style Heading3 -Name 'IOM' { $UcsIomFiFirmware = $UcsFirmware | Sort-Object Dn | Select-Object Deployment, @{L = 'Distinguished Name'; E = {$_.Dn}}, Type, Version | Where-Object {$_.Type -eq 'iocard'} | Where-Object -FilterScript {$_.Deployment -notlike 'boot-loader'} $UcsIomFiFirmware | Table -Name 'IOM Firmware' } Section -Style Heading3 -Name 'Server Adapters' { $UcsServerAdapterFirmware = $UcsFirmware | Sort-Object Dn | Select-Object Deployment, @{L = 'Distinguished Name'; E = {$_.Dn}}, Type, Version | Where-Object {$_.Type -eq 'adaptor'} | Where-Object -FilterScript {$_.Deployment -notlike 'boot-loader'} $UcsServerAdapterFirmware | Table -Name 'Server Adapter Firmware' } Section -Style Heading3 -Name 'Server CIMC' { $UcsServerCimcFirmware = $UcsFirmware | Sort-Object Dn | Select-Object Deployment, @{L = 'Distinguished Name'; E = {$_.Dn}}, Type, Version | Where-Object {$_.Type -eq 'blade-controller'} | Where-Object -FilterScript {$_.Deployment -notlike 'boot-loader'} $UcsServerCimcFirmware | Table -Name 'Server CIMC Firmware' } Section -Style Heading3 -Name 'Server BIOS' { $UcsServerBios = $UcsFirmware | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Type, Version | Where-Object {$_.Type -eq 'blade-bios'} $UcsServerBios | Table -Name 'Server BIOS' } Section -Style Heading3 -Name 'Host Firmware Packages' { $UcsFirmwareComputeHostPack = Get-UcsFirmwareComputeHostPack | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Name, @{L = 'Blade Bundle Version'; E = {$_.BladeBundleVersion}}, @{L = 'Rack Bundle Version'; E = {$_.RackBundleVersion}} $UcsFirmwareComputeHostPack | Table -Name 'Host Firmware Packages' } } } } #> } } #endregion Equipment Section #region Servers Section if ($Section.Servers) { Section -Style Heading2 -Name 'Servers' { #region Service Profiles $UcsServiceProfiles = Get-UcsServiceProfile | Where-Object { $_.Type -eq 'instance' } | Sort-Object Name if ($UcsServiceProfiles) { #region Service Profiles Section Section -Style Heading3 -Name 'Service Profiles' { foreach ($ServiceProfile in $UcsServiceProfiles) { Section -Style Heading4 -Name "$($ServiceProfile.Name)" { $ServiceProfiles = [PSCustomObject]@{ 'Name' = $ServiceProfile.Name 'User Label' = $ServiceProfile.UsrLbl 'Description' = $ServiceProfile.Descr 'Distinguished Name' = $ServiceProfile.Dn 'Unique Identifier' = $ServiceProfile.Uuid 'UUID Pool' = $ServiceProfile.IdentPoolName 'Associated Server' = $ServiceProfile.PnDn 'Service Profile Template' = $ServiceProfile.SrcTemplName 'Associated State' = $ServiceProfile.AssocState 'Assigned State' = $ServiceProfile.ConfigState 'Status' = $ServiceProfile.OperState 'Boot Policy Name' = Switch ($ServiceProfile.BootPolicyName) { '' { 'not set' } default { $ServiceProfile.BootPolicyName } } 'Host Firmware Policy Name' = Switch ($ServiceProfile.HostFwPolicyName) { '' { 'not set' } default { $ServiceProfile.HostFwPolicyName } } 'IPMI Access Profile Policy' = Switch ($ServiceProfile.MgmtAccessPolicyName) { '' { 'not set' } default { $ServiceProfile.MgmtAccessPolicyName } } 'Local Disk Policy Name' = Switch ($ServiceProfile.LocalDiskPolicyName) { '' { 'not set' } default { $ServiceProfile.LocalDiskPolicyName } } 'Maintenance Policy Name' = Switch ($ServiceProfile.MaintPolicyName) { '' { 'not set' } default { $ServiceProfile.MaintPolicyName } } 'Power Control Policy' = Switch ($ServiceProfile.PowerPolicyName) { '' { 'not set' } default { $ServiceProfile.PowerPolicyName } } 'Scrub Policy' = Switch ($ServiceProfile.ScrubPolicyName) { '' { 'not set' } default { $ServiceProfile.ScrubPolicyName } } 'Stats Policy' = Switch ($ServiceProfile.StatsPolicyName) { '' { 'not set' } default { $ServiceProfile.StatsPolicyName } } 'KVM Management Policy' = Switch ($ServiceProfile.KvmMgmtPolicyName) { '' { 'not set' } default { $ServiceProfile.KvmMgmtPolicyName } } 'Power Sync Policy' = Switch ($ServiceProfile.PowerSyncPolicyName) { '' { 'not set' } default { $ServiceProfile.PowerSyncPolicyName } } 'Graphics Card Policy' = Switch ($ServiceProfile.GraphicsCardPolicyName) { '' { 'not set' } default { $ServiceProfile.GraphicsCardPolicyName } } } $ServiceProfiles | Table -List -Name "$($ServiceProfile.Name) Service Profile" -ColumnWidths 50, 50 } } } #endregion Service Profiles Section } #endregion Service Profiles #region Service Profile Templates $UcsServiceProfileTemplates = Get-UcsServiceProfile | Where-Object { $_.Type -ne 'instance' } | Sort-Object Name if ($UcsServiceProfileTemplates) { #region Service Profile Templates Section Section -Style Heading3 -Name 'Service Profile Templates' { foreach ($ServiceProfileTemplate in $UcsServiceProfileTemplates) { Section -Style Heading4 -Name "$($ServiceProfileTemplate.Name)" { $ServiceProfileTemplates = [PSCustomObject]@{ 'Name' = $ServiceProfileTemplate.Name 'User Label' = $ServiceProfileTemplate.UsrLbl 'Description' = $ServiceProfileTemplate.Descr 'Distinguished Name' = $ServiceProfileTemplate.Dn 'Unique Identifier' = $ServiceProfileTemplate.Uuid 'UUID Pool' = $ServiceProfileTemplate.IdentPoolName 'Associated Server' = $ServiceProfileTemplate.PnDn 'Service Profile Template' = $ServiceProfileTemplate.SrcTemplName 'Associated State' = $ServiceProfileTemplate.AssocState 'Assigned State' = $ServiceProfileTemplate.ConfigState 'Status' = $ServiceProfileTemplate.OperState 'Boot Policy Name' = $ServiceProfileTemplate.BootPolicyName 'Host Firmware Policy Name' = $ServiceProfileTemplate.HostFwPolicyName 'IPMI Access Profile Policy' = $ServiceProfileTemplate.MgmtAccessPolicyName 'Local Disk Policy Name' = $ServiceProfileTemplate.LocalDiskPolicyName 'Maintenance Policy Name' = $ServiceProfileTemplate.MaintPolicyName 'Power Control Policy' = $ServiceProfileTemplate.PowerPolicyName 'Scrub Policy' = $ServiceProfileTemplate.ScrubPolicyName 'Stats Policy' = $ServiceProfileTemplate.StatsPolicyName 'KVM Management Policy' = $ServiceProfileTemplate.KvmMgmtPolicyName 'Power Sync Policy' = $ServiceProfileTemplate.PowerSyncPolicyName 'Graphics Card Policy' = $ServiceProfileTemplate.GraphicsCardPolicyName } $ServiceProfileTemplates | Table -List -Name "$($ServiceProfileTemplate.Name) Service Profile Template" -ColumnWidths 50, 50 } } } #endregion Service Profile Templates Section } #endregion Service Profile Templates #region Server Policies Section Section -Style Heading2 -Name 'Policies' { Section -Style Heading3 -Name 'Adapter Policies' { #region Ethernet Adapter Policy $UcsEthAdapterPolicy = Get-UcsEthAdapterPolicy -Ucs $UCSM if ($UcsEthAdapterPolicy) { Section -Style Heading4 -Name 'Ethernet Adapter Policies' { $EthAdapterPolicies = foreach ($EthAdapterPolicy in $UcsEthAdapterPolicy) { [PSCustomObject]@{ 'Name' = $EthAdapterPolicy.Name 'Distinguished Name' = $EthAdapterPolicy.Dn 'Description' = $EthAdapterPolicy.Descr 'Owner' = $EthAdapterPolicy.PolicyOwner } } $EthAdapterPolicies | Sort-Object 'Name', 'Distinguished Name' | Table -Name 'Ethernet Adapter Policies' } } #endregion Ethernet Adapter Policy #region iSCSI Adapter Policy $UcsiScsiAdapterPolicy = Get-UcsIScsiAdapterPolicy -Ucs $UCSM if ($UcsiScsiAdapterPolicy) { Section -Style Heading4 -Name 'iSCSI Adapter Policies' { $iScsiAdapterPolicies = foreach ($iScsiAdapterPolicy in $UcsiScsiAdapterPolicy ) { [PSCustomObject]@{ 'Name' = $iScsiAdapterPolicy.Name 'Distinguished Name' = $iScsiAdapterPolicy.Dn 'Description' = $iScsiAdapterPolicy.Descr 'Owner' = $iScsiAdapterPolicy.PolicyOwner } } $iScsiAdapterPolicies | Sort-Object 'Name', 'Distinguished Name' | Table -Name 'iSCSI Adapter Policies' } } #endregion iSCSI Adapter Policy #region Fibre Channel Adapter Policy $UcsFcAdapterPolicy = Get-UcsFcAdapterPolicy -Ucs $UCSM if ($UcsFcAdapterPolicy) { Section -Style Heading4 -Name 'Fibre Channel Adapter Policies' { $FcAdapterPolicies = foreach ($FcAdapterPolicy in $UcsFcAdapterPolicy) { [PSCustomObject]@{ 'Name' = $FcAdapterPolicy.Name 'Distinguished Name' = $FcAdapterPolicy.Dn 'Description' = $FcAdapterPolicy.Descr 'Owner' = $FcAdapterPolicy.PolicyOwner } } $FcAdapterPolicies | Sort-Object 'Name', 'Distinguished Name' | Table -Name 'Fibre Channel Adapter Policies' } } #endregion Fibre Channel Adapter Policy } #region BIOS Policies $UcsBiosPolicy = Get-UcsBiosPolicy -Ucs $UCSM if ($UcsBiosPolicy) { Section -Style Heading3 -Name 'BIOS Policies' { $UcsBiosPolicies = foreach ($BiosPolicy in $UcsBiosPolicy) { [PSCustomObject]@{ 'Name' = $BiosPolicy.Name 'Distinguished Name' = $BiosPolicy.Dn 'Description' = $BiosPolicy.Descr 'Owner' = $BiosPolicy.PolicyOwner 'Reboot on BIOS Settings Change' = $BiosPolicy.RebootOnUpdate } } $UcsBiosPolicies | Sort-Object 'Name', 'Distinguished Name' | Table -Name 'BIOS Policies' } } <# Section -Style Heading4 -Name 'BIOS Policy Settings' { Get-UcsBiosPolicy | Get-UcsBiosVfQuietBoot | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Vp* | Table -Name 'BIOS Policy VfQuietBoot' Get-UcsBiosPolicy | Get-UcsBiosVfPOSTErrorPause | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Vp* | Table -Name 'BIOS Policy VfPOSTErrorPause' Get-UcsBiosPolicy | Get-UcsBiosVfResumeOnACPowerLoss | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Vp* | Table -Name 'BIOS Policy VfResumeOnACPowerLoss' Get-UcsBiosPolicy | Get-UcsBiosVfFrontPanelLockout | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Vp* | Table -Name 'BIOS Policy VfFrontPanelLockout' Get-UcsBiosPolicy | Get-UcsBiosTurboBoost | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Vp* | Table -Name 'BIOS Policy TurboBoost' Get-UcsBiosPolicy | Get-UcsBiosEnhancedIntelSpeedStep | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Vp* | Table -Name 'BIOS Policy EnhancedIntelSpeedStep' Get-UcsBiosPolicy | Get-UcsBiosHyperThreading | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Vp* | Table -Name 'BIOS Policy HyperThreading' Get-UcsBiosPolicy | Get-UcsBiosVfCoreMultiProcessing | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Vp* | Table -Name 'BIOS Policy VfCoreMultiProcessing' Get-UcsBiosPolicy | Get-UcsBiosExecuteDisabledBit | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Vp* | Table -Name 'BIOS Policy ExecuteDisabledBit' Get-UcsBiosPolicy | Get-UcsBiosVfIntelVirtualizationTechnology | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Vp* | Table -Name 'BIOS Policy VfIntelVirtualizationTechnology' Get-UcsBiosPolicy | Get-UcsBiosVfDirectCacheAccess | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Vp* | Table -Name 'BIOS Policy VfDirectCacheAccess' Get-UcsBiosPolicy | Get-UcsBiosVfProcessorCState | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Vp* | Table -Name 'BIOS Policy VfProcessorCState' Get-UcsBiosPolicy | Get-UcsBiosVfProcessorC1E | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Vp* | Table -Name 'BIOS Policy VfProcessorC1E' Get-UcsBiosPolicy | Get-UcsBiosVfProcessorC3Report | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Vp* | Table -Name 'BIOS Policy VfProcessorC3Report' Get-UcsBiosPolicy | Get-UcsBiosVfProcessorC6Report | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Vp* | Table -Name 'BIOS Policy VfProcessorC6Report' Get-UcsBiosPolicy | Get-UcsBiosVfProcessorC7Report | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Vp* | Table -Name 'BIOS Policy VfProcessorC7Report' Get-UcsBiosPolicy | Get-UcsBiosVfCPUPerformance | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Vp* | Table -Name 'BIOS Policy VfCPUPerformance' Get-UcsBiosPolicy | Get-UcsBiosVfMaxVariableMTRRSetting | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Vp* | Table -Name 'BIOS Policy VfMaxVariableMTRRSetting' Get-UcsBiosPolicy | Get-UcsBiosIntelDirectedIO | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Vp* | Table -Name 'BIOS Policy IntelDirectedIO' Get-UcsBiosPolicy | Get-UcsBiosVfSelectMemoryRASConfiguration | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Vp* | Table -Name 'BIOS Policy VfSelectMemoryRASConfiguration' Get-UcsBiosPolicy | Get-UcsBiosNUMA | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Vp* | Table -Name 'BIOS Policy NUMA' Get-UcsBiosPolicy | Get-UcsBiosLvDdrMode | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Vp* | Table -Name 'BIOS Policy LvDdrMode' Get-UcsBiosPolicy | Get-UcsBiosVfUSBBootConfig | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Vp* | Table -Name 'BIOS Policy VfUSBBootConfig' Get-UcsBiosPolicy | Get-UcsBiosVfUSBFrontPanelAccessLock | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Vp* | Table -Name 'BIOS Policy VfUSBFrontPanelAccessLock' Get-UcsBiosPolicy | Get-UcsBiosVfUSBSystemIdlePowerOptimizingSetting | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Vp* | Table -Name 'BIOS Policy VfUSBSystemIdlePowerOptimizingSetting' Get-UcsBiosPolicy | Get-UcsBiosVfMaximumMemoryBelow4GB | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Vp* | Table -Name 'BIOS Policy VfMaximumMemoryBelow4GB' Get-UcsBiosPolicy | Get-UcsBiosVfMemoryMappedIOAbove4GB | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Vp* | Table -Name 'BIOS Policy VfMemoryMappedIOAbove4GB' Get-UcsBiosPolicy | Get-UcsBiosVfBootOptionRetry | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Vp* | Table -Name 'BIOS Policy VfBootOptionRetry' Get-UcsBiosPolicy | Get-UcsBiosVfIntelEntrySASRAIDModule | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Vp* | Table -Name 'BIOS Policy VfIntelEntrySASRAIDModule' Get-UcsBiosPolicy | Get-UcsBiosVfOSBootWatchdogTimer | Sort-Object Dn | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Vp* | Table -Name 'BIOS Policy VfOSBootWatchdogTimer' } #> #endregion BIOS Policies #region Boot Policies $UcsBootPolicy = Get-UcsBootPolicy -Ucs $UCSM if ($UcsBootPolicy) { Section -Style Heading3 -Name 'Boot Policies' { $UcsBootPolicies = foreach ($BootPolicy in $UcsBootPolicy) { [PSCustomObject]@{ 'Name' = $BootPolicy.Name 'Distinguished Name' = $BootPolicy.Dn 'Description' = $BootPolicy.Descr 'Owner' = $BootPolicy.PolicyOwner 'Reboot on Boot Order Change' = $BootPolicy.RebootOnUpdate 'Enforce vNIC/vHBA/iSCSI Name' = $BootPolicy.EnforceVnicName 'Boot Mode' = $BootPolicy.BootMode } } $UcsBootPolicies | Sort-Object 'Name', 'Distinguished Name' | Table -Name 'Boot Policies' } } #endregion Boot Policies #region Diagnostic Policies $UcsDiagRunPolicy = Get-UcsDiagRunPolicy -Ucs $UCSM if ($UcsDiagRunPolicy) { Section -Style Heading3 -Name 'Diagnostic Policies' { $UcsDiagRunPolicies = foreach ($DiagRunPolicy in $UcsDiagRunPolicy) { [PSCustomObject]@{ 'Name' = $DiagRunPolicy.Name 'Distinguished Name' = $DiagRunPolicy.Dn 'Description' = $DiagRunPolicy.Descr 'Owner' = $DiagRunPolicy.PolicyOwner } } $UcsDiagRunPolicies | Sort-Object 'Name', 'Distinguished Name' | Table -Name 'Diagnostic Policies' } } #endregion Diagnostic Policies #region Graphics Card Policies $UcsComputeGraphicsCardPolicy = Get-UcsComputeGraphicsCardPolicy -Ucs $UCSM if ($UcsComputeGraphicsCardPolicy) { Section -Style Heading3 -Name 'Graphics Card Policies' { $UcsGraphicsCardPolicies = foreach ($ComputeGraphicsCardPolicy in $UcsComputeGraphicsCardPolicy) { [PSCustomObject]@{ 'Name' = $ComputeGraphicsCardPolicy.Name 'Distinguished Name' = $ComputeGraphicsCardPolicy.Dn 'Description' = $ComputeGraphicsCardPolicy.Descr 'Owner' = $ComputeGraphicsCardPolicy.PolicyOwner 'Graphics Card Mode' = $ComputeGraphicsCardPolicy.GraphicsCardMode } } $UcsGraphicsCardPolicies | Sort-Object 'Name', 'Distinguished Name' | Table -Name 'Graphics Card Policies' } } #endregion Graphics Card Policies <# #region Host Firmware Packages Section -Style Heading3 -Name 'Host Firmware Packages' { } #endregion Host Firmware Packages #region IPMI Access Profiles Section -Style Heading3 -Name 'IPMI Access Profiles' { } #endregion IPMI Access Profiles #> #region KVM Management Policies $UcsComputeKvmMgmtPolicy = Get-UcsComputeKvmMgmtPolicy -Ucs $UCSM | Where-Object { $_.Name -ne 'policy' } if ($UcsComputeKvmMgmtPolicy) { Section -Style Heading3 -Name 'KVM Management Policies' { $ComputeKvmMgmtPolicies = foreach ($ComputeKvmMgmtPolicy in $UcsComputeKvmMgmtPolicy) { [PSCustomObject]@{ 'Name' = $ComputeKvmMgmtPolicy.Name 'Distinguished Name' = $ComputeKvmMgmtPolicy.Dn 'Description' = $ComputeKvmMgmtPolicy.Descr 'Owner' = $ComputeKvmMgmtPolicy.PolicyOwner 'vMedia Encryption' = $ComputeKvmMgmtPolicy.VmediaEncryption } } $ComputeKvmMgmtPolicies | Sort-Object 'Name', 'Distinguished Name' | Table -Name 'KVM Management Policies' } } #endregion KVM Management Policies #region Local Disk Config Policies $UcsLocalDiskConfigPolicy = Get-UcsLocalDiskConfigPolicy -Ucs $UCSM if ($UcsLocalDiskConfigPolicy) { Section -Style Heading3 -Name 'Local Disk Config Policies' { $LocalDiskConfigPolicies = foreach ($LocalDiskConfigPolicy in $UcsLocalDiskConfigPolicy) { [PSCustomObject]@{ 'Name' = $LocalDiskConfigPolicy.Name 'Distinguished Name' = $LocalDiskConfigPolicy.Dn 'Description' = $LocalDiskConfigPolicy.Descr 'Owner' = $LocalDiskConfigPolicy.PolicyOwner 'Mode' = $LocalDiskConfigPolicy.Mode 'Protect Configuration' = $LocalDiskConfigPolicy.ProtectConfig 'FlexFlash State' = $LocalDiskConfigPolicy.FlexFlashState 'FlexFlash RAID Reporting State' = $LocalDiskConfigPolicy.FlexFlashRAIDReportingState 'FlexFlash Removable State' = $LocalDiskConfigPolicy.FlexFlashRemovableState } } $LocalDiskConfigPolicies | Sort-Object 'Name', 'Distinguished Name' | Table -Name 'Local Disk Config Policies' } } #endregion Local Disk Config Policies #region Maintenance Policies $UcsMaintenancePolicy = Get-UcsMaintenancePolicy -Ucs $UCSM if ($UcsMaintenancePolicy) { Section -Style Heading3 -Name 'Maintenance Policies' { $MaintenancePolicies = foreach ($MaintenancePolicy in $UcsMaintenancePolicy) { [PSCustomObject]@{ 'Name' = $MaintenancePolicy.Name 'Distinguished Name' = $MaintenancePolicy.Dn 'Description' = $MaintenancePolicy.Descr 'Owner' = $MaintenancePolicy.PolicyOwner 'Soft Shutdown Timer' = $MaintenancePolicy.SoftShutdownTimer 'Storage Config Development Policy' = $MaintenancePolicy.DataDisr 'Reboot Policy' = $MaintenancePolicy.UptimeDisr } } $MaintenancePolicies | Sort-Object 'Name', 'Distinguished Name' | Table -Name 'Maintenance Policies' } } #endregion Maintenance Policies <# #region Management Firmware Packages Section -Style Heading3 -Name 'Management Firmware Packages' { } #endregion Management Firmware Packages #> #region Memory Policy $UcsComputeMemoryConfigPolicy = Get-UcsComputeMemoryConfigPolicy -Ucs $UCSM if ($UcsComputeMemoryConfigPolicy) { Section -Style Heading3 -Name 'Memory Policy' { $ComputeMemoryConfigPolicies = foreach ($ComputeMemoryConfigPolicy in $UcsComputeMemoryConfigPolicy) { [PSCustomObject]@{ 'Name' = $ComputeMemoryConfigPolicy.Name 'Distinguished Name' = $ComputeMemoryConfigPolicy.Dn 'Description' = $ComputeMemoryConfigPolicy.Descr 'Owner' = $ComputeMemoryConfigPolicy.PolicyOwner 'Blacklisting' = $ComputeMemoryConfigPolicy.Blacklisting } } $ComputeMemoryConfigPolicies | Sort-Object 'Name', 'Distinguished Name' | Table -Name 'Memory Policy' } } #endregion Memory Policy #region Power Control Policies $UcsPowerPolicy = Get-UcsPowerPolicy -Ucs $UCSM if ($UcsPowerPolicy) { Section -Style Heading3 -Name 'Power Control Policies' { $PowerPolicies = foreach ($PowerPolicy in $UcsPowerPolicy) { [PSCustomObject]@{ 'Name' = $PowerPolicy.Name 'Distinguised Name' = $PowerPolicy.Dn 'Description' = $PowerPolicy.Descr 'Owner' = $PowerPolicy.PolicyOwner 'Fan Speed Policy' = $PowerPolicy.FanSpeed } } $PowerPolicies | Sort-Object 'Name', 'Distinguished Name' | Table -Name 'Power Control Policies' } } #endregion Power Control Policies #region Power Sync Policies $UcsComputePowerSyncPolicy = Get-UcsComputePowerSyncPolicy -Ucs $UCSM if ($UcsComputePowerSyncPolicy) { Section -Style Heading3 -Name 'Power Sync Policies' { $ComputePowerSyncPolicies = foreach ($ComputePowerSyncPolicy in $UcsComputePowerSyncPolicy) { [PSCustomObject]@{ 'Name' = $ComputePowerSyncPolicy.Name 'Distinguished Name' = $ComputePowerSyncPolicy.Dn 'Description' = $ComputePowerSyncPolicy.Descr 'Owner' = $ComputePowerSyncPolicy.PolicyOwner 'Sync Option' = $ComputePowerSyncPolicy.SyncOption } } $ComputePowerSyncPolicies | Sort-Object 'Name', 'Distinguished Name' | Table -Name 'Power Sync Policies' } } #endregion Power Sync Policies #region Scrub Policies $UcsScrubPolicy = Get-UcsScrubPolicy -Ucs $UCSM | Where-Object { $_.Name -ne 'policy' } if ($UcsScrubPolicy) { Section -Style Heading3 -Name 'Scrub Policies' { $UcsScrubPolicies = foreach ($ScrubPolicy in $UcsScrubPolicy) { [PSCustomObject]@{ 'Name' = $ScrubPolicy.Name 'Distinguished Name' = $ScrubPolicy.Dn 'Description' = $ScrubPolicy.Descr 'Owner' = $ScrubPolicy.PolicyOwner 'Disk Scrub' = $ScrubPolicy.DiskScrub 'BIOS Settings Scrub' = $ScrubPolicy.BiosSettingsScrub 'FlexFlash Scrub' = $ScrubPolicy.FlexFlashScrub } } $UcsScrubPolicies | Sort-Object 'Name', 'Distinguished Name' | Table -Name 'Scrub Policies' } } #endregion Scrub Policies <# #region Serial over LAN Policies Section -Style Heading3 -Name 'Serial over LAN Policies' { } #endregion Serial over LAN Policies #region Server Pool Policies Section -Style Heading3 -Name 'Server Pool Policies' { } #endregion Server Pool Policies #> #region Server Pool Policy Qualifications $UcsServerPoolQualification = Get-UcsServerPoolQualification -Ucs $UCSM if ($UcsServerPoolQualification) { Section -Style Heading3 -Name 'Server Pool Policy Qualifications' { $ServerPoolQualifications = foreach ($ServerPoolQualification in $UcsServerPoolQualification) { [PSCustomObject]@{ 'Name' = $ServerPoolQualification.Name 'Distinguished Name' = $ServerPoolQualification.Dn 'Description' = $ServerPoolQualification.Descr 'Owner' = $ServerPoolQualification.PolicyOwner } } $ServerPoolQualifications | Sort-Object 'Name', 'Distinguished Name' | Table -Name 'Server Pool Policy Qualifications' } } #endregion Server Pool Policy Qualifications <# #region Threshold Policies Section -Style Heading3 -Name 'Threshold Policies' { } #endregion Threshold Policies #region iSCSI Authentication Profiles Section -Style Heading3 -Name 'iSCSI Authentication Profiles' { } #endregion iSCSI Authentication Profiles #region vMedia Policies Section -Style Heading3 -Name 'vMedia Policies' { } #endregion vMedia Policies #> } #endregion Server Policies Section #region Server Pools Section Section -Style Heading2 -Name 'Pools' { #region UUID Pools $UcsUuidSuffixPool = Get-UcsUuidSuffixPool -Ucs $UCSM | Where-Object { $_.Size -gt 0 } if ($UcsUuidSuffixPool) { Section -Style Heading3 -Name 'UUID Suffix Pools' { $UuidSuffixPool = foreach ($UuidPool in $UcsUuidSuffixPool) { $UcsUuidSuffixBlock = Get-UcsUuidSuffixBlock -UuidSuffixPool $UuidPool [PSCustomObject]@{ 'Name' = $UuidPool.Name 'Owner' = $UuidPool.PolicyOwner 'Description' = $UuidPool.Descr 'Size' = $UuidPool.Size 'Assigned' = $UuidPool.Assigned 'Assignment Order' = $UuidPool.AssignmentOrder 'UUID Suffix Blocks' = ($UcsUuidSuffixBlock | Sort-Object From | ForEach-Object { "$($_.From) - $($_.To)" }) -join [Environment]::NewLine } } $UuidSuffixPool | Table -Name 'UUID Suffix Pools' } } #endregion UUID Pools #region UUID Suffixes $UcsUuidPoolAddr = Get-UcsUuidpoolAddr -Ucs $UCSM | Where-Object { $_.Assigned -eq 'yes' } if ($UcsUuidPoolAddr) { Section -Style Heading3 -Name 'UUID Suffixes' { $UuidPoolAddr = foreach ($UuidAddr in $UcsUuidPoolAddr) { [PSCustomObject]@{ 'Name' = $UuidAddr.Id 'Owner' = $UuidAddr.Owner 'Assigned' = $UuidAddr.Assigned 'Assigned To' = $UuidAddr.AssignedToDn } } $UuidPoolAddr | Table -Name 'UUID Suffixes' } } #endregion UUID Suffixes #region Server Pools $UcsServerPool = Get-UcsServerPool -Ucs $UCSM | Where-Object { $_.Size -gt 0 } if ($UcsServerPool) { Section -Style Heading3 -Name 'Server Pools' { $ServerPool = foreach ($Server in $UcsServerPool) { [PSCustomObject]@{ 'Name' = $Server.Name 'Owner' = $Server.PolicyOwner 'Size' = $Server.Size 'Assigned' = $Server.Assigned 'Assignment Order' = $Server.AssignmentOrder } } $ServerPool | Table -Name 'Server Pools' } } #endregion Server Pools #region Server Pool Assignments Section -Style Heading3 -Name 'Server Pool Assignments' { # $UcsComputePooledSlot = Get-UcsComputePooledSlot | Select-Object @{L = 'Distinguished Name'; E = {$_.Dn}}, Rn # $UcsComputePooledSlot | Table -Name 'Server Pool Assignments' } #endregion Server Pool Assignments } #endregion Server Pools Section } } #endregion Servers Section #region LAN Section if ($Section.LAN) { Section -Style Heading2 -Name 'LAN' { #region LAN Cloud Section Section -Style Heading3 -Name 'LAN Cloud' { $UcsLanCloud = Get-UcsLanCloud -Ucs $UCSM if ($UcsLanCloud) { $LanCloud = [PSCustomObject]@{ 'UCS' = $UcsLanCloud.Ucs 'Mode' = $UcsLanCloud.Mode } $LanCloud | Table -Name 'LAN Cloud' -ColumnWidths 50, 50 } #region Port Channels and Uplinks Section $UcsUplinkPortChannel = Get-UcsUplinkPortChannel -Ucs $UCSM if ($UcsUplinkPortChannel) { Section -Style Heading4 -Name 'Port Channels and Uplinks' { $UplinkPortChannel = foreach ($PortChannel in $UcsUplinkPortChannel) { [PSCustomObject]@{ 'Fabric' = $PortChannel.SwitchId 'ID' = $PortChannel.PortId 'Name' = $PortChannel.Name 'Description' = $PortChannel.Descr 'State' = $PortChannel.AdminState 'If Type' = $PortChannel.IfType 'Transport' = $PortChannel.Transport 'Flow Control Policy' = $PortChannel.FlowCtrlPolicy 'LACP Policy' = $PortChannel.LacpPolicyName 'Speed' = $PortChannel.AdminSpeed 'Operational Speed' = "$($PortChannel.Bandwidth)gbps" 'Status' = $PortChannel.OperState } } $UplinkPortChannel | Sort-Object 'Fabric', 'ID' | Table -Name 'Port Channels and Uplinks' BlankLine foreach ($PortChannel in $UcsUplinkPortChannel) { $UcsUplinkPortChannelMember = Get-UcsUplinkPortChannelMember -Ucs $UCSM -UplinkPortChannel $PortChannel $UplinkPortChannelMember = foreach ($PortChannelMember in $UcsUplinkPortChannelMember) { [PSCustomObject]@{ 'Fabric' = $PortChannelMember.SwitchId 'Port' = "$($PortChannelMember.SlotId)/$($PortChannelMember.PortId)" 'Port Channel' = "$($PortChannel.PortId) $($PortChannel.Name)" 'State' = $PortChannelMember.AdminState 'Membership' = $PortChannelMember.Membership 'Transport' = $PortChannelMember.Transport 'Medium' = $PortChannelMember.Type 'If Role' = $PortChannelMember.IfRole 'If Type' = $PortChannelMember.IfType 'Locale' = $PortChannelMember.Locale 'Link Profile' = $PortChannelMember.EthLinkProfileName 'Status' = $PortChannelMember.OperState } } $UplinkPortChannelMembers += $UplinkPortChannelMember } $UplinkPortChannelMembers | Sort-Object 'Fabric', 'Port', 'Port Channel' | Table -Name 'Port Channel Members' } } #endregion Port Channels and Uplinks Section #region VLANs $UcsVlan = Get-UcsVlan | Where-Object { $_.IfRole -eq 'Network' } if ($UcsVlan) { Section -Style Heading4 -Name 'VLANs' { $Vlans = foreach ($Vlan in $UcsVlan) { [PSCustomObject]@{ 'Fabric' = $Vlan.SwitchId 'VLAN Name' = $Vlan.Name 'VLAN ID' = $Vlan.Id 'Native' = $Vlan.DefaultNet 'Type' = $Vlan.Type 'Transport' = $Vlan.Transport 'Locale' = $Vlan.Locale 'Sharing Type' = $Vlan.Sharing 'Multicast Policy Name' = Switch ($Vlan.McastPolicyName) { '' { 'not set' } default { $Vlan.McastPolicyName } } 'Multicast Policy Instance' = $Vlan.OperMcastPolicyName } } $Vlans | Sort-Object 'Fabric', 'VLAN Name' | Table -Name 'VLANs' } } #endregion VLANs #region Server Links $UcsServerLinks = Get-UcsFabricPort -Ucs $UCSM | Where-Object { $_.IfRole -eq 'server' } if ($UcsServerLinks) { Section -Style Heading4 -Name 'Server Links' { $ServerLinks = foreach ($ServerLink in $UcsServerLinks) { [PSCustomObject]@{ 'Fabric' = $ServerLink.SwitchId 'Port' = "$($ServerLink.SlotId)/$($ServerLink.PortId)" 'MAC' = $ServerLink.Mac 'State' = $ServerLink.AdminState 'Chassis ID' = $ServerLink.ChassisId 'Aggregated Port ID' = $ServerLink.AggrPortId 'If Role' = $ServerLink.IfRole 'If Type' = $ServerLink.IfType 'Network Type' = $ServerLink.Type 'Transport' = $ServerLink.Transport -join ', ' 'Speed' = $ServerLink.OperSpeed 'Status' = $ServerLink.OperState } } $ServerLinks | Sort-Object 'Fabric', 'Port' | Table -Name 'Server Links' } } #endregion Server Links #region QoS System Class Section $UcsQosClass = Get-UcsQosClass -Ucs $UCSM | Sort-Object Cos -Descending if ($UcsQosClass) { $UcsFcQosClass = Get-UcsFcQosClass -Ucs $UCSM $UcsBestEffortQosClass = Get-UcsBestEffortQosClass -Ucs $UCSM $UcsQosClass += $UcsBestEffortQosClass $UcsQosClass += $UcsFcQosClass Section -Style Heading4 -Name 'QoS System Class' { $QosClasses = foreach ($QosClass in $UcsQosClass) { [PSCustomObject]@{ 'Priority' = $QosClass.Priority 'Enabled' = $QosClass.AdminState 'CoS' = $QosClass.Cos 'Packet Drop' = Switch ($QosClass.Drop) { 'no-drop' { 'disabled' } 'drop' { 'enabled' } } 'Weight' = $QosClass.Weight 'Weight (%)' = $QosClass.BwPercent 'MTU' = $QosClass.Mtu } } $QosClasses | Table -Name 'QoS System Class' } } #endregion QoS System Class Section #region LAN Pin Groups Section $UcsLanPinGroups = Get-UcsEthernetPinGroup -Ucs $UCSM if ($UcsLanPinGroups) { Section -Style Heading4 -Name 'LAN Pin Groups' { $LanPinGroups = foreach ($LanPinGroup in $UcsLanPinGroups) { $LanPinGroupTarget = Get-UcsEthernetPinGroupTarget -EthernetPinGroup $LanPinGroup [PSCustomObject]@{ 'Name' = $LanPinGroup.Name 'Description' = $LanPinGroup.Descr 'Target Ports' = $LanPinGroupTarget.EpDn -join ', ' } } $LanPinGroups | Sort-Object 'Name' | Table -Name 'LAN Pin Groups' } } #endregion LAN Pin Groups Section } #endregion LAN Cloud Section #region LAN Appliances Section $UcsAppliance = Get-UcsAppliance -Ucs $UCSM if ($UcsAppliance) { Section -Style Heading3 -Name 'Appliances' { } } #endregion LAN Appliances Section #region LAN Policies Section Section -Style Heading3 -Name 'Policies' { #region Global Policies Section $UcsFabricLanCloudPolicy = Get-UcsFabricLanCloudPolicy -Ucs $UCSM if ($UcsFabricLanCloudPolicy) { Section -Style Heading4 -Name 'LAN Global Policies' { $FabricLanCloudPolicy = [PSCustomObject]@{ 'Ethernet Mode' = $UcsFabricLanCloudPolicy.Mode 'MAC Address Table Aging' = $UcsFabricLanCloudPolicy.MacAging 'VLAN Port Count Optimization' = $UcsFabricLanCloudPolicy.VlanCompression } $FabricLanCloudPolicy | Table -List -Name 'LAN Global Policies' -ColumnWidths 50, 50 } } #endregion Global Policies Section <# #region Default vNIC Behavior Policy Section $UcsVnicDefBeh = Get-UcsVnicDefBeh -Ucs $UCSM if ($UcsVnicDefBeh) { Section -Style Heading4 -Name 'Default vNIC Behavior' { } } #endregion Default vNIC Behavior Policy Section #region Flow Control Policy Section $UcsFlowControlPolicy = Get-UcsFlowControlPolicy -Ucs $UCSM if ($UcsFlowControlPolicy) { Section -Style Heading4 -Name 'Flow Control' { } } #endregion Flow Control Policy Section #region Dynamic vNIC Connection Policy Section $UcsDynamicVnicConnPolicy = Get-UcsDynamicVnicConnPolicy -Ucs $UCSM if ($UcsDynamicVnicConnPolicy) { Section -Style Heading4 -Name 'Dynamic vNIC Connection' { } } #endregion Dynamic vNIC Connection Policy Section #> #region LACP Policy Section $UcsFabricLacpPolicy = Get-UcsFabricLacpPolicy -Ucs $UCSM if ($UcsFabricLacpPolicy) { Section -Style Heading4 -Name 'LACP' { $FabricLacpPolicy = foreach ($LacpPolicy in $UcsFabricLacpPolicy) { [PSCustomObject]@{ 'Name' = $LacpPolicy.Name 'Distinguished Name' = $LacpPolicy.Dn 'Owner' = $LacpPolicy.PolicyOwner 'Suspend Individual' = $LacpPolicy.SuspendIndividual 'LACP Rate' = $LacpPolicy.FastTimer } } $FabricLacpPolicy | Sort-Object 'Name', 'Distinguished Name' | Table -Name 'LACP Policies' } } #endregion LACP Policy Section <# #region LAN Connectivity Section Section -Style Heading4 -Name 'LAN Connectivity' { } #endregion LAN Connectivity Section #> #region Link Protocol Policy Section $UcsFabricUdldPolicy = Get-UcsFabricUdldPolicy -Ucs $UCSM if ($UcsFabricUdldPolicy) { Section -Style Heading4 -Name 'Link Protocol' { $FabricUdldPolicy = [PSCustomObject]@{ 'Name' = $UcsFabricUdldPolicy.Name 'Owner' = $UcsFabricUdldPolicy.PolicyOwner 'Message Interval' = $UcsFabricUdldPolicy.MsgInterval 'Recovery Action' = $UcsFabricUdldPolicy.RecoveryAction } $FabricUdldPolicy | Sort-Object 'Name', 'Owner' | Table -Name 'Link Protocol Policies' -ColumnWidths 25, 25, 25, 25 } } #endregion Link Protocol Policy Section #region Multicast Policy Section $UcsFabricMulticastPolicy = Get-UcsFabricMulticastPolicy -Ucs $UCSM if ($UcsFabricMulticastPolicy) { Section -Style Heading4 -Name 'Multicast' { $FabricMulticastPolicy = foreach ($MulticastPolicy in $UcsFabricMulticastPolicy) { [PSCustomObject]@{ 'Name' = $MulticastPolicy.Name 'Owner' = $MulticastPolicy.PolicyOwner 'IGMP Snooping State' = $MulticastPolicy.SnoopingState 'IGMP Snooping Querier State' = $MulticastPolicy.QuerierState 'FI-A Querier IPv4 Address' = $MulticastPolicy.QuerierIpAddr 'FI-B Querier IPv4 Address' = $MulticastPolicy.QuerierIpAddrPeer } } $FabricMulticastPolicy | Sort-Object 'Name', 'Owner' | Table -Name 'Multicast Policies' } } #endregion Multicast Policy Section #region Network Control Policy Section $UcsNetworkControlPolicy = Get-UcsNetworkControlPolicy if ($UcsNetworkControlPolicy) { Section -Style Heading4 -Name 'Network Control' { $NetworkControlPolicy = foreach ($NetControlPolicy in $UcsNetworkControlPolicy) { [PSCustomObject]@{ 'Name' = $NetControlPolicy.Name 'Owner' = $NetControlPolicy.PolicyOwner 'CDP' = $NetControlPolicy.Cdp 'MAC Register Mode' = $NetControlPolicy.MacRegisterMode 'Action on Uplink Fail' = $NetControlPolicy.UplinkFailAction 'LLDP Transmit' = $NetControlPolicy.LldpTransmit 'LLDP Receive' = $NetControlPolicy.LldpReceive } } $NetworkControlPolicy | Sort-Object 'Name', 'Owner' | Table -Name 'Network Control Policies' } } #endregion Network Control Policy Section <# #region QoS Policy Section $UcsQosPolicy = Get-UcsQosPolicy -Ucs $UCSM if ($UcsQosPolicy) { Section -Style Heading4 -Name 'QoS' { } } #endregion QoS Policy Section #region Threshold Policy Section $UcsThresholdPolicy = Get-UcsThresholdPolicy -Ucs $UCSM if ($UcsThresholdPolicy) { Section -Style Heading4 -Name 'Threshold' { $ThresholdPolicy = foreach ($ThresholdPol in $UcsThresholdPolicy) { [PSCustomObject]@{ 'Name' = $ThresholdPol.Name 'Distingushed Name' = $ThresholdPol.Dn 'Description' = $ThresholdPol.Descr 'Owner' = $ThresholdPol.PolicyOwner 'Default Thresholds Added' = $ThresholdPol.DefaultThresholdsAdded } } $ThresholdPolicy | Sort-Object 'Name','Distingushed Name' | Table -Name 'Threshold Policies' } } #endregion Threshold Policy Section #region VMQ Connection Policy Section Section -Style Heading4 -Name 'VMQ Connection' { } #endregion VMQ Connection Policy Section #> #region usNIC Connection Policy Section $UcsVnicUsnicConPolicy = Get-UcsVnicUsnicConPolicy -Ucs $UCSM if ($UcsVnicUsnicConPolicy) { Section -Style Heading4 -Name 'usNIC Connection' { $VnicUsnicConPolicy = foreach ($UsnicConPolicy in $UcsVnicUsnicConPolicy) { [PSCustomObject]@{ 'Name' = $UsnicConPolicy.Name 'Owner' = $UsnicConPolicy.PolicyOwner 'Description' = $UsnicConPolicy.Descr 'Number of usNICs' = $UsnicConPolicy.UsnicCount 'Adapter Policy' = $UsnicConPolicy.AdaptorProfileName } } $VnicUsnicConPolicy | Sort-Object 'Name', 'Owner' | Table -Name 'usNIC Connection Policies' } } #endregion usNIC Connection Policy Section #region vNIC Template Section $UcsVnicTemplate = Get-UcsVnicTemplate -Ucs $UCSM if ($UcsVnicTemplate) { Section -Style Heading4 -Name 'vNIC Templates' { $VnicTemplate = foreach ($Vnic in $UcsVnicTemplate) { [PSCustomObject]@{ 'Name' = $Vnic.Name 'Description' = $Vnic.Descr 'Owner' = $Vnic.PolicyOwner 'Fabric' = Switch ($Vnic.SwitchId) { 'A-B' { 'enable failover' } 'B-A' { 'enable failover' } default { $Vnic.SwitchId } } 'Redundancy Type' = $Vnic.RedundancyPairType 'Target' = $Vnic.Target -join ', ' 'Template Type' = $Vnic.TemplType 'CDN Source' = $Vnic.CdnSource 'MTU' = $Vnic.Mtu 'MAC Pool' = $Vnic.IdentPoolName 'QoS Policy' = Switch ($Vnic.QosPolicyName) { '' { 'not set' } default { $Vnic.QosPolicyName } } 'Network Control Policy' = Switch ($Vnic.NwCtrlPolicyName) { '' { 'not set' } default { $Vnic.NwCtrlPolicyName } } 'Pin Group' = $Vnic.PinToGroupName 'Stats Threshold Policy' = $Vnic.StatsPolicyName 'VLANs' = ($Vnic | Get-UcsChild).Name -join ', ' } } $VnicTemplate | Sort-Object 'Name' | Table -List -Name 'vNIC Templates' -ColumnWidths 50, 50 } } #endregion vNIC Template Section } #endregion LAN Policies Section #region Pools Section Section -Style Heading3 -Name 'Pools' { #region IP Pools Section $UcsIpPool = Get-UcsIpPool -Ucs $UCSM | Where-Object { $_.Size -gt 0 } if ($UcsIpPool) { Section -Style Heading4 -Name 'IP Pools' { $IpPools = foreach ($IpPool in $UcsIpPool) { $UcsIpPoolBlock = Get-UcsIpPoolBlock -IpPool $IpPool [PSCustomObject]@{ 'Name' = $IpPool.Name 'Owner' = $IpPool.PolicyOwner 'Description' = $IpPool.Descr #'GUID' = $IpPool.Guid 'Size' = $IpPool.Size 'Assigned' = $IpPool.Assigned 'Assignment Order' = $IpPool.AssignmentOrder 'IP Blocks' = ($UcsIpPoolBlock | Sort-Object From | ForEach-Object { "$($_.From) - $($_.To)" }) -join [Environment]::NewLine } } $IpPools | Sort-Object 'Name' | Table -Name 'IP Pools' } } #endregion IP Pools Section #region IP Pool Addresses $UcsIpPoolAddr = Get-UcsIpPoolAddr -Ucs $UCSM if ($UcsIpPoolAddr) { Section -Style Heading4 -Name 'IP Pool Addresses' { $IpPoolAddr = foreach ($IpAddr in $UcsIpPoolAddr) { [PSCustomObject]@{ 'IP Address' = $IpAddr.Id 'Owner' = $IpAddr.Owner 'Assigned' = $IpAddr.Assigned 'Assigned To' = $IpAddr.AssignedToDn } } $IpPoolAddr | Sort-Object 'IP Address' | Table -Name 'IP Pool Addresses' } } #endregion IP Pool Addresses #region MAC Pools Section $UcsMacPool = Get-UcsMacPool -Ucs $UCSM | Where-Object { $_.Size -gt 0 } if ($UcsMacPool) { Section -Style Heading4 -Name 'MAC Pools' { $MacPools = foreach ($MacPool in $UcsMacPool) { $UcsMacPoolBlock = Get-UcsMacMemberBlock -MacPool $MacPool [PSCustomObject]@{ 'Name' = $MacPool.Name 'Owner' = $MacPool.PolicyOwner 'Description' = $MacPool.Descr 'Size' = $MacPool.Size 'Assigned' = $MacPool.Assigned 'Assignment Order' = $MacPool.AssignmentOrder 'MAC Blocks' = ($UcsMacPoolBlock | Sort-Object From | ForEach-Object { "$($_.From) - $($_.To)" }) -join [Environment]::NewLine } } $MacPools | Sort-Object 'Name' | Table -Name 'MAC Pools' } } #endregion MAC Pools Section #region MAC Pool Addresses $UcsMacPoolAddr = Get-UcsMacPoolAddr -Ucs $UCSM | Where-Object { $_.Assigned -eq 'yes' } if ($UcsMacPoolAddr) { Section -Style Heading4 -Name 'MAC Pool Addresses' { $MacPoolAddr = foreach ($MacAddr in $UcsMacPoolAddr) { [PSCustomObject]@{ 'MAC Address' = $MacAddr.Id 'Owner' = $MacAddr.Owner 'Assigned' = $MacAddr.Assigned 'Assigned To' = $MacAddr.AssignedToDn } } $MacPoolAddr | Sort-Object 'MAC Address' | Table -Name 'MAC Pool Addresses' } } #endregion MAC Pool Addresses } #endregion Pools Section } } #endregion LAN Section #region SAN Section if ($Section.SAN) { Section -Style Heading2 -Name 'SAN' { #region SAN Cloud Section Section -Style Heading3 -Name 'SAN Cloud' { $UcsSanCloud = Get-UcsSanCloud -Ucs $UCSM if ($UcsSanCloud) { $SanCloud = [PSCustomObject]@{ 'UCS' = $UcsSanCloud.Ucs 'Mode' = $UcsSanCloud.Mode } $SanCloud | Table -Name 'SAN Cloud' -ColumnWidths 50, 50 } #region FC Port Channels $UcsFcUplinkPortChannel = Get-UcsFcUplinkPortChannel -Ucs $UCSM if ($UcsFcUplinkPortChannel) { Section -Style Heading4 -Name 'FC Port Channels' { $FcUplinkPortChannel = foreach ($FcPortChannel in $UcsFcUplinkPortChannel) { [PSCustomObject]@{ 'Fabric' = $FcPortChannel.SwitchId 'Port ID' = $FcPortChannel.PortId 'Name' = $FcPortChannel.Name 'Description' = $FcPortChannel.Descr 'If Type' = $FcPortChannel.IfType 'Transport' = $FcPortChannel.Transport 'Admin Speed' = $FcPortChannel.AdminSpeed 'Operational Speed Gbps' = $FcPortChannel.OperSpeed #'Ports' 'Status' = $FcPortChannel.OperState } } $FcUplinkPortChannel | Sort-Object 'Fabric' | Table -Name 'FC Port Channels' } } #endregion FC Port Channels #region FC Port Channels $UcsFabricFcoeSanPc = Get-UcsFabricFcoeSanPc -Ucs $UCSM if ($UcsFabricFcoeSanPc) { Section -Style Heading4 -Name 'FCoE Port Channels' { } } #endregion FC Port Channels #region Uplink FC Interfaces $UcsFiFcPort = Get-UcsFiFcPort -Ucs $UCSM if ($UcsFiFcPort) { Section -Style Heading4 -Name 'Uplink FC Interfaces' { $FiFcPorts = foreach ($FcPort in $UcsFiFcPort) { [PSCustomObject]@{ 'Fabric' = $FcPort.SwitchId 'Port' = "$($FcPort.SlotId)/$($FcPort.PortId)" 'WWN' = $FcPort.wwn 'Unified Port' = $FcPort.UnifiedPort 'Port Channel Member' = $FcPort.IsPortChannelMember 'State' = $FcPort.AdminState 'If Role' = $FcPort.IfRole 'If Type' = $FcPort.IfType 'Network Type' = $FcPort.Type 'Transport' = $FcPort.Transport -join ', ' 'Speed' = $FcPort.OperSpeed 'Status' = $FcPort.OperState } } $FiFcPorts | Sort-Object 'Fabric', 'Port' | Table -Name 'Uplink FC Interfaces' } } #endregion Uplink FC Interfaces #region Uplink FCoE Interfaces $UcsFabricPort = Get-UcsFabricPort -Ucs $UCSM | Where-Object { $_.IfRole -eq 'fcoe-uplink' } if ($UcsFabricPort) { Section -Style Heading4 -Name 'Uplink FCoE Interfaces' { } } #endregion Uplink FCoE Interfaces #region VSANs $UcsVsan = Get-UcsVsan -Ucs $UCSM if ($UcsVsan) { Section -Style Heading4 -Name 'VSANs' { $Vsans = foreach ($Vsan in $UcsVsan) { [PSCustomObject]@{ 'Name' = $Vsan.Name 'ID' = $Vsan.Id 'Fabric' = $Vsan.SwitchId 'If Type' = $Vsan.IfType 'If Role' = $Vsan.IfRole 'Transport' = $Vsan.Transport 'FCoE VLAN' = $Vsan.FcoeVlan 'FC Zoning' = $Vsan.ZoningState 'Default FC Zoning' = $Vsan.DefaultZoning 'FC Zone Sharing Mode' = $Vsan.FcZoneSharingMode 'Status' = $Vsan.OperState } } $Vsans | Sort-Object 'Fabric', 'Name', 'ID' | Table -Name 'VSANs' } } #endregion VSANs } #endregion SAN Cloud Section <# ##TODO Section -Style Heading3 -Name 'Storage Cloud' { Section -Style Heading4 -Name 'Storage FC Interfaces' { } Section -Style Heading4 -Name 'Storage FCoE Interfaces' { } Section -Style Heading4 -Name 'FC Zone Profiles' { } } #> #region SAN Policies Section Section -Style Heading3 -Name 'Policies' { #region Default vHBA Behavior $UcsVnicVhbaBehPolicy = Get-UcsVnicVhbaBehPolicy -Ucs $UCSM if ($UcsVnicVhbaBehPolicy) { Section -Style Heading4 -Name 'Default vHBA Behavior' { $VhbaBehPolicy = foreach ($VhbaPolicy in $UcsVnicVhbaBehPolicy) { [PSCustomObject]@{ 'Name' = $VhbaPolicy.Name 'Distinguished Name' = $VhbaPolicy.Dn 'Description' = $VhbaPolicy.Descr 'Type' = $VhbaPolicy. 'Action' = $VhbaPolicy.Action } } $VhbaBehPolicy | Sort-Object 'Name', 'Distinguished Name' | Table -Name 'Default vHBA Behavior' } } #endregion Default vHBA Behavior #region Fibre Channel Adapter Policy $UcsFcAdapterPolicy = Get-UcsFcAdapterPolicy -Ucs $UCSM if ($UcsFcAdapterPolicy) { Section -Style Heading4 -Name 'Fibre Channel Adapter Policies' { $FcAdapterPolicies = foreach ($FcAdapterPolicy in $UcsFcAdapterPolicy) { [PSCustomObject]@{ 'Name' = $FcAdapterPolicy.Name 'Distinguished Name' = $FcAdapterPolicy.Dn 'Description' = $FcAdapterPolicy.Descr 'Owner' = $FcAdapterPolicy.PolicyOwner } } $FcAdapterPolicies | Sort-Object 'Name', 'Distinguished Name' | Table -Name 'Fibre Channel Adapter Policies' } } #endregion Fibre Channel Adapter Policy #region LACP Policy Section $UcsFabricLacpPolicy = Get-UcsFabricLacpPolicy -Ucs $UCSM if ($UcsFabricLacpPolicy) { Section -Style Heading4 -Name 'LACP' { $FabricLacpPolicy = foreach ($LacpPolicy in $UcsFabricLacpPolicy) { [PSCustomObject]@{ 'Name' = $LacpPolicy.Name 'Distinguished Name' = $LacpPolicy.Dn 'Owner' = < |