Advertisement
|
[x]
Attachment Details
|
||
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: |
# Created: 18/11/2006
# Updated: 11/06/2007
# Author : Peter Stone
# Website: http://www.newgrove.co.nz/stuff
# Purpose: To extract inventory data from a workstation and write it to an HTML file at C:\
#########################################################################################################
# GET THE DATE/TIME
$strDate = get-date f "yyyy-MM-dd HH:mm:ss"
# Get the values for the local host...
$strComputer = "."
# Assign the contents of a WMI class and namespace to an array (collection)
$colItems = get-wmiobject -class "Win32_Processor" -namespace "root\CIMV2" `
-computername $strComputer | sort-object -descending "WorkingSetSize"
# EXTRACT THE HOSTNAME (before getting the rest of the data)
# (Will revisit this namespace later in the script to get other values...)
$cnt = 0
foreach ($objItem in $colItems) {
# Each line in this array represents the data returned for each processor
# even if the processor is threaded and more than one line is returned,
# the comparison and $cnt variable limit the output to one row per workstation.
if ($cnt -eq 0) {
$strHostName = $objItem.SystemName
}
$cnt++
}
# ASSIGN FILE PATH TO THE OUTPUT FILE (using the Hostname)
$htmlFilePath = "C:\" + $strHostName + ".html"
# Write to screen
write-host "System Name: " $strHostName
write-host "Data collected: " $strDate
write-host
# Create and write HTML to file
$strOutputString = "<p><font size=3>" # Initalise the file by writing the first line
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii # (NOTE: Not using the -append argument)
$strOutputString = "Host: <font size=4 color=darkblue><strong>" + $strHostName + "</strong></font><br>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutputString = "Date: <strong>" + $strdate + "</strong><br>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutputString = "</font></p>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
# HARVEST THE DATA
#########################################################################################################
# Write Subtitle to screen
write-host
write-host "Chassis Information . . ." -foregroundcolor "magenta"
# Write Subtitle to HTML
$strOutputString = "<p>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutputString = "<strong><font size=3 color=red>Computer Chassis Information: </font></strong><br>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutputString = "<font size=3>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$colItems = get-wmiobject -class "Win32_SystemEnclosure" -namespace "root\CIMV2" `
-computername $strComputer
foreach ($objItem in $colItems) {
# Write to screen
write-host "Manufacturer: " $objItem.Manufacturer
write-host "Serial Number: " $objItem.SerialNumber
#write-host "SMBIOS Asset Tag: " $objItem.SMBIOSAssetTag
write-host
# Create HTML Output
$strOutPut01 = "Manufacturer: <strong>" + $objItem.Manufacturer + "</strong><br>"
$strOutPut02 = "Serial Number: <strong>" + $objItem.SerialNumber + "</strong><br>"
#$strOutPut03 = "SMBIOS Asset Tag: <strong>" + $objItem.SMBIOSAssetTag + "</strong><br>"
# Write HTML to File
$strOutPut01 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut02 | out-file -filepath $htmlFilePath -encoding ascii -append
#$strOutPut03 | out-file -filepath $htmlFilePath -encoding ascii -append
}
$strOutputString = "</font></p>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
#########################################################################################################
#########################################################################################################
# Write Subtitle to screen
write-host
write-host "Network Adapter Configuration Properties . . ." -foregroundcolor "magenta"
# Write Subtitle to HTML
$strOutputString = "<p>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutputString = "<strong><font size=3 color=red>Network Adapter Configuration Properties: </font></strong><br>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutputString = "<font size=3>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$colItems = get-wmiobject -class "Win32_NetworkAdapterConfiguration" -namespace "root\CIMV2" `
-computername $strComputer
foreach ($objItem in $colItems) {
# A test is needed here as the loop will find a number of virtual network configurations with no "Hostname"
# So if the "Hostname" does not exist, do NOT display it!
if ($objItem.DNSHostName -ne $NULL) {
# Write to screen
#write-host "Caption: " $objItem.Caption
write-host "Default IP Gateway: " $objItem.DefaultIPGateway
write-host "Description: " $objItem.Description
write-host "DHCP Enabled: " $objItem.DHCPEnabled
write-host "DHCP Lease Expires: " $objItem.DHCPLeaseExpires
write-host "DHCP Lease Obtained: " $objItem.DHCPLeaseObtained
write-host "DHCP Server: " $objItem.DHCPServer
write-host "DNS Domain: " $objItem.DNSDomain
write-host "DNS Domain Suffix Search Order: " $objItem.DNSDomainSuffixSearchOrder
write-host "DNS Enabled For WINS Resolution: " $objItem.DNSEnabledForWINSResolution
write-host "DNS Host Name: " $objItem.DNSHostName
write-host "DNS Server Search Order: " $objItem.DNSServerSearchOrder
write-host "Domain DNS Registration Enabled: " $objItem.DomainDNSRegistrationEnabled
#write-host "Forward Buffer Memory: " $objItem.ForwardBufferMemory
write-host "Full DNS Registration Enabled: " $objItem.FullDNSRegistrationEnabled
#write-host "Index: " $objItem.Index
write-host "IP Address: " $objItem.IPAddress
write-host "MAC Address: " $objItem.MACAddress
write-host "WINS Enable LMHosts Lookup: " $objItem.WINSEnableLMHostsLookup
#write-host "WINS Host Lookup File: " $objItem.WINSHostLookupFile
write-host "WINS Primary Server: " $objItem.WINSPrimaryServer
#write-host "WINS Scope ID: " $objItem.WINSScopeID
write-host "WINS Secondary Server: " $objItem.WINSSecondaryServer
write-host
$ipaddress = $objItem.IPAddress
# Create HTML Output
#$strOutPut01 = "Caption: <strong>" + $objItem.Caption + "</strong><br>"
$strOutPut02 = "Default IP Gateway: <strong>" + $objItem.DefaultIPGateway + "</strong><br>"
$strOutPut03 = "Description: <strong>" + $objItem.Description + "</strong><br>"
$strOutPut04 = "DHCP Enabled: <strong>" + $objItem.DHCPEnabled + "</strong><br>"
$strOutPut05 = "DHCP Lease Expires: <strong>" + $objItem.DHCPLeaseExpires + "</strong><br>"
$strOutPut06 = "DHCP Lease Obtained: <strong>" + $objItem.DHCPLeaseObtained + "</strong><br>"
$strOutPut07 = "DHCP Server: <strong>" + $objItem.DHCPServer + "</strong><br>"
$strOutPut08 = "DNS Domain: <strong>" + $objItem.DNSDomain + "</strong><br>"
$strOutPut09 = "DNS Domain Suffix Search Order: <strong>" + $objItem.DNSDomainSuffixSearchOrder + "</strong><br>"
$strOutPut10 = "DNS Enabled For WINS Resolution: <strong>" + $objItem.DNSEnabledForWINSResolution + "</strong><br>"
$strOutPut11 = "DNS Host Name: <strong>" + $objItem.DNSHostName + "</strong><br>"
$strOutPut12 = "DNS Server Search Order: <strong>" + $objItem.DNSServerSearchOrder + "</strong><br>"
$strOutPut13 = "Domain DNS Registration Enabled: <strong>" + $objItem.DomainDNSRegistrationEnabled + "</strong><br>"
#$strOutPut14 = "Forward Buffer Memory: <strong>" + $objItem.ForwardBufferMemory + "</strong><br>"
$strOutPut15 = "Full DNS Registration Enabled: <strong>" + $objItem.FullDNSRegistrationEnabled + "</strong><br>"
#$strOutPut16 = "Index: <strong>" + $objItem.Index + "</strong><br>"
$strOutPut17 = "IP Address: <strong>" + $objItem.IPAddress + "</strong><br>"
$strOutPut18 = "MAC Address: <strong>" + $objItem.MACAddress + "</strong><br>"
$strOutPut19 = "WINS Enable LMHosts Lookup: <strong>" + $objItem.WINSEnableLMHostsLookup + "</strong><br>"
#$strOutPut20 = "WINS Host Lookup File: <strong>" + $objItem.WINSHostLookupFile + "</strong><br>"
$strOutPut21 = "WINS Primary Server: <strong>" + $objItem.WINSPrimaryServer + "</strong><br>"
#$strOutPut22 = "WINS Scope ID: <strong>" + $objItem.WINSScopeID + "</strong><br>"
$strOutPut23 = "WINS Secondary Server: <strong>" + $objItem.WINSSecondaryServer + "</strong><br>"
# Write HTML to File
#$strOutPut01 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut02 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut03 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut04 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut05 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut06 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut07 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut08 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut09 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut10 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut11 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut12 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut13 | out-file -filepath $htmlFilePath -encoding ascii -append
#$strOutPut14 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut15 | out-file -filepath $htmlFilePath -encoding ascii -append
#$strOutPut16 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut17 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut18 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut19 | out-file -filepath $htmlFilePath -encoding ascii -append
#$strOutPut20 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut21 | out-file -filepath $htmlFilePath -encoding ascii -append
#$strOutPut22 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut23 | out-file -filepath $htmlFilePath -encoding ascii -append
}
}
$strOutputString = "</font></p>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
#########################################################################################################
#########################################################################################################
# Write Subtitle to screen
write-host
write-host "CPU Data . . ." -foregroundcolor "magenta"
# Write Subtitle to HTML
$strOutputString = "<p>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutputString = "<strong><font size=3 color=red>Processor Details: </font></strong><br>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutputString = "<font size=3>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$colItems = get-wmiobject -class "Win32_Processor" -namespace "root\CIMV2" `
-computername $strComputer
$cnt = 0
foreach ($objItem in $colItems) {
# Each line in this array represents the data returned for each processor
# even if the processor is threaded and more than one line is returned,
# the comparison and $cnt variable limit the output to one row per workstation.
if ($cnt -eq 0) {
# Write to screen
write-host "Current Clock Speed: " $objItem.CurrentClockSpeed "MHz or [" ($objItem.CurrentClockSpeed/1000)"GHz ]"
write-host "Current Voltage: " $objItem.CurrentVoltage
write-host "Description: " $objItem.Description
write-host "Manufacturer: " $objItem.Manufacturer
write-host "Maximum Clock Speed: " $objItem.MaxClockSpeed "MHz or [" ($objItem.MaxClockSpeed/1000)"GHz ]"
write-host "Name: " $objItem.Name
write-host "Processor ID: " $objItem.ProcessorId
write-host "Role: " $objItem.Role
write-host "Socket Designation: " $objItem.SocketDesignation
write-host
# Create HTML Output
$strOutPut01 = "Current Clock Speed: <strong>" + $objItem.CurrentClockSpeed + "MHz <font color=#6699cc>(" + ($objItem.CurrentClockSpeed/1000) +"GHz)</font></strong><br>"
$strOutPut02 = "Current Voltage: <strong>" + $objItem.CurrentVoltage + "</strong><br>"
$strOutPut03 = "Description: <strong>" + $objItem.Description + "</strong><br>"
$strOutPut04 = "Manufacturer: <strong>" + $objItem.Manufacturer + "</strong><br>"
$strOutPut05 = "Maximum Clock Speed: <strong>" + $objItem.MaxClockSpeed + "MHz <font color=#6699cc>(" + ($objItem.MaxClockSpeed/1000) +"GHz)</font></strong><br>"
$strOutPut06 = "Name: <strong>" + $objItem.Name + "</strong><br>"
$strOutPut07 = "Processor ID: <strong>" + $objItem.ProcessorId + "</strong><br>"
$strOutPut08 = "Role: <strong>" + $objItem.Domain + "</strong><br>"
$strOutPut09 = "Socket Designation: <strong>" + $objItem.SocketDesignation + "</strong><br>"
# Write HTML to File
$strOutPut01 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut02 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut03 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut04 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut05 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut06 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut07 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut08 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut09 | out-file -filepath $htmlFilePath -encoding ascii -append
}
$cnt++
}
$strOutputString = "</font></p>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
########################################################################################################
##############################################################################################################
# Write Subtitle to screen
write-host
write-host "Basic Computer Information . . ." -foregroundcolor "magenta"
# Write Subtitle to HTML
$strOutputString = "<p>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutputString = "<strong><font size=3 color=red>Workstation Details: </font></strong><br>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutputString = "<font size=3>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$colItems = get-wmiobject -class "Win32_ComputerSystem" -namespace "root\CIMV2" `
-computername $strComputer
foreach ($objItem in $colItems) {
#Output to screen
write-host "Automatic Reset Boot Option: " $objItem.AutomaticResetBootOption
write-host "Automatic Reset Capability: " $objItem.AutomaticResetCapability
write-host "Boot ROM Supported: " $objItem.BootROMSupported
write-host "Bootup State: " $objItem.BootupState
#write-host "Creation Class Name: " $objItem.CreationClassName
write-host "Daylight In Effect: " $objItem.DaylightInEffect
write-host "Description: " $objItem.Description
write-host "Domain: " $objItem.Domain
write-host "Enable Daylight Savings Time: " $objItem.EnableDaylightSavingsTime
write-host "Infrared Supported: " $objItem.InfraredSupported
write-host "Installation Date: " $objItem.InstallDate
write-host "Last Load Information: " $objItem.LastLoadInfo
write-host "Manufacturer: " $objItem.Manufacturer
write-host "Model: " $objItem.Model
write-host "Network Server Mode Enabled: " $objItem.NetworkServerModeEnabled
write-host "Number Of Processors: " $objItem.NumberOfProcessors
write-host "Part Of Domain: " $objItem.PartOfDomain
write-host "Roles: " $objItem.Roles
write-host "System Startup Delay: " $objItem.SystemStartupDelay
write-host "System Startup Options: " $objItem.SystemStartupOptions
write-host "System Type: " $objItem.SystemType
write-host "Total Physical Memory: " $objItem.TotalPhysicalMemory
write-host "Username Logged On: " $objItem.UserName
write-host
# Create HTML Output
$strOutPut01 = "Automatic Reset Boot Option: <strong>" + $objItem.AutomaticResetBootOption + "</strong><br>"
$strOutPut02 = "Automatic Reset Capability: <strong>" + $objItem.AutomaticResetCapability + "</strong><br>"
$strOutPut03 = "Boot ROM Supported: <strong>" + $objItem.BootROMSupported + "</strong><br>"
$strOutPut04 = "Bootup State: <strong>" + $objItem.BootupState + "</strong><br>"
#$strOutPut05 = "Creation Class Name: <strong>" + $objItem.CreationClassName + "</strong><br>"
$strOutPut06 = "Daylight In Effect: <strong>" + $objItem.DaylightInEffect + "</strong><br>"
$strOutPut07 = "Description: <strong>" + $objItem.Description + "</strong><br>"
$strOutPut08 = "Domain: <strong>" + $objItem.Domain + "</strong><br>"
$strOutPut09 = "Enable Daylight Savings Time: <strong>" + $objItem.EnableDaylightSavingsTime + "</strong><br>"
$strOutPut10 = "Infrared Supported: <strong>" + $objItem.InfraredSupported + "</strong><br>"
$strOutPut11 = "Installation Date: <strong>" + $objItem.InstallDate + "</strong><br>"
$strOutPut12 = "Last Load Information: <strong>" + $objItem.LastLoadInfo + "</strong><br>"
$strOutPut13 = "Manufacturer: <strong>" + $objItem.Manufacturer + "</strong><br>"
$strOutPut14 = "Model: <strong>" + $objItem.Model + "</strong><br>"
$strOutPut15 = "Network Server Mode Enabled: <strong>" + $objItem.NetworkServerModeEnabled + "</strong><br>"
$strOutPut16 = "Number Of Processors: <strong>" + $objItem.NumberOfProcessors + "</strong><br>"
$strOutPut17 = "Part Of Domain: <strong>" + $objItem.PartOfDomain + "</strong><br>"
$strOutPut18 = "Roles: <strong>" + $objItem.Roles + "</strong><br>"
$strOutPut19 = "System Startup Delay: <strong>" + $objItem.SystemStartupDelay + "</strong><br>"
$strOutPut20 = "System Startup Options: <strong>" + $objItem.SystemStartupOptions + "</strong><br>"
$strOutPut21 = "System Type: <strong>" + $objItem.SystemType + "</strong><br>"
# Improve the display of the higher order values of MB and GB
$displayMB = [math]::round($objItem.TotalPhysicalMemory/1024/1024, 2)
$displayGB = [math]::round($objItem.TotalPhysicalMemory/1024/1024/1024, 2)
$strOutPut22 = "Total Physical Memory: <strong>" + $objItem.TotalPhysicalMemory + " Bytes <font color=#6699cc>(" + $displayMB + "MB) or (" + $displayGB + "GB)</font></strong><br>"
$strOutPut23 = "Username Logged On: <strong>" + $objItem.UserName + "</strong><br>"
# Write HTML to File
$strOutPut01 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut02 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut03 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut04 | out-file -filepath $htmlFilePath -encoding ascii -append
#$strOutPut05 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut06 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut07 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut08 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut09 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut10 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut11 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut12 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut13 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut14 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut15 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut16 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut17 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut18 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut19 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut20 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut21 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut22 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut23 | out-file -filepath $htmlFilePath -encoding ascii -append
}
$strOutputString = "</font></p>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
#########################################################################################################
#########################################################################################################
# Write Subtitle to screen
write-host
write-host "Hard Drive Information . . ." -foregroundcolor "magenta"
# Write Subtitle to HTML
$strOutputString = "<p>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutputString = "<strong><font size=3 color=red>Hard Drive Information: </font></strong><br>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutputString = "<font size=3>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
# Get the variables form the c that will be needed
$colItems = get-wmiobject -class "Win32_DiskDrive" -namespace "root\CIMV2" `
-computername $strComputer
# Insert a subheading for physial drive data
$strOutputString = "<strong><font size=3 color=#6699cc>Physical Drive(s): </font></strong><br>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
foreach ($objItem in $colItems) {
# Write to screen
write-host "Caption: " $objItem.Caption
write-host "Size: " $objItem.Size
write-host "Physical Drive: " $objItem.Name
write-host "Manufacturer: " $objItem.Manufacturer
write-host
# Improve the display of the higher order values of MB and GB
$displayMB = [math]::round($objItem.Size/1024/1024, 2)
$displayGB = [math]::round($objItem.Size/1024/1024/1024, 2)
$strOutPut01 = "Caption: <strong>" + $objItem.Caption + "</strong><br>"
$strOutPut02 = "Details: <strong>" + $objItem.Name + " <font color=#6699cc>(" + $displayGB + " GB)</font></strong><br>"
#$strOutPut03 = "Manufacturer: <strong>" + $objItem.Manufacturer + "</strong><br>"
#$strOutPut04 = "Size: <strong> "+ $displayGB + " GB</strong><br>"
# Write HTML to File
$strOutPut01 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut02 | out-file -filepath $htmlFilePath -encoding ascii -append
#$strOutPut03 | out-file -filepath $htmlFilePath -encoding ascii -append
#$strOutPut04 | out-file -filepath $htmlFilePath -encoding ascii -append
}
#########################################################################################################
# Get the values for the drive(s) from the "Win32_LogicalDisk" class
$colItems = get-wmiobject -class "Win32_LogicalDisk" -namespace "root\CIMV2" `
-computername $strComputer
# Insert a subheading for physial drive data
$strOutputString = "<strong><font size=3 color=#6699cc>Logical Drive(s): </font></strong><br>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
foreach ($objItem in $colItems) {
# Hard Disks are of the "$objItem.DriveType" value of 3
if ($objItem.DriveType -eq 3){
# Write to screen
#write-host "Drive Type: " $objItem.DriveType
write-host "Name: " $objItem.Name
write-host "FileSystem: " $objItem.FileSystem
write-host "VolumeSerialNumber: " $objItem.VolumeSerialNumber
write-host "Size: " $objItem.Size
write-host "FreeSpace: " $objItem.FreeSpace
write-host
# Create HTML Output
$strOutPut01 = "<font color=#6699cc>Drive: <strong>" + $objItem.Name + "</strong></font><br>"
# Improve the display of the higher order values of MB and GB
$displayMB = [math]::round($objItem.Size/1024/1024, 2)
$displayGB = [math]::round($objItem.Size/1024/1024/1024, 2)
$strOutPut02 = "Drive Size: <strong>"+ $objItem.Name +"\ "+ $displayGB + " GB</strong><br>"
# Improve the display of the higher order values of MB and GB
$displayMB = [math]::round($objItem.FreeSpace/1024/1024, 2)
$displayGB = [math]::round($objItem.FreeSpace/1024/1024/1024, 2)
$strOutPut03 = "Free Space: <strong>"+ $objItem.Name +"\ "+ $displayGB + " GB</strong><br>"
$strOutPut04 = "File System: <strong>" + $objItem.FileSystem + "</strong><br>"
$strOutPut05 = "Volume Serial Number: <strong>" + $objItem.VolumeSerialNumber + "</strong><br>"
# Write HTML to File
$strOutPut01 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut02 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut03 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut04 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut05 | out-file -filepath $htmlFilePath -encoding ascii -append
}
}
$strOutputString = "</font></p>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
#########################################################################################################
#########################################################################################################
# Write Subtitle to screen
write-host
write-host "Desktop Monitor Properties . . ." -foregroundcolor "magenta"
# Write Subtitle to HTML
$strOutputString = "<p>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutputString = "<strong><font size=3 color=red>Desktop Monitor Properties: </font></strong><br>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutputString = "<font size=3>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$colItems = get-wmiobject -class "Win32_DesktopMonitor" -namespace "root\CIMV2" `
-computername $strComputer
foreach ($objItem in $colItems) {
#output to screen
write-host "Description: " $objItem.Description
write-host "Device ID: " $objItem.DeviceID
write-host "Display Type: " $objItem.DisplayType
write-host "Monitor Manufacturer: " $objItem.MonitorManufacturer
write-host "Monitor Type: " $objItem.MonitorType
write-host "Name: " $objItem.Name
#write-host "Pixels Per X Logical Inch: " $objItem.PixelsPerXLogicalInch
#write-host "Pixels Per Y Logical Inch: " $objItem.PixelsPerYLogicalInch
write-host "PNP Device ID: " $objItem.PNPDeviceID
write-host "Screen Height: " $objItem.ScreenHeight
write-host "Screen Width: " $objItem.ScreenWidth
write-host
# Create HTML Output
$strOutPut01 = "Description: <strong>" + $objItem.Description + "</strong><br>"
$strOutPut02 = "Device ID: <strong>" + $objItem.DeviceID + "</strong><br>"
$strOutPut03 = "Display Type: <strong>" + $objItem.DisplayType + "</strong><br>"
$strOutPut04 = "Monitor Manufacturer: <strong>" + $objItem.MonitorManufacturer + "</strong><br>"
$strOutPut05 = "Monitor Type: <strong>" + $objItem.MonitorType + "</strong><br>"
$strOutPut06 = "Name: <strong>" + $objItem.Name + "</strong><br>"
#$strOutPut07 = "Pixels Per X Logical Inch: <strong>" + $objItem.PixelsPerXLogicalInch + "</strong><br>"
#$strOutPut08 = "Pixels Per Y Logical Inch: <strong>" + $objItem.PixelsPerYLogicalInch + "</strong><br>"
$strOutPut09 = "PNP Device ID: <strong>" + $objItem.PNPDeviceID + "</strong><br>"
$strOutPut10 = "Screen Height: <strong>" + $objItem.ScreenHeight + "</strong><br>"
$strOutPut11 = "Screen Width: <strong>" + $objItem.ScreenWidth + "</strong><br>"
# Write HTML to File
$strOutPut01 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut02 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut03 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut04 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut05 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut06 | out-file -filepath $htmlFilePath -encoding ascii -append
#$strOutPut07 | out-file -filepath $htmlFilePath -encoding ascii -append
#$strOutPut08 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut09 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut10 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut11 | out-file -filepath $htmlFilePath -encoding ascii -append
}
$strOutputString = "</font></p>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
#########################################################################################################
#########################################################################################################
# Write Subtitle to screen
write-host
write-host "Operating System Properties . . ." -foregroundcolor "magenta"
# Write Subtitle to HTML
$strOutputString = "<p>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutputString = "<strong><font size=3 color=red>Operating System Properties: </font></strong><br>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutputString = "<font size=3>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$colItems = get-wmiobject -class "Win32_OperatingSystem" -namespace "root\CIMV2" `
-computername $strComputer
foreach ($objItem in $colItems) {
# Output to screen
write-host "Build Number: " $objItem.BuildNumber
write-host "Build Type: " $objItem.BuildType
write-host "Caption: " $objItem.Caption
write-host "CSD Version: " $objItem.CSDVersion
write-host "Free Physical Memory: " $objItem.FreePhysicalMemory
write-host "Free Space In Paging Files: " $objItem.FreeSpaceInPagingFiles
write-host "Free Virtual Memory: " $objItem.FreeVirtualMemory
write-host "Installation Date: " $objItem.InstallDate
write-host "Last Boot-Up Time: " $objItem.LastBootUpTime
write-host "Manufacturer: " $objItem.Manufacturer
#write-host "Number Of Users: " $objItem.NumberOfUsers
write-host "Organization: " $objItem.Organization
write-host "Operating System Language: " $objItem.OSLanguage
write-host "Primary: " $objItem.Primary
write-host "Registered User: " $objItem.RegisteredUser
write-host "Serial Number: " $objItem.SerialNumber
write-host "Service Pack Major Version: " $objItem.ServicePackMajorVersion
write-host "Service Pack Minor Version: " $objItem.ServicePackMinorVersion
write-host "System Directory: " $objItem.SystemDirectory
write-host "System Drive: " $objItem.SystemDrive
write-host "Total Swap Space Size: " $objItem.TotalSwapSpaceSize
write-host "Total Virtual Memory Size: " $objItem.TotalVirtualMemorySize
write-host "Total Visible Memory Size: " $objItem.TotalVisibleMemorySize
write-host "Version: " $objItem.Version
write-host "Windows Directory: " $objItem.WindowsDirectory
write-host
# Create HTML Output
$strOutPut01 = "Build Number: <strong>" + $objItem.BuildNumber + "</strong><br>"
$strOutPut02 = "Build Type: <strong>" + $objItem.BuildType + "</strong><br>"
$strOutPut03 = "Caption: <strong>" + $objItem.Caption + "</strong><br>"
$strOutPut04 = "CSD Version: <strong>" + $objItem.CSDVersion + "</strong><br>"
# Improve the display of the higher order values of MB and GB
$displayMB = [math]::round($objItem.FreePhysicalMemory/1024, 2)
$displayGB = [math]::round($objItem.FreePhysicalMemory/1024/1024, 2)
$strOutPut05 = "Free Physical Memory: <strong>" + $objItem.FreePhysicalMemory + " KB <font color=#6699cc>(" + $displayMB + "MB)(" + $displayGB + "GB)</font></strong><br>"
# Improve the display of the higher order values of MB and GB
$displayGB = [math]::round($objItem.FreeSpaceInPagingFiles/1024/1024, 2)
$strOutPut06 = "Free Space In Paging Files: <strong>" + $objItem.FreeSpaceInPagingFiles + " KB <font color=#6699cc>(" + $displayGB + "GB)</font></strong><br>"
# Improve the display of the higher order values of MB and GB
$displayGB = [math]::round($objItem.FreeVirtualMemory/1024/1024, 2)
$strOutPut07 = "Free Virtual Memory: <strong>" + $objItem.FreeVirtualMemory + " KB <font color=#6699cc>(" + $displayGB + "GB)</font></strong><br>"
$strOutPut08 = "Installation Date: <strong>" + $objItem.InstallDate + "</strong><br>"
$strOutPut09 = "Last Boot-Up Time: <strong>" + $objItem.LastBootUpTime + "</strong><br>"
$strOutPut10 = "Manufacturer: <strong>" + $objItem.Manufacturer + "</strong><br>"
#$strOutPut11 = "Number Of Users: <strong>" + $objItem.NumberOfUsers + "</strong><br>"
$strOutPut12 = "Organization: <strong>" + $objItem.Organization + "</strong><br>"
$strOutPut13 = "Operating System Language: <strong>" + $objItem.OSLanguage + "</strong><br>"
$strOutPut14 = "Primary: <strong>" + $objItem.Primary + "</strong><br>"
$strOutPut15 = "Registered User: <strong>" + $objItem.RegisteredUser + "</strong><br>"
$strOutPut16 = "Serial Number: <strong>" + $objItem.SerialNumber + "</strong><br>"
$strOutPut17 = "Service Pack Major Version: <strong>" + $objItem.ServicePackMajorVersion + "</strong><br>"
$strOutPut18 = "Service Pack Minor Version: <strong>" + $objItem.ServicePackMinorVersion + "</strong><br>"
$strOutPut19 = "System Directory: <strong>" + $objItem.SystemDirectory + "</strong><br>"
$strOutPut20 = "System Drive: <strong>" + $objItem.SystemDrive + "</strong><br>"
$strOutPut21 = "Total Swap Space Size: <strong>" + $objItem.TotalSwapSpaceSize + "</strong><br>"
# Improve the display of the higher order values of MB and GB
$displayGB = [math]::round($objItem.TotalVirtualMemorySize/1024/1024, 2)
$strOutPut22 = "Total Virtual Memory Size: <strong>" + $objItem.TotalVirtualMemorySize + " KB <font color=#6699cc>(" + $displayGB + "GB)</font></strong><br>"
# Improve the display of the higher order values of MB and GB
$displayGB = [math]::round($objItem.TotalVisibleMemorySize/1024/1024, 2)
$strOutPut23 = "Total Visible Memory Size: <strong>" + $objItem.TotalVisibleMemorySize + " KB <font color=#6699cc>(" + $displayGB + "GB)</font></strong><br>"
$strOutPut24 = "Version: <strong>" + $objItem.Version + "</strong><br>"
$strOutPut25 = "Windows Directory: <strong>" + $objItem.WindowsDirectory + "</strong><br>"
# Write HTML to File
$strOutPut01 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut02 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut03 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut04 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut05 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut06 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut07 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut08 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut09 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut10 | out-file -filepath $htmlFilePath -encoding ascii -append
#$strOutPut11 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut12 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut13 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut14 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut15 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut16 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut17 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut18 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut19 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut20 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut21 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut22 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut23 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut24 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut25 | out-file -filepath $htmlFilePath -encoding ascii -append
}
$strOutputString = "</font></p>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
#########################################################################################################
#########################################################################################################
# Write Subtitle to screen
write-host
write-host "BIOS Information . . ." -foregroundcolor "magenta"
# Write Subtitle to HTML
$strOutputString = "<p>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutputString = "<strong><font size=3 color=red>BIOS Information: </font></strong><br>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutputString = "<font size=3>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$colItems = get-wmiobject -class "Win32_BIOS" -namespace "root\CIMV2" `
-computername $strComputer
foreach ($objItem in $colItems) {
# write to screen
write-host "BIOS Version: " $objItem.BIOSVersion
write-host "Description: " $objItem.Description
write-host "Manufacturer: " $objItem.Manufacturer
write-host "Release Date: " $objItem.ReleaseDate
write-host "Serial Number: " $objItem.SerialNumber
write-host
# Create HTML Output
$strOutPut01 = "BIOS Version: <strong>" + $objItem.Description + "</strong><br>"
$strOutPut02 = "Description: <strong>" + $objItem.DeviceID + "</strong><br>"
$strOutPut03 = "Manufacturer: <strong>" + $objItem.DisplayType + "</strong><br>"
$strOutPut04 = "Release Date: <strong>" + $objItem.MonitorManufacturer + "</strong><br>"
$strOutPut05 = "Serial Number: <strong>" + $objItem.MonitorType + "</strong><br>"
# Write HTML to File
$strOutPut01 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut02 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut03 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut04 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut05 | out-file -filepath $htmlFilePath -encoding ascii -append
}
$strOutputString = "</font></p>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
#########################################################################################################
#########################################################################################################
# Write Subtitle to screen
write-host
write-host "Loaded Printer Drivers . . ." -foregroundcolor "magenta"
# Write Subtitle to HTML
$strOutputString = "<p>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutputString = "<strong><font size=3 color=red>Loaded Printer Drivers: </font></strong><br>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutputString = "<font size=3>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$colItems = get-wmiobject -class "Win32_PrinterDriver" -namespace "root\CIMV2" `
-computername $strComputer
foreach ($objItem in $colItems) {
# write to screen
write-host "Name: " $objItem.Name
write-host "Configuration File: " $objItem.ConfigFile
write-host "Data File: " $objItem.DataFile
write-host "Driver Path: " $objItem.DriverPath
##write-host "Creation Class Name: " $objItem.CreationClassName
##write-host "File Path: " $objItem.FilePath
##write-host "Supported Platform: " $objItem.SupportedPlatform
##write-host "System Creation Class Name: " $objItem.SystemCreationClassName
write-host
# Create HTML Output
$strOutPut01 = "<font size=3>Name: <strong>" + $objItem.Name + "</strong></font><br>"
$strOutPut02 = "<font size=1 color=#6699cc>Configuration File: <strong>" + $objItem.ConfigFile + "</strong></font><br>"
$strOutPut03 = "<font size=1 color=#6699cc>Data File: <strong>" + $objItem.DataFile + "</strong></font><br>"
$strOutPut04 = "<font size=1 color=#6699cc>Driver Path: <strong>" + $objItem.DriverPath + "</strong></font><br>"
# Write HTML to File
$strOutPut01 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut02 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut03 | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutPut04 | out-file -filepath $htmlFilePath -encoding ascii -append
}
$strOutputString = "</font></p>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
#########################################################################################################
#########################################################################################################
# Write Subtitle to screen
write-host
write-host "Peripheral Equipment . . ." -foregroundcolor "magenta"
# Write Subtitle to HTML
$strOutputString = "<p>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutputString = "<strong><font size=3 color=red>Peripheral Equipment (from Text Files on C:\ ): </font></strong><br>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutputString = "<font size=3>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
# Test for the presence of 3 files C:\monitor.txt C:\printer.txt and C:\scanner.txt and tranfer
# their content to the output of this script.
if ((Test-Path C:\monitor.txt) -eq "True"){
# write to screen
$strMonitor = get-content -Path C:\monitor.txt
write-host "Monitor Serial Number: " + $strMonitor
}
if ((Test-Path C:\printer.txt) -eq "True"){
# write to screen
$strPrinter = get-content -Path C:\printer.txt
write-host "Printer Serial Number: " + $strPrinter
}
if ((Test-Path C:\scanner.txt) -eq "True"){
# write to screen
$strScanner = get-content -Path C:\scanner.txt
write-host "Scanner Serial Number: " + $strScanner
}
# write to HTML file
$strOutputString = " Monitor Serial Number: <strong>" + $strMonitor + "</strong><br>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutputString = " Printer Serial Number: <strong>" + $strPrinter + "</strong><br>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutputString = " Scanner Serial Number: <strong>" + $strScanner + "</strong><br>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutputString = "</font></p>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
#########################################################################################################
#########################################################################################################
# Write Subtitle to screen
write-host
write-host "Application Software . . ." -foregroundcolor "magenta"
# Write Subtitle to HTML
$strOutputString = "<p>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutputString = "<strong><font size=3 color=red>Application Software Data: </font></strong><br>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$colItems = get-wmiobject -class "Win32_Product" -namespace "root\CIMV2" `
-computername $strComputer
foreach ($objItem in $colItems) {
# write to screen
write-host "Caption: " $objItem.Caption
#write-host "Description: " $objItem.Description
#write-host "Identifying Number: " $objItem.IdentifyingNumber
#write-host "Installation Date: " $objItem.InstallDate
##write-host "Installation Date 2: " $objItem.InstallDate2
##write-host "Installation Location: " $objItem.InstallLocation
#write-host "Installation State: " $objItem.InstallState
#write-host "Name: " $objItem.Name
#write-host "Package Cache: " $objItem.PackageCache
##write-host "SKU Number: " $objItem.SKUNumber
#write-host "Vendor: " $objItem.Vendor
#write-host "Version: " $objItem.Version
#write-host
# write to HTML file
#$htmlFilePath = "C:\" + $objItem.CSName + ".html"
$strOutputString = "<font size=2> " + "Name: <strong>" + $objItem.Caption + "</strong></font>,<font size=1> Install Date: <strong>" + $objItem.InstallDate + "</strong>, Vendor: <strong>" + $objItem.Vendor + "</strong>, Version: <strong>" + $objItem.Version + "</strong>, ID Num: <strong>" + $objItem.IdentifyingNumber + "</strong></font><font size=1 color=#6699cc>, MSI Cache: <strong>" + $objItem.PackageCache + "</strong></font><br>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
}
$strOutputString = "</p>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
#########################################################################################################
#########################################################################################################
# Write Subtitle to screen
write-host
write-host "Patch Data . . ." -foregroundcolor "magenta"
# Write Subtitle to HTML
$strOutputString = "<p>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutputString = "<strong><font size=3 color=red>Patch Update Details: </font></strong><br>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$colItems = get-wmiobject -class "Win32_QuickFixEngineering" -namespace "root\CIMV2" `
-computername $strComputer
foreach ($objItem in $colItems) {
# Eliminate any "nonsense" result that returns the value "File 1"
if ($objItem.HotFixID -notlike "File 1") {
# remove any legacy carriage returns "\n" from the data
$description = $objItem.Description -replace " \\n", " "
# write to screen
write-host "HotFix ID: " $objItem.HotFixID " " $description
#write-host "HotFix ID: " $objItem.HotFixID " Installed On: " $objItem.InstalledOn " Installed By: " $objItem.InstalledBy
# write to HTML file
$strOutputString = "<font size=2>" + "HotFix ID: <strong>" + $objItem.HotFixID + "</strong></font>,<font size=1> Installed On: <strong>" + $objItem.InstalledOn + "</strong>, Installed By: <strong>" + $objItem.InstalledBy + "</strong></font>    <font size=1 color=#6699cc>" + $description + "</font><br>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
}
}
$strOutputString = "</p>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
#########################################################################################################
#########################################################################################################
# Write STAFF User Profiles to screen
write-host
write-host "Username Access History. . ." -foregroundcolor "magenta"
# Write Subtitle to HTML
$strOutputString = "<p>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutputString = "<strong><font size=3 color=red>Username Access History: </font></strong><br>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$profilefilepath = "C:\Documents and Settings"
$profiles = get-item "$profilefilepath\*"
foreach ($profile in $profiles) {
$accesstime = (get-item $profile).LastAccessTime
# .LastAccessTime by default returns date as mm-dd-yyyy and there are no switches to adjust this
# so we will use regular expressions to reform that date to yyyy-mmm-dd
$String = $accesstime
#split the date from the time
$string = [Regex]::split($string, " ")
$xdate = $string[0]
$xtime = $string[1]
# Replace the foward slashes with "-"
$string = $xdate
$string = [Regex]::Replace($string, "/", "-")
# Confirmthe string ends in a year...
$TorF = [Regex]::IsMatch($string, '-2\d\d\d$')
if ($TorF = "True") {
# Split the date elements up
$string = [Regex]::split($string, "-")
$xmonth = $string[0]
$xday = $string[1]
$xyear = $string[2]
# Reform the date to yyyy-mmm-dd and append the time
$accesstime = $xyear + "-" + $xmonth + "-" + $xday + " " + $xtime
}
# Strip off the directory path
$pusername = (get-item $profile).PSChildName
$ignoreprofile = "False"
# Ignore the following Prolifes...
if ($pusername -eq "Administrator") {$ignoreprofile = "True"}
if ($pusername -eq "All Users") {$ignoreprofile = "True"}
if ($pusername -eq "Default User") {$ignoreprofile = "True"}
if ($pusername -eq "LocalService") {$ignoreprofile = "True"}
if ($pusername -eq "NetworkService") {$ignoreprofile = "True"}
# Get the remaining profiles
if ($ignoreprofile -eq "False") {
# All student accounts end in a number and we are not interested in recording these...
# Confirm the string ends in a number...
$string = $pusername
$TorF = [Regex]::IsMatch($string, '\d$')
if ($TorF -ne "True") {
# write to screen
write-host "Username: " $pusername "Last Access: " $accesstime
#write to HTML file
$strOutputString = "<font size=3>" + "Profile Username: <strong>" + $pusername + "</strong> Last Access: <strong>" + $accesstime + "</strong></font><br>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
}
}
}
$strOutputString = "</p>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
#########################################################################################################
#########################################################################################################
# Process Norton/Symantec Antivirus Status
# Test if the Virus Defination Log file path exists...
$definfofilepath = "C:\Program Files\Common Files\Symantec Shared\VirusDefs\definfo.dat"
$pathpresent = Test-path $definfofilepath
if($pathpresent -eq "True") {
write-host
write-host "Norton/Symantec Antivirus Status. . ." -foregroundcolor "magenta"
# Write Subtitle to HTML
$strOutputString = "<p>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutputString = "<strong><font size=3 color=red>Norton/Symantec Antivirus Status: </font></strong><br>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$VirDefData = get-content $definfofilepath
$VirDefDate = $VirDefData[1]
$dtyear = $VirDefDate.substring(8,4)
$dtmonth = $VirDefDate.substring(12,2)
$dtday = $VirDefDate.substring(14,2)
$Rev = $VirDefDate.substring(17,3)
# Reform the date to New Zealand standard format!
$ddate = "$dtday" + "/" + "$dtmonth" + "/" + "$dtyear"
$DateVirDefs = $ddate
# write to screen
write-host "Virus Def Date: $DateVirDefs"
write-host "Revision Number: $Rev"
# write to HTML file
$strOutputString = "<font size=3>" + "Virus Def Date: <strong>" + $DateVirDefs + "</strong></font><br>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutputString = "<font size=3>" + "Revision Number: <strong>" + $Rev + "</strong></font><br>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
# Set the $key variable to the default registry location for NAV/SAV
$key = "hklm:\Software\INTEL\LANDesk\VirusProtect6\CurrentVersion"
# Get All the values in the key at this point
$values = get-itemproperty $key
# Split the $values at the semi-colon + space (; )
$values = [regex]::split($values,'; ')
# Compare all the values seeking the Product version and License Number
foreach ($value in $values) {
## write-host " Value: $value"
if ([Regex]::IsMatch($value, '^LicenseNumber=')){
$string = [regex]::split($value,'=')
$LicenceNum = $string[1]
}
if ([Regex]::IsMatch($value, '^ProductVersion=')){
$string = [regex]::split($value,'=')
$ProductVer = $string[1]
}
}
# write to screen
write-host "Licence Number: $LicenceNum"
write-host "Registry Version Identifier: $ProductVer"
# write to HTML file
$strOutputString = "<font size=3>" + "Licence Number: <strong>" + $LicenceNum + "</strong></font><br>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
$strOutputString = "<font size=3>" + "Version Identifier (Registry): <strong>" + $ProductVer + "</strong></font><br>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
# Convert the Product Version Number from the registry to a "known" product number...
Switch ($productver){
# Norton Antivirus conversion here... (need to find list of conversion numbers for other versions of NAV)
61407993 {$NavVersion ="7.61.937"}
# Symantec Antivirus conversion here...
328336375 {$SavVersion ="10.1.5.5010"}
23528424 {$SavVersion = "10.0.0.359"}
65537001 {$SavVersion = "10.0.1.1000"}
65995753 {$SavVersion = "10.0.1.1007"}
66061289 {$SavVersion = "10.0.1.1008"}
131073002 {$SavVersion = "10.0.2.2000"}
131138538 {$SavVersion = "10.0.2.2001"}
131728362 {$SavVersion = "10.0.2.2010"}
132383722 {$SavVersion = "10.0.2.2020"}
132449258 {$SavVersion = "10.0.2.2021"}
25822194 {$SavVersion = "10.1.0.394"}
25953266 {$SavVersion = "10.1.0.396"}
26215410 {$SavVersion = "10.1.0.400"}
26280946 {$SavVersion = "10.1.0.401"}
65536905 {$SavVersion = "9.0.5.1000"}
72090503 {$SavVersion = "9.0.3.1100"}
65536903 {$SavVersion = "9.0.3.1000"}
65536902 {$SavVersion = "9.0.2.1000"}
65536901 {$SavVersion = "9.0.1.1000"}
22152068 {$SavVersion = "9.0.0.338"}
21562155 {$SavVersion = "8.1.1.329"}
21168939 {$SavVersion = "8.1.1.323"}
20906795 {$SavVersion = "8.1.1.319"}
20579115 {$SavVersion = "8.1.1.314"}
54068001 {$SavVersion = "8.1.0.825"}
29950753 {$SavVersion = "8.0.1.457"}
614597408 {$SavVersion = "8.0.0.9378"}
614335264 {$SavVersion = "8.0.0.9374"}
29229856 {$SavVersion = "8.0.0.446"}
28640032 {$SavVersion = "8.0.0.437"}
28443424 {$SavVersion = "8.0.0.434"}
28115744 {$SavVersion = "8.0.0.429"}
27853600 {$SavVersion = "8.0.0.425"}
85197700 {$SavVersion = "7.60.926"}
61997817 {$SavVersion = "7.6.1.946"}
61473529 {$SavVersion = "7.6.1.938"}
60949241 {$SavVersion = "7.6.1.930"}
60687096 {$SavVersion = "7.6.1.926"}
55509743 {$SavVersion = "7.5.1.847"}
48366268 {$SavVersion = "7.0.0"}
}
# Output the "known" NAV/SAV version number
if ($SavVersion -ne $null) {$VersionNumber = [int]$SavVersion.substring(0,2)}
if ($NavVersion -ne $null) {$VersionNumber = [int]$NavVersion.substring(0,2)}
# write to screen
Write-host "Version Number: $VersionNumber"
# write to HTML file
$strOutputString = "<font size=3>" + "Version Number: <strong>" + $VersionNumber + "</strong></font><br>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
}
$strOutputString = "</p>"
$strOutputString | out-file -filepath $htmlFilePath -encoding ascii -append
#########################################################################################################
|
|
[x]
The Solution Rating System
|
||
|
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
|
Loading Advertisement... |