PoshCode Logo PowerShell Code Repository

Difference between
modified post 6850 by Durgesh Gupta on Thu 20th Apr 16:24 and
original post 639 by alanrenouf on Wed 15th Oct 15:34
Showold version | new version | both versions

    
11
#####################################################
22
#    Audit script by Alan Renouf - Virtu-Al         #
33
#    Blog: http://teckinfo.blogspot.com/            #
44
#                                                   #
55
#    Usage: Audit.ps1 'path'                        #
66
#                                                   #
77
#    The file needs to be a plain text list of      #
88
#    computers to be audited one on each line       #
99
#                                                   #
1010
#####################################################
1212
param( [string] $auditlist)
1515
if ($auditlist -eq ""){
1616
	Write-Host "No list specified, using Localhost"
1717
	$targets = "localhost"
1818
}
1919
else
2020
{
2121
	if ((Test-Path $auditlist) -eq $false)
2222
	{
2323
		Write-Host "Invalid audit path specified: $auditlist"
2424
		exit
2525
	}
2626
	else
2727
	{
2828
		Write-Host "Using Audit list: $auditlist"
2929
		$Targets = Get-Content $auditlist
3030
	}
3131
}
3333
$Date = Get-Date
3535
Foreach ($Target in $Targets)
3636
{
3737
	$Filename = ".\" + $Target + "_" + $date.Hour + $date.Minute + "_" + $Date.Day + "-" + $Date.Month + "-" + $Date.Year + ".htm"
3939
	# =====================================================================================================================
4040
	#	CREATE HTML OUTPUT
4141
	# =====================================================================================================================
4343
	Write-Output " "| out-file -Append -encoding ASCII -filepath $Filename
4444
	Write-Output '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">'| out-file -Append -encoding ASCII -filepath $Filename
4545
	Write-Output '<html ES_auditInitialized='false'><head><title>Audit</title>'| out-file -Append -encoding ASCII -filepath $Filename
4646
	Write-Output "<META http-equiv=Content-Type content='text/html; charset=windows-1252'>"| out-file -Append -encoding ASCII -filepath $Filename
4848
	# ---------- Start of Style Definition Section ------------------------------------------------------------------------
5050
	Write-Output "<STYLE type=text/css>"| out-file -Append -encoding ASCII -filepath $Filename
5252
	Write-Output "	DIV .expando {DISPLAY: block; FONT-WEIGHT: normal; FONT-SIZE: 8pt; RIGHT: 10px; COLOR: #ffffff; FONT-FAMILY: Tahoma; POSITION: absolute; TEXT-DECORATION: underline}"| out-file -Append -encoding ASCII -filepath $Filename
5353
	Write-Output "	TABLE {TABLE-LAYOUT: fixed; FONT-SIZE: 100%; WIDTH: 100%}"| out-file -Append -encoding ASCII -filepath $Filename
5454
	Write-Output "	#objshowhide {PADDING-RIGHT: 10px; FONT-WEIGHT: bold; FONT-SIZE: 8pt; Z-INDEX: 2; CURSOR: hand; COLOR: #000000; MARGIN-RIGHT: 0px; FONT-FAMILY: Tahoma; TEXT-ALIGN: right; TEXT-DECORATION: underline; WORD-WRAP: normal}"| out-file -Append -encoding ASCII -filepath $Filename
5555
	Write-Output "	.heading0_expanded {BORDER-RIGHT: #bbbbbb 1px solid; PADDING-RIGHT: 5em; BORDER-TOP: #bbbbbb 1px solid; DISPLAY: block; PADDING-LEFT: 8px; FONT-WEIGHT: bold; FONT-SIZE: 8pt; MARGIN-BOTTOM: -1px; MARGIN-LEFT: 0px; BORDER-LEFT: #bbbbbb 1px solid; WIDTH: 100%; CURSOR: hand; COLOR: #FFFFFF; MARGIN-RIGHT: 0px; PADDING-TOP: 4px; BORDER-BOTTOM: #bbbbbb 1px solid; FONT-FAMILY: Tahoma; POSITION: relative; HEIGHT: 2.25em; BACKGROUND-COLOR: #cc0000}"| out-file -Append -encoding ASCII -filepath $Filename
5656
	Write-Output "	.heading1 {BORDER-RIGHT: #bbbbbb 1px solid; PADDING-RIGHT: 5em; BORDER-TOP: #bbbbbb 1px solid; DISPLAY: block; PADDING-LEFT: 16px; FONT-WEIGHT: bold; FONT-SIZE: 8pt; MARGIN-BOTTOM: -1px; MARGIN-LEFT: 5px; BORDER-LEFT: #bbbbbb 1px solid; WIDTH: 100%; CURSOR: hand; COLOR: #ffffff; MARGIN-RIGHT: 0px; PADDING-TOP: 4px; BORDER-BOTTOM: #bbbbbb 1px solid; FONT-FAMILY: Tahoma; POSITION: relative; HEIGHT: 2.25em; BACKGROUND-COLOR: #7BA7C7}"| out-file -Append -encoding ASCII -filepath $Filename
5757
	Write-Output "	.heading2 {BORDER-RIGHT: #bbbbbb 1px solid; PADDING-RIGHT: 5em; BORDER-TOP: #bbbbbb 1px solid; DISPLAY: block; PADDING-LEFT: 16px; FONT-WEIGHT: bold; FONT-SIZE: 8pt; MARGIN-BOTTOM: -1px; MARGIN-LEFT: 5px; BORDER-LEFT: #bbbbbb 1px solid; WIDTH: 100%; CURSOR: hand; COLOR: #ffffff; MARGIN-RIGHT: 0px; PADDING-TOP: 4px; BORDER-BOTTOM: #bbbbbb 1px solid; FONT-FAMILY: Tahoma; POSITION: relative; HEIGHT: 2.25em; BACKGROUND-COLOR: #A5A5A5}"| out-file -Append -encoding ASCII -filepath $Filename
5858
	Write-Output "	.tableDetail {BORDER-RIGHT: #bbbbbb 1px solid; BORDER-TOP: #bbbbbb 1px solid; DISPLAY: block; PADDING-LEFT: 16px; FONT-SIZE: 8pt;MARGIN-BOTTOM: -1px; PADDING-BOTTOM: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #bbbbbb 1px solid; WIDTH: 100%; COLOR: #000000; MARGIN-RIGHT: 0px; PADDING-TOP: 4px; BORDER-BOTTOM: #bbbbbb 1px solid; FONT-FAMILY: Tahoma; POSITION: relative; BACKGROUND-COLOR: #f9f9f9}"| out-file -Append -encoding ASCII -filepath $Filename
5959
	Write-Output "	.filler {BORDER-RIGHT: medium none; BORDER-TOP: medium none; DISPLAY: block; BACKGROUND: none transparent scroll repeat 0% 0%; MARGIN-BOTTOM: -1px; FONT: 100%/8px Tahoma; MARGIN-LEFT: 43px; BORDER-LEFT: medium none; COLOR: #ffffff; MARGIN-RIGHT: 0px; PADDING-TOP: 4px; BORDER-BOTTOM: medium none; POSITION: relative}"| out-file -Append -encoding ASCII -filepath $Filename
6060
	Write-Output "	.Solidfiller {BORDER-RIGHT: medium none; BORDER-TOP: medium none; DISPLAY: block; BACKGROUND: none transparent scroll repeat 0% 0%; MARGIN-BOTTOM: -1px; FONT: 100%/8px Tahoma; MARGIN-LEFT: 0px; BORDER-LEFT: medium none; COLOR: #000000; MARGIN-RIGHT: 0px; PADDING-TOP: 4px; BORDER-BOTTOM: medium none; POSITION: relative; BACKGROUND-COLOR: #000000}"| out-file -Append -encoding ASCII -filepath $Filename
6161
	Write-Output "	td {VERTICAL-ALIGN: TOP; FONT-FAMILY: Tahoma}"| out-file -Append -encoding ASCII -filepath $Filename
6262
	Write-Output "	th {VERTICAL-ALIGN: TOP; COLOR: #cc0000; TEXT-ALIGN: left}"| out-file -Append -encoding ASCII -filepath $Filename
6464
	Write-Output "</STYLE>"| out-file -Append -encoding ASCII -filepath $Filename
6666
	# ---------- End of Style Definition Section --------------------------------------------------------------------------
6767
	# ---------- Start of Control Script Section --------------------------------------------------------------------------
6969
	Write-Output "<SCRIPT language=vbscript>"| out-file -Append -encoding ASCII -filepath $Filename
7171
	# ---------- Declare Global Variables for Routines --------------------------------------------------------------------
7373
	Write-Output "	strShowHide = 1"| out-file -Append -encoding ASCII -filepath $Filename
7474
	Write-Output '	strShow = "show"'| out-file -Append -encoding ASCII -filepath $Filename
7575
	Write-Output '	strHide = "hide"'| out-file -Append -encoding ASCII -filepath $Filename
7676
	Write-Output '	strShowAll = "show all"'| out-file -Append -encoding ASCII -filepath $Filename
7777
	Write-Output '	strHideAll = "hide all"'| out-file -Append -encoding ASCII -filepath $Filename
7979
	Write-Output "Function window_onload()"| out-file -Append -encoding ASCII -filepath $Filename
8080
	Write-Output '	If UCase(document.documentElement.getAttribute("ES_auditInitialized")) <> "TRUE" Then'| out-file -Append -encoding ASCII -filepath $Filename
8181
	Write-Output "		Set objBody = document.body.all"| out-file -Append -encoding ASCII -filepath $Filename
8282
	Write-Output "		For Each obji in objBody"| out-file -Append -encoding ASCII -filepath $Filename
8383
	Write-Output "			If IsSectionHeader(obji) Then"| out-file -Append -encoding ASCII -filepath $Filename
8484
	Write-Output "				If IsSectionExpandedByDefault(obji) Then"| out-file -Append -encoding ASCII -filepath $Filename
8585
	Write-Output "					ShowSection obji"| out-file -Append -encoding ASCII -filepath $Filename
8686
	Write-Output "				Else"| out-file -Append -encoding ASCII -filepath $Filename
8787
	Write-Output "					HideSection obji"| out-file -Append -encoding ASCII -filepath $Filename
8888
	Write-Output "				End If"| out-file -Append -encoding ASCII -filepath $Filename
8989
	Write-Output "			End If"| out-file -Append -encoding ASCII -filepath $Filename
9090
	Write-Output "		Next"| out-file -Append -encoding ASCII -filepath $Filename
9191
	Write-Output "		objshowhide.innerText = strShowAll"| out-file -Append -encoding ASCII -filepath $Filename
9292
	Write-Output '		document.documentElement.setAttribute "ES_auditInitialized", "true"'| out-file -Append -encoding ASCII -filepath $Filename
9393
	Write-Output "	End If"| out-file -Append -encoding ASCII -filepath $Filename
9494
	Write-Output "End Function"| out-file -Append -encoding ASCII -filepath $Filename
9696
	Write-Output "Function IsSectionExpandedByDefault(objHeader)"| out-file -Append -encoding ASCII -filepath $Filename
9797
	Write-Output '	IsSectionExpandedByDefault = (Right(objHeader.className, Len("_expanded")) = "_expanded")'| out-file -Append -encoding ASCII -filepath $Filename
9898
	Write-Output "End Function"| out-file -Append -encoding ASCII -filepath $Filename
100100
	Write-Output "Function document_onclick()"| out-file -Append -encoding ASCII -filepath $Filename
101101
	Write-Output "	Set strsrc = window.event.srcElement"| out-file -Append -encoding ASCII -filepath $Filename
102102
	Write-Output '	While (strsrc.className = "sectionTitle" or strsrc.className = "expando")'| out-file -Append -encoding ASCII -filepath $Filename
103103
	Write-Output "		Set strsrc = strsrc.parentElement"| out-file -Append -encoding ASCII -filepath $Filename
104104
	Write-Output "	Wend"| out-file -Append -encoding ASCII -filepath $Filename
105105
	Write-Output "	If Not IsSectionHeader(strsrc) Then Exit Function"| out-file -Append -encoding ASCII -filepath $Filename
106106
	Write-Output "	ToggleSection strsrc"| out-file -Append -encoding ASCII -filepath $Filename
107107
	Write-Output "	window.event.returnValue = False"| out-file -Append -encoding ASCII -filepath $Filename
108108
	Write-Output "End Function"| out-file -Append -encoding ASCII -filepath $Filename
110110
	Write-Output "Sub ToggleSection(objHeader)"| out-file -Append -encoding ASCII -filepath $Filename
111111
	Write-Output '	SetSectionState objHeader, "toggle"'| out-file -Append -encoding ASCII -filepath $Filename
112112
	Write-Output "End Sub"| out-file -Append -encoding ASCII -filepath $Filename
114114
	Write-Output "Sub SetSectionState(objHeader, strState)"| out-file -Append -encoding ASCII -filepath $Filename
115115
	Write-Output "	i = objHeader.sourceIndex"| out-file -Append -encoding ASCII -filepath $Filename
116116
	Write-Output "	Set all = objHeader.parentElement.document.all"| out-file -Append -encoding ASCII -filepath $Filename
117117
	Write-Output '	While (all(i).className <> "container")'| out-file -Append -encoding ASCII -filepath $Filename
118118
	Write-Output "		i = i + 1"| out-file -Append -encoding ASCII -filepath $Filename
119119
	Write-Output "	Wend"| out-file -Append -encoding ASCII -filepath $Filename
120120
	Write-Output "	Set objContainer = all(i)"| out-file -Append -encoding ASCII -filepath $Filename
121121
	Write-Output '	If strState = "toggle" Then'| out-file -Append -encoding ASCII -filepath $Filename
122122
	Write-Output '		If objContainer.style.display = "none" Then'| out-file -Append -encoding ASCII -filepath $Filename
123123
	Write-Output '			SetSectionState objHeader, "show" '| out-file -Append -encoding ASCII -filepath $Filename
124124
	Write-Output "		Else"| out-file -Append -encoding ASCII -filepath $Filename
125125
	Write-Output '			SetSectionState objHeader, "hide" '| out-file -Append -encoding ASCII -filepath $Filename
126126
	Write-Output "		End If"| out-file -Append -encoding ASCII -filepath $Filename
127127
	Write-Output "	Else"| out-file -Append -encoding ASCII -filepath $Filename
128128
	Write-Output "		Set objExpando = objHeader.children.item(1)"| out-file -Append -encoding ASCII -filepath $Filename
129129
	Write-Output '		If strState = "show" Then'| out-file -Append -encoding ASCII -filepath $Filename
130130
	Write-Output '			objContainer.style.display = "block" '| out-file -Append -encoding ASCII -filepath $Filename
131131
	Write-Output "			objExpando.innerText = strHide"| out-file -Append -encoding ASCII -filepath $Filename
133133
	Write-Output '		ElseIf strState = "hide" Then'| out-file -Append -encoding ASCII -filepath $Filename
134134
	Write-Output '			objContainer.style.display = "none" '| out-file -Append -encoding ASCII -filepath $Filename
135135
	Write-Output "			objExpando.innerText = strShow"| out-file -Append -encoding ASCII -filepath $Filename
136136
	Write-Output "		End If"| out-file -Append -encoding ASCII -filepath $Filename
137137
	Write-Output "	End If"| out-file -Append -encoding ASCII -filepath $Filename
138138
	Write-Output "End Sub"| out-file -Append -encoding ASCII -filepath $Filename
140140
	Write-Output "Function objshowhide_onClick()"| out-file -Append -encoding ASCII -filepath $Filename
141141
	Write-Output "	Set objBody = document.body.all"| out-file -Append -encoding ASCII -filepath $Filename
142142
	Write-Output "	Select Case strShowHide"| out-file -Append -encoding ASCII -filepath $Filename
143143
	Write-Output "		Case 0"| out-file -Append -encoding ASCII -filepath $Filename
144144
	Write-Output "			strShowHide = 1"| out-file -Append -encoding ASCII -filepath $Filename
145145
	Write-Output "			objshowhide.innerText = strShowAll"| out-file -Append -encoding ASCII -filepath $Filename
146146
	Write-Output "			For Each obji In objBody"| out-file -Append -encoding ASCII -filepath $Filename
147147
	Write-Output "				If IsSectionHeader(obji) Then"| out-file -Append -encoding ASCII -filepath $Filename
148148
	Write-Output "					HideSection obji"| out-file -Append -encoding ASCII -filepath $Filename
149149
	Write-Output "				End If"| out-file -Append -encoding ASCII -filepath $Filename
150150
	Write-Output "			Next"| out-file -Append -encoding ASCII -filepath $Filename
151151
	Write-Output "		Case 1"| out-file -Append -encoding ASCII -filepath $Filename
152152
	Write-Output "			strShowHide = 0"| out-file -Append -encoding ASCII -filepath $Filename
153153
	Write-Output "			objshowhide.innerText = strHideAll"| out-file -Append -encoding ASCII -filepath $Filename
154154
	Write-Output "			For Each obji In objBody"| out-file -Append -encoding ASCII -filepath $Filename
155155
	Write-Output "				If IsSectionHeader(obji) Then"| out-file -Append -encoding ASCII -filepath $Filename
156156
	Write-Output "					ShowSection obji"| out-file -Append -encoding ASCII -filepath $Filename
157157
	Write-Output "				End If"| out-file -Append -encoding ASCII -filepath $Filename
158158
	Write-Output "			Next"| out-file -Append -encoding ASCII -filepath $Filename
159159
	Write-Output "	End Select"| out-file -Append -encoding ASCII -filepath $Filename
160160
	Write-Output "End Function"| out-file -Append -encoding ASCII -filepath $Filename
162162
	Write-Output 'Function IsSectionHeader(obj) : IsSectionHeader = (obj.className = "heading0_expanded") Or (obj.className = "heading1_expanded") Or (obj.className = "heading1") Or (obj.className = "heading2"): End Function'| out-file -Append -encoding ASCII -filepath $Filename
163163
	Write-Output 'Sub HideSection(objHeader) : SetSectionState objHeader, "hide" : End Sub'| out-file -Append -encoding ASCII -filepath $Filename
164164
	Write-Output 'Sub ShowSection(objHeader) : SetSectionState objHeader, "show": End Sub'| out-file -Append -encoding ASCII -filepath $Filename
166166
	Write-Output "</SCRIPT>"| out-file -Append -encoding ASCII -filepath $Filename
168168
	# ---------- End of Control Script Section ----------------------------------------------------------------------------
170170
	Write-Output "	</HEAD>"| out-file -Append -encoding ASCII -filepath $Filename
172172
	# ---------- End of Head Section --------------------------------------------------------------------------------------
174174
	# ---------- Start of Body Section ------------------------------------------------------------------------------------
177177
	Write-Output "<BODY>"| out-file -Append -encoding ASCII -filepath $Filename
178178
	Write-Output '	<p><b><font face="Arial" size="5">'$Target' Audit<hr size="8" color="#CC0000"></font></b>'| out-file -Append -encoding ASCII -filepath $Filename
179179
	Write-Output '	<font face="Arial" size="1"><b><i>Version 1.0 by Alan Renouf (Virtu-Al)</i></b></font><br>'| out-file -Append -encoding ASCII -filepath $Filename
180180
	Write-Output '	<font face="Arial" size="1">Report generated on ' (Get-Date) '</font></p>'| out-file -Append -encoding ASCII -filepath $Filename
182182
	Write-Output "<TABLE cellSpacing=0 cellPadding=0>"| out-file -Append -encoding ASCII -filepath $Filename
183183
	Write-Output "	<TBODY>"| out-file -Append -encoding ASCII -filepath $Filename
184184
	Write-Output "		<TR>"| out-file -Append -encoding ASCII -filepath $Filename
185185
	Write-Output "			<TD>"| out-file -Append -encoding ASCII -filepath $Filename
186186
	Write-Output "				<DIV id=objshowhide tabIndex=0><FONT face=Arial></FONT></DIV>"| out-file -Append -encoding ASCII -filepath $Filename
187187
	Write-Output "			</TD>"| out-file -Append -encoding ASCII -filepath $Filename
188188
	Write-Output "		</TR>"| out-file -Append -encoding ASCII -filepath $Filename
189189
	Write-Output "	</TBODY>"| out-file -Append -encoding ASCII -filepath $Filename
190190
	Write-Output "</TABLE>"| out-file -Append -encoding ASCII -filepath $Filename
192192
	write-output "Writing Detail for $Target"
193193
	$ComputerSystem = Get-WmiObject -computername $Target Win32_ComputerSystem
194194
	switch ($ComputerSystem.DomainRole)
195195
	{
196196
		0 { $ComputerRole = "Standalone Workstation" }
197197
		1 { $ComputerRole = "Member Workstation" }
198198
		2 { $ComputerRole = "Standalone Server" }
199199
		3 { $ComputerRole = "Member Server" }
200200
		4 { $ComputerRole = "Domain Controller" }
201201
		5 { $ComputerRole = "Domain Controller" }
202202
		default { $ComputerRole = "Information not available" }
203203
	}
205205
	$OperatingSystems = Get-WmiObject -computername $Target Win32_OperatingSystem
206206
	$TimeZone = Get-WmiObject -computername $Target Win32_Timezone
207207
	$Keyboards = Get-WmiObject -computername $Target Win32_Keyboard
208208
	$SchedTasks = Get-WmiObject -computername $Target Win32_ScheduledJob
210210
	$BootINI = $OperatingSystems.SystemDrive + "boot.ini"
212212
	$RecoveryOptions = Get-WmiObject -computername $Target Win32_OSRecoveryConfiguration
214214
	# ---------- Start of COMPUTER DETAILS Section HTML Code --------------------------------------------------------------
216216
	Write-Output "<DIV class=heading0_expanded>"| out-file -Append -encoding ASCII -filepath $Filename
217217
	Write-Output "	<SPAN class=sectionTitle tabIndex=0>$target Details</SPAN>"| out-file -Append -encoding ASCII -filepath $Filename
218218
	Write-Output "	<A class=expando href='#'></A>"| out-file -Append -encoding ASCII -filepath $Filename
219219
	Write-Output "</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
220220
	Write-Output "<DIV class=filler></DIV>"| out-file -Append -encoding ASCII -filepath $Filename
222222
	# ---------- Start of COMPUTER DETAILS - GENERAL Sub Section HTML Code ------------------------------------------------
223223
	write-output "..Computer Details"
225225
	Write-Output "<DIV class=container>"| out-file -Append -encoding ASCII -filepath $Filename
226226
	Write-Output "	<DIV class=heading1>"| out-file -Append -encoding ASCII -filepath $Filename
227227
	Write-Output "		<SPAN class=sectionTitle tabIndex=0>General</SPAN>"| out-file -Append -encoding ASCII -filepath $Filename
228228
	Write-Output "		<A class=expando href='#'></A>"| out-file -Append -encoding ASCII -filepath $Filename
229229
	Write-Output "	</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
230230
	Write-Output "	<DIV class=container>"| out-file -Append -encoding ASCII -filepath $Filename
231231
	Write-Output "		<DIV class=tableDetail>"| out-file -Append -encoding ASCII -filepath $Filename
232232
	Write-Output "			<TABLE>"| out-file -Append -encoding ASCII -filepath $Filename
233233
	Write-Output "				<tr>"| out-file -Append -encoding ASCII -filepath $Filename
234234
	Write-Output "					<th width='25%'><b>Computer Name</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
235235
	Write-Output "					<td width='75%'> " $ComputerSystem.Name "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
236236
	Write-Output "				</tr>"| out-file -Append -encoding ASCII -filepath $Filename
237237
	Write-Output "				<tr>"| out-file -Append -encoding ASCII -filepath $Filename
238238
	Write-Output "					<th width='25%'><b>Computer Role</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
239239
	Write-Output "					<td width='75%'> $ComputerRole </font></td>"| out-file -Append -encoding ASCII -filepath $Filename
240240
	Write-Output "				</tr>"| out-file -Append -encoding ASCII -filepath $Filename
241241
	Write-Output "				<tr>"| out-file -Append -encoding ASCII -filepath $Filename
243243
	switch ($ComputerRole)
244244
	{
245245
		"Member Workstation" { Write-Output "					<th width='25%'><b>Computer Domain</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename	}
246246
		"Domain Controller" { Write-Output "					<th width='25%'><b>Computer Domain</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename	 }
247247
		"Member Server" { Write-Output "					<th width='25%'><b>Computer Domain</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename	 }
248248
		default { Write-Output "					<th width='25%'><b>Computer Workgroup</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename}
249249
	}
251251
	Write-Output "					<td width='75%'>" $ComputerSystem.Domain "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
252252
	Write-Output "				</tr>"| out-file -Append -encoding ASCII -filepath $Filename
253253
	Write-Output "				<tr>"| out-file -Append -encoding ASCII -filepath $Filename
254254
	Write-Output "					<th width='25%'><b>Operating System</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
255255
	Write-Output "					<td width='75%'>" $OperatingSystems.Caption "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
256256
	Write-Output "				</tr>"| out-file -Append -encoding ASCII -filepath $Filename
257257
	Write-Output "				<tr>"| out-file -Append -encoding ASCII -filepath $Filename
258258
	Write-Output "					<th width='25%'><b>Service Pack</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
259259
	Write-Output "					<td width='75%'>" $OperatingSystems.CSDVersion "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
260260
	Write-Output "				</tr>"| out-file -Append -encoding ASCII -filepath $Filename
261261
	Write-Output "				<tr>"| out-file -Append -encoding ASCII -filepath $Filename
262262
	Write-Output "					<th width='25%'><b>System Root</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
263263
	Write-Output "					<td width='75%'>" $OperatingSystems.SystemDrive "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
264264
	Write-Output "				</tr>"| out-file -Append -encoding ASCII -filepath $Filename
265265
	Write-Output "				<tr>"| out-file -Append -encoding ASCII -filepath $Filename
266266
	Write-Output "					<th width='25%'><b>Manufacturer</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
267267
	Write-Output "					<td width='75%'>" $ComputerSystem.Manufacturer "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
268268
	Write-Output " 				</tr>"| out-file -Append -encoding ASCII -filepath $Filename
269269
	Write-Output "				<tr>"| out-file -Append -encoding ASCII -filepath $Filename
270270
	Write-Output "					<th width='25%'><b>Model</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
271271
	Write-Output "					<td width='75%'>" $ComputerSystem.Model "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
272272
	Write-Output " 				</tr>"| out-file -Append -encoding ASCII -filepath $Filename
273273
	Write-Output "				<tr>"| out-file -Append -encoding ASCII -filepath $Filename
274274
	Write-Output "					<th width='25%'><b>Number of Processors</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
275275
	Write-Output "					<td width='75%'>" $ComputerSystem.NumberOfProcessors "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
276276
	Write-Output " 				</tr>"| out-file -Append -encoding ASCII -filepath $Filename
277277
	Write-Output "				<tr>"| out-file -Append -encoding ASCII -filepath $Filename
278278
	Write-Output "					<th width='25%'><b>Memory</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
279279
	Write-Output "					<td width='75%'>" $ComputerSystem.TotalPhysicalMemory "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
280280
	Write-Output " 				</tr>"| out-file -Append -encoding ASCII -filepath $Filename
281281
	Write-Output "				<tr>"| out-file -Append -encoding ASCII -filepath $Filename
282282
	Write-Output "					<th width='25%'><b>Registered User</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
283283
	Write-Output "					<td width='75%'>" $ComputerSystem.PrimaryOwnerName "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
284284
	Write-Output " 				</tr>"| out-file -Append -encoding ASCII -filepath $Filename
285285
	Write-Output " 				<tr>"| out-file -Append -encoding ASCII -filepath $Filename
286286
	Write-Output "					<th width='25%'><b>Registered Organisation</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
287287
	Write-Output "					<td width='75%'>" $OperatingSystems.Organization "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
288288
	Write-Output "				</tr>"| out-file -Append -encoding ASCII -filepath $Filename
289289
	Write-Output "  				<tr>"| out-file -Append -encoding ASCII -filepath $Filename
290290
	Write-Output "   				<th width='25%'><b>Last System Boot</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
291291
	$LBTime=$OperatingSystems.ConvertToDateTime($OperatingSystems.Lastbootuptime)
292292
	Write-Output "					<td width='75%'>" $LBTime "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
293293
	Write-Output "				</tr>"| out-file -Append -encoding ASCII -filepath $Filename
294294
	Write-Output "			</TABLE>"| out-file -Append -encoding ASCII -filepath $Filename
295295
	Write-Output "		</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
296296
	Write-Output "	</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
297297
	Write-Output "	<DIV class=filler></DIV>"| out-file -Append -encoding ASCII -filepath $Filename
299299
	#---------- End of COMPUTER DETAILS - GENERAL Sub-section HTML Code --------------------------------------------------
301301
	# ---------- Start of COMPUTER DETAILS - HOFIXES Sub-section HTML Code ------------------------------------------------
303303
	write-output "..Hotfix Information"
305305
	$colQuickFixes = Get-WmiObject Win32_QuickFixEngineering
307307
	Write-Output "	<DIV class=container>"| out-file -Append -encoding ASCII -filepath $Filename
308308
	Write-Output "		<DIV class=heading1>"| out-file -Append -encoding ASCII -filepath $Filename
309309
	Write-Output "			<SPAN class=sectionTitle tabIndex=0>HotFixes</SPAN>"| out-file -Append -encoding ASCII -filepath $Filename
310310
	Write-Output "			<A class=expando href='#'></A>"| out-file -Append -encoding ASCII -filepath $Filename
311311
	Write-Output "		</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
312312
	Write-Output "		<DIV class=container>"| out-file -Append -encoding ASCII -filepath $Filename
313313
	Write-Output "			<DIV class=tableDetail>"| out-file -Append -encoding ASCII -filepath $Filename
314314
	Write-Output "				<TABLE>"| out-file -Append -encoding ASCII -filepath $Filename
315315
	Write-Output "					<tr>"| out-file -Append -encoding ASCII -filepath $Filename
316316
	Write-Output "  						<th width='25%'><b>HotFix Number</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
317317
	Write-Output "  						<th width='75%'><b>Description</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
318318
	Write-Output "					</tr>"| out-file -Append -encoding ASCII -filepath $Filename
320320
	ForEach ($objQuickFix in $colQuickFixes)
321321
	{
322322
		if ($objQuickFix.HotFixID -ne "File 1")
323323
		{
324324
			Write-Output "				<tr>"| out-file -Append -encoding ASCII -filepath $Filename
325325
			Write-Output "					<td width='25%'>" $objQuickFix.HotFixID "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
326326
			Write-Output "					<td width='75%'>" $objQuickFix.Description "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
327327
			Write-Output "				</tr>"| out-file -Append -encoding ASCII -filepath $Filename
328328
		}
329329
	}
330330
	Write-Output "				</TABLE>"| out-file -Append -encoding ASCII -filepath $Filename
331331
	Write-Output "			</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
332332
	Write-Output "		</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
333333
	Write-Output "	</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
334334
	Write-Output "	<DIV class=filler></DIV>"| out-file -Append -encoding ASCII -filepath $Filename
336336
	#---------- End of COMPUTER DETAILS - HOFIXES Sub-section HTML Code --------------------------------------------------
338338
	#---------- Start of COMPUTER DETAILS - LOGICAL DISK CONFIGURATION Sub-section HTML Code -----------------------------
340340
	write-output "..Logical Disks"
342342
	$colDisks = Get-WmiObject -ComputerName $Target Win32_LogicalDisk
344344
	Write-Output "	<DIV class=container>"| out-file -Append -encoding ASCII -filepath $Filename
345345
	Write-Output "		<DIV class=heading1>"| out-file -Append -encoding ASCII -filepath $Filename
346346
	Write-Output "			<SPAN class=sectionTitle tabIndex=0>Logical Disk Configuration</SPAN>"| out-file -Append -encoding ASCII -filepath $Filename
347347
	Write-Output "			<A class=expando href='#'></A>"| out-file -Append -encoding ASCII -filepath $Filename
348348
	Write-Output "		</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
349349
	Write-Output "		<DIV class=container>"| out-file -Append -encoding ASCII -filepath $Filename
350350
	Write-Output "			<DIV class=tableDetail>"| out-file -Append -encoding ASCII -filepath $Filename
351351
	Write-Output "				<TABLE>"| out-file -Append -encoding ASCII -filepath $Filename
352352
	Write-Output "					<tr>"| out-file -Append -encoding ASCII -filepath $Filename
353353
	Write-Output "  						<th width='15%'><b>Drive Letter</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
354354
	Write-Output "  						<th width='20%'><b>Label</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
355355
	Write-Output "  						<th width='20%'><b>File System</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
356356
	Write-Output "  						<th width='15%'><b>Disk Size</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
357357
	Write-Output "  						<th width='15%'><b>Disk Free Space</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
358358
	Write-Output "  						<th width='15%'><b>% Free Space</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
359359
	Write-Output "  					</tr>"| out-file -Append -encoding ASCII -filepath $Filename
361361
	Foreach ($objDisk in $colDisks)
362362
	{
363363
		if ($objDisk.DriveType -eq 3)
364364
		{
365365
			Write-Output "					<tr>"| out-file -Append -encoding ASCII -filepath $Filename
366366
			Write-Output "						<td width='15%'>"$objDisk.DeviceID"</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
367367
			Write-Output " 						<td width='20%'>"$objDisk.VolumeName"</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
368368
			Write-Output " 						<td width='20%'>"$objDisk.FileSystem"</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
369369
			$disksize = [math]::round(($objDisk.size / 1048576))
370370
			Write-Output " 						<td width='15%'>"$disksize" MB</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
371371
			$freespace = [math]::round(($objDisk.FreeSpace / 1048576))
372372
			Write-Output " 						<td width='15%'>"$Freespace" MB</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
373373
			$percFreespace=[math]::round(((($objDisk.FreeSpace / 1048576)/($objDisk.Size / 1048676)) * 100),0)
374374
			Write-Output " 						<td width='15%'>"$percFreespace" %</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
375375
			Write-Output "					</tr>"| out-file -Append -encoding ASCII -filepath $Filename
376376
		}
377377
	}
379379
	Write-Output "				</TABLE>"| out-file -Append -encoding ASCII -filepath $Filename
380380
	Write-Output "			</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
381381
	Write-Output "		</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
382382
	Write-Output "	</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
383383
	Write-Output "	<DIV class=filler></DIV>"| out-file -Append -encoding ASCII -filepath $Filename
385385
	# ---------- End of COMPUTER DETAILS - LOGICAL DISK CONFIGURATION Sub-section HTML Code -------------------------------
386386
	# ---------- Start of COMPUTER DETAILS - NIC CONFIGURATION Sub-section HTML Code --------------------------------------
388388
	write-output "..Network Configuration"
390390
	$NICCount = 0
391391
	$colAdapters = Get-WmiObject -ComputerName $Target Win32_NetworkAdapterConfiguration
393393
	Write-Output "	<DIV class=container>"| out-file -Append -encoding ASCII -filepath $Filename
394394
	Write-Output "		<DIV class=heading1>"| out-file -Append -encoding ASCII -filepath $Filename
395395
	Write-Output "			<SPAN class=sectionTitle tabIndex=0>NIC Configuration</SPAN>"| out-file -Append -encoding ASCII -filepath $Filename
396396
	Write-Output "			<A class=expando href='#'></A>"| out-file -Append -encoding ASCII -filepath $Filename
397397
	Write-Output "		</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
398398
	Write-Output "		<DIV class=container>"| out-file -Append -encoding ASCII -filepath $Filename
399399
	Write-Output "			<DIV class=tableDetail>"| out-file -Append -encoding ASCII -filepath $Filename
400400
	Write-Output "				<TABLE>"| out-file -Append -encoding ASCII -filepath $Filename
402402
	$NICCount = 0
403403
	Foreach ($objAdapter in $colAdapters)
404404
	{
405405
		if ($objAdapter.IPEnabled -eq "True")
406406
		{
407407
			$NICCount = $NICCount + 1
408408
			If ($NICCount -gt 1)
409409
			{
410410
				Write-Output "			</TABLE>"| out-file -Append -encoding ASCII -filepath $Filename
411411
				Write-Output "				<DIV class=Solidfiller></DIV>"| out-file -Append -encoding ASCII -filepath $Filename
412412
				Write-Output "			<TABLE>"| out-file -Append -encoding ASCII -filepath $Filename
413413
			}
414414
		Write-Output "  					<tr>"| out-file -Append -encoding ASCII -filepath $Filename
415415
		Write-Output "	 					<th width='25%'><b>Description</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
416416
		Write-Output "    					<td width='75%'>" $objAdapter.Description "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
417417
		Write-Output "  					</tr>"| out-file -Append -encoding ASCII -filepath $Filename
418418
		Write-Output "  					<tr>"| out-file -Append -encoding ASCII -filepath $Filename
419419
		Write-Output "						<th width='25%'><b>Physical address</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
420420
		Write-Output "						<td width='75%'>" $objAdapter.MACaddress "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
421421
		Write-Output " 					</tr>"| out-file -Append -encoding ASCII -filepath $Filename
422422
		If ($objAdapter.IPAddress -ne $Null)
423423
		{
424424
			Write-Output "					<tr>"| out-file -Append -encoding ASCII -filepath $Filename
425425
			Write-Output "						<th width='25%'><b>IP Address / Subnet Mask</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
426426
			Write-Output "						<td width='75%'>" $objAdapter.IPAddress " / " $objAdapter.IPSubnet "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
427427
			Write-Output "					</tr>"| out-file -Append -encoding ASCII -filepath $Filename
428428
			Write-Output "					</tr>"| out-file -Append -encoding ASCII -filepath $Filename
429429
			Write-Output "					<tr>"| out-file -Append -encoding ASCII -filepath $Filename
430430
			Write-Output "						<th width='25%'><b>Default Gateway</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
431431
			Write-Output "						<td width='75%'>" $objAdapter.DefaultIPGateway "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
432432
			Write-Output "					</tr>"| out-file -Append -encoding ASCII -filepath $Filename
434434
		}
435435
		Write-Output "					<tr>"| out-file -Append -encoding ASCII -filepath $Filename
436436
		Write-Output "						<th width='25%'><b>DHCP enabled</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
437437
		If ($objAdapter.DHCPEnabled -eq "True")
438438
		{
439439
			Write-Output "						<td width='75%'>Yes</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
440440
		}
441441
		Else
442442
		{
443443
			Write-Output "						<td width='75%'>No</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
444444
		}
445445
		Write-Output "					</tr>"| out-file -Append -encoding ASCII -filepath $Filename
446446
		Write-Output "					<tr>"| out-file -Append -encoding ASCII -filepath $Filename
447447
		Write-Output "							<th width='25%'><b>DNS Servers</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
448448
		Write-Output "							<td width='75%'>"| out-file -Append -encoding ASCII -filepath $Filename
449449
		If ($objAdapter.DNSServerSearchOrder -ne $Null)
450450
		{
451451
			Write-Output $objAdapter.DNSServerSearchOrder | out-file -Append -encoding ASCII -filepath $Filename
452452
		}
453453
		Write-Output "					</tr>"| out-file -Append -encoding ASCII -filepath $Filename
454454
		Write-Output "					<tr>"| out-file -Append -encoding ASCII -filepath $Filename
455455
		Write-Output "						<th width='25%'><b>Primary WINS Server</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
456456
		Write-Output "						<td width='75%'>" $objAdapter.WINSPrimaryServer "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
457457
		Write-Output "					</tr>"| out-file -Append -encoding ASCII -filepath $Filename
458458
		Write-Output "					<tr>"| out-file -Append -encoding ASCII -filepath $Filename
459459
		Write-Output "						<th width='25%'><b>Secondary WINS Server</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
460460
		Write-Output "						<td width='75%'>" $objAdapter.WINSSecondaryServer "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
461461
		Write-Output "					</tr>"| out-file -Append -encoding ASCII -filepath $Filename
462462
		$NICCount = $NICCount + 1
463463
		}
464464
	}
465465
	Write-Output "				</TABLE>"| out-file -Append -encoding ASCII -filepath $Filename
466466
	Write-Output "			</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
467467
	Write-Output "		</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
468468
	Write-Output "	</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
469469
	Write-Output "	<DIV class=filler></DIV>"| out-file -Append -encoding ASCII -filepath $Filename
471471
	#---------- End of COMPUTER DETAILS - NIC CONFIGURATION Sub-section HTML Code ----------------------------------------
473473
	#---------- Start of COMPUTER DETAILS - Software Sub-section HTML Code -------------------------------------------
475475
	if ((get-wmiobject -namespace "root/cimv2" -list) | ? {$_.name -match "Win32_Product"})
476476
	{
477477
		write-output "..Installed Software"
479479
		$colShares = get-wmiobject -ComputerName $Target Win32_Product | select Name,Version,Vendor,InstallDate
481481
		Write-Output "	<DIV class=container>"| out-file -Append -encoding ASCII -filepath $Filename
482482
		Write-Output "		<DIV class=heading1>"| out-file -Append -encoding ASCII -filepath $Filename
483483
		Write-Output "			<SPAN class=sectionTitle tabIndex=0>Software</SPAN>"| out-file -Append -encoding ASCII -filepath $Filename
484484
		Write-Output "			<A class=expando href='#'></A>"| out-file -Append -encoding ASCII -filepath $Filename
485485
		Write-Output "		</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
486486
		Write-Output "		<DIV class=container>"| out-file -Append -encoding ASCII -filepath $Filename
487487
		Write-Output "			<DIV class=tableDetail>"| out-file -Append -encoding ASCII -filepath $Filename
488488
		Write-Output "				<TABLE>"| out-file -Append -encoding ASCII -filepath $Filename
489489
		Write-Output "					<tr>"| out-file -Append -encoding ASCII -filepath $Filename
490490
		Write-Output "  						<th width='25%'><b>Name</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
491491
		Write-Output "  						<th width='25%'><b>Version</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
492492
		Write-Output "  						<th width='25%'><b>Vendor</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
493493
		Write-Output "  						<th width='25%'><b>Install Date</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
494494
		Write-Output "					</tr>"| out-file -Append -encoding ASCII -filepath $Filename
496496
		Foreach ($objShare in $colShares)
497497
		{
498498
			Write-Output "					<tr>"| out-file -Append -encoding ASCII -filepath $Filename
499499
			Write-Output "						<td width='50%'>" $objShare.Name "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
500500
			Write-Output "						<td width='20%'>" $objShare.Version "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
501501
			Write-Output "						<td width='15%'>" $objShare.Vendor "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
502502
			Write-Output "						<td width='15%'>" $objShare.InstallDate "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
503503
			Write-Output "					</tr>"| out-file -Append -encoding ASCII -filepath $Filename
504504
		}
505505
		Write-Output "				</TABLE>"| out-file -Append -encoding ASCII -filepath $Filename
506506
		Write-Output "			</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
507507
		Write-Output "		</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
508508
		Write-Output "	</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
509509
		Write-Output "	<DIV class=filler></DIV>"| out-file -Append -encoding ASCII -filepath $Filename
511511
	}
512512
	# ---------- End of COMPUTER DETAILS - Software Sub-section HTML Code ---------------------------------------------
514514
	#---------- Start of COMPUTER DETAILS - LOCAL SHARES Sub-section HTML Code -------------------------------------------
516516
	write-output "..Local Shares"
518518
	$colShares = Get-wmiobject -ComputerName $Target Win32_Share
520520
	Write-Output "	<DIV class=container>"| out-file -Append -encoding ASCII -filepath $Filename
521521
	Write-Output "		<DIV class=heading1>"| out-file -Append -encoding ASCII -filepath $Filename
522522
	Write-Output "			<SPAN class=sectionTitle tabIndex=0>Local Shares</SPAN>"| out-file -Append -encoding ASCII -filepath $Filename
523523
	Write-Output "			<A class=expando href='#'></A>"| out-file -Append -encoding ASCII -filepath $Filename
524524
	Write-Output "		</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
525525
	Write-Output "		<DIV class=container>"| out-file -Append -encoding ASCII -filepath $Filename
526526
	Write-Output "			<DIV class=tableDetail>"| out-file -Append -encoding ASCII -filepath $Filename
527527
	Write-Output "				<TABLE>"| out-file -Append -encoding ASCII -filepath $Filename
528528
	Write-Output "					<tr>"| out-file -Append -encoding ASCII -filepath $Filename
529529
	Write-Output "  						<th width='25%'><b>Share</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
530530
	Write-Output "  						<th width='25%'><b>Path</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
531531
	Write-Output "  						<th width='50%'><b>Comment</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
532532
	Write-Output "					</tr>"| out-file -Append -encoding ASCII -filepath $Filename
534534
	Foreach ($objShare in $colShares)
535535
	{
536536
		Write-Output "					<tr>"| out-file -Append -encoding ASCII -filepath $Filename
537537
		Write-Output "						<td width='25%'>" $objShare.Name "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
538538
		Write-Output "						<td width='25%'>" $objShare.Path "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
539539
		Write-Output "						<td width='50%'>" $objShare.Caption "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
540540
		Write-Output "					</tr>"| out-file -Append -encoding ASCII -filepath $Filename
541541
	}
542542
	Write-Output "				</TABLE>"| out-file -Append -encoding ASCII -filepath $Filename
543543
	Write-Output "			</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
544544
	Write-Output "		</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
545545
	Write-Output "	</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
546546
	Write-Output "	<DIV class=filler></DIV>"| out-file -Append -encoding ASCII -filepath $Filename
548548
	#---------- End of COMPUTER DETAILS - LOCAL SHARES Sub-section HTML Code ---------------------------------------------
550550
	#---------- Start of COMPUTER DETAILS - PRINTERS Sub-section HTML Code -----------------------------------------------
552552
	Write-output "..Printers"
554554
	$colInstalledPrinters =  Get-WmiObject -ComputerName $Target Win32_Printer
556556
	Write-Output "	<DIV class=container>"| out-file -Append -encoding ASCII -filepath $Filename
557557
	Write-Output "		<DIV class=heading1>"| out-file -Append -encoding ASCII -filepath $Filename
558558
	Write-Output "			<SPAN class=sectionTitle tabIndex=0>Printers</SPAN>"| out-file -Append -encoding ASCII -filepath $Filename
559559
	Write-Output "			<A class=expando href='#'></A>"| out-file -Append -encoding ASCII -filepath $Filename
560560
	Write-Output "		</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
561561
	Write-Output "		<DIV class=container>"| out-file -Append -encoding ASCII -filepath $Filename
562562
	Write-Output "			<DIV class=tableDetail>"| out-file -Append -encoding ASCII -filepath $Filename
563563
	Write-Output "				<TABLE>"| out-file -Append -encoding ASCII -filepath $Filename
564564
	Write-Output "					<tr>"| out-file -Append -encoding ASCII -filepath $Filename
565565
	Write-Output "						<th width='25%'><b>Printer</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
566566
	Write-Output "						<th width='25%'><b>Location</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
567567
	Write-Output "						<th width='25%'><b>Default Printer</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
568568
	Write-Output "						<th width='25%'><b>Portname</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
569569
	Write-Output "					</tr>"| out-file -Append -encoding ASCII -filepath $Filename
571571
	Foreach ($objPrinter in $colInstalledPrinters)
572572
	{
573573
		If ($objPrinter.Name -eq "")
574574
		{
575575
			Write-Output "					<tr>"| out-file -Append -encoding ASCII -filepath $Filename
576576
			Write-Output "						<td width='100%'>No Printers Installed</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
577577
		}
578578
		Else
579579
		{
580580
			Write-Output "					<tr>"| out-file -Append -encoding ASCII -filepath $Filename
581581
			Write-Output "						<td width='25%'>" $objPrinter.Name "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
582582
			Write-Output "						<td width='25%'>" $objPrinter.Location "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
583583
			if ($objPrinter.Default -eq "True")
584584
			{
585585
				Write-Output "						<td width='25%'>Yes</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
586586
			}
587587
			Else
588588
			{
589589
				Write-Output "						<td width='25%'>No</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
590590
			}
591591
			Write-Output "						<td width='25%'>"$objPrinter.Portname"</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
592592
		}
593593
		Write-Output "					</tr>"| out-file -Append -encoding ASCII -filepath $Filename
594594
	}
595595
	Write-Output "				</TABLE>"| out-file -Append -encoding ASCII -filepath $Filename
596596
	Write-Output "			</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
597597
	Write-Output "		</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
598598
	Write-Output "	</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
599599
	Write-Output "	<DIV class=filler></DIV>"| out-file -Append -encoding ASCII -filepath $Filename
601601
	#---------- End of COMPUTER DETAILS - PRINTERS Sub-section HTML Code -------------------------------------------------
603603
	#---------- Start of COMPUTER DETAILS - SERVICES Sub-section HTML Code -----------------------------------------------
605605
	Write-Output "..Services"
607607
	$colListOfServices = Get-WmiObject -ComputerName $Target Win32_Service
609609
	Write-Output "	<DIV class=container>"| out-file -Append -encoding ASCII -filepath $Filename
610610
	Write-Output "		<DIV class=heading1>"| out-file -Append -encoding ASCII -filepath $Filename
611611
	Write-Output "			<SPAN class=sectionTitle tabIndex=0>Services</SPAN>"| out-file -Append -encoding ASCII -filepath $Filename
612612
	Write-Output "			<A class=expando href='#'></A>"| out-file -Append -encoding ASCII -filepath $Filename
613613
	Write-Output "		</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
614614
	Write-Output "		<DIV class=container>"| out-file -Append -encoding ASCII -filepath $Filename
615615
	Write-Output "			<DIV class=tableDetail>"| out-file -Append -encoding ASCII -filepath $Filename
616616
	Write-Output "				<TABLE>"| out-file -Append -encoding ASCII -filepath $Filename
617617
	Write-Output "  					<tr>"| out-file -Append -encoding ASCII -filepath $Filename
618618
	Write-Output "	 					<th width='20%'><b>Name</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
619619
	Write-Output "	 					<th width='20%'><b>Account</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
620620
	Write-Output "	 					<th width='20%'><b>Start Mode</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
621621
	Write-Output "	 					<th width='20%'><b>State</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
622622
	Write-Output "	 					<th width='20%'><b>Expected State</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
623623
	Write-Output "  					</tr>"| out-file -Append -encoding ASCII -filepath $Filename
625625
	Foreach ($objService in $colListOfServices)
626626
	{
627627
		Write-Output " 					<tr>"| out-file -Append -encoding ASCII -filepath $Filename
628628
		Write-Output "	 					<td width='20%'>"$objService.Caption"</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
629629
		Write-Output "	 					<td width='20%'>"$objService.Startname"</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
630630
		Write-Output "	 					<td width='20%'>"$objService.StartMode"</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
631631
		If ($objService.StartMode -eq "Auto")
632632
		{
633633
			if ($objService.State -eq "Stopped")
634634
			{
635635
				Write-Output "						<td width='20%'><font color='#FF0000'>"$objService.State"</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
636636
637637
			}
638638
		}
639639
		If ($objService.StartMode -eq "Auto")
640640
		{
641641
			if ($objService.State -eq "Running")
642642
			{
643643
				Write-Output "						<td width='20%'><font color='#009900'>"$objService.State"</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
644644
645645
			}
646646
		}
647647
		If ($objService.StartMode -eq "Disabled")
648648
		{
649649
			If ($objService.State -eq "Running")
650650
			{
651651
				Write-Output "						<td width='20%'><font color='#FF0000'>"$objService.State"</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
652652
653653
			}
654654
		}
655655
		If ($objService.StartMode -eq "Disabled")
656656
		{
657657
			if ($objService.State -eq "Stopped")
658658
			{
659659
				Write-Output "						<td width='20%'><font color='#009900'>"$objService.State"</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
660660
661661
			}
662662
		}
663663
		If ($objService.StartMode -eq "Manual")
664664
		{
665665
			Write-Output "						<td width='20%'><font color='#009900'>"$objService.State"</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
666666
667667
		}
668668
		If ($objService.State -eq "Paused")
669669
		{
670670
			Write-Output "						<td width='20%'><font color='#FF9933'>"$objService.State"</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
671671
672672
		}
673673
		Write-Output "  					</tr>"| out-file -Append -encoding ASCII -filepath $Filename
674674
	}
675675
	Write-Output "				</TABLE>"| out-file -Append -encoding ASCII -filepath $Filename
676676
	Write-Output "			</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
677677
	Write-Output "		</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
678678
	Write-Output "	</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
679679
	Write-Output "	<DIV class=filler></DIV>"| out-file -Append -encoding ASCII -filepath $Filename
681681
	#---------- End of COMPUTER DETAILS - SERVICES Sub-section HTML Code -------------------------------------------------
683683
	#---------- Start of COMPUTER DETAILS - REGIONAL SETTINGS Sub-section HTML Code --------------------------------------
685685
	Write-Output "..Regional Options"
687687
	$ObjKeyboards = Get-WmiObject -ComputerName $Target Win32_Keyboard
689689
	Write-Output "	<DIV class=container>"| out-file -Append -encoding ASCII -filepath $Filename
690690
	Write-Output "		<DIV class=heading1>"| out-file -Append -encoding ASCII -filepath $Filename
691691
	Write-Output "			<SPAN class=sectionTitle tabIndex=0>Regional Settings</SPAN>"| out-file -Append -encoding ASCII -filepath $Filename
692692
	Write-Output "			<A class=expando href='#'></A>"| out-file -Append -encoding ASCII -filepath $Filename
693693
	Write-Output "		</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
694694
	Write-Output "		<DIV class=container>"| out-file -Append -encoding ASCII -filepath $Filename
695695
	Write-Output "			<DIV class=tableDetail>"| out-file -Append -encoding ASCII -filepath $Filename
696696
	Write-Output "				<TABLE>"| out-file -Append -encoding ASCII -filepath $Filename
697697
	Write-Output " 					<tr>"| out-file -Append -encoding ASCII -filepath $Filename
698698
	Write-Output "	 					<th width='25%'><b>Time Zone</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
699699
	Write-Output "	 					<td width='75%'>" $TimeZone.Description "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
700700
	Write-Output " 					</tr>"| out-file -Append -encoding ASCII -filepath $Filename
701701
	Write-Output " 					<tr>"| out-file -Append -encoding ASCII -filepath $Filename
702702
	Write-Output "	 					<th width='25%'><b>Country Code</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
703703
	Write-Output "	 					<td width='75%'>" $OperatingSystems.Countrycode "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
704704
	Write-Output " 					</tr>"| out-file -Append -encoding ASCII -filepath $Filename
705705
	Write-Output " 					<tr>"| out-file -Append -encoding ASCII -filepath $Filename
706706
	Write-Output "		 				<th width='25%'><b>Locale</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
707707
	Write-Output "		 				<td width='75%'>" $OperatingSystems.Locale"</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
708708
	Write-Output " 					</tr>"| out-file -Append -encoding ASCII -filepath $Filename
709709
	Write-Output " 					<tr>"| out-file -Append -encoding ASCII -filepath $Filename
710710
	Write-Output "		 				<th width='25%'><b>Operating System Language</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
711711
	Write-Output "		 				<td width='75%'>" $OperatingSystems.OSLanguage"</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
712712
	Write-Output " 					</tr>"| out-file -Append -encoding ASCII -filepath $Filename
713713
	Write-Output " 					<tr>"| out-file -Append -encoding ASCII -filepath $Filename
715715
	switch ($ObjKeyboards.Layout)
716716
	{
717717
		"00000402"{ $keyb = "BG" }
718718
		"00000404"{ $keyb = "CH" }
719719
		"00000405"{ $keyb = "CZ" }
720720
		"00000406"{ $keyb = "DK" }
721721
		"00000407"{ $keyb = "GR" }
722722
		"00000408"{ $keyb = "GK" }
723723
		"00000409"{ $keyb = "US" }
724724
		"0000040A"{ $keyb = "SP" }
725725
		"0000040B"{ $keyb = "SU" }
726726
		"0000040C"{ $keyb = "FR" }
727727
		"0000040E"{ $keyb = "HU" }
728728
		"0000040F"{ $keyb = "IS" }
729729
		"00000410"{ $keyb = "IT" }
730730
		"00000411"{ $keyb = "JP" }
731731
		"00000412"{ $keyb = "KO" }
732732
		"00000413"{ $keyb = "NL" }
733733
		"00000414"{ $keyb = "NO" }
734734
		"00000415"{ $keyb = "PL" }
735735
		"00000416"{ $keyb = "BR" }
736736
		"00000418"{ $keyb = "RO" }
737737
		"00000419"{ $keyb = "RU" }
738738
		"0000041A"{ $keyb = "YU" }
739739
		"0000041B"{ $keyb = "SL" }
740740
		"0000041C"{ $keyb = "US" }
741741
		"0000041D"{ $keyb = "SV" }
742742
		"0000041F"{ $keyb = "TR" }
743743
		"00000422"{ $keyb = "US" }
744744
		"00000423"{ $keyb = "US" }
745745
		"00000424"{ $keyb = "YU" }
746746
		"00000425"{ $keyb = "ET" }
747747
		"00000426"{ $keyb = "US" }
748748
		"00000427"{ $keyb = "US" }
749749
		"00000804"{ $keyb = "CH" }
750750
		"00000809"{ $keyb = "UK" }
751751
		"0000080A"{ $keyb = "LA" }
752752
		"0000080C"{ $keyb = "BE" }
753753
		"00000813"{ $keyb = "BE" }
754754
		"00000816"{ $keyb = "PO" }
755755
		"00000C0C"{ $keyb = "CF" }
756756
		"00000C1A"{ $keyb = "US" }
757757
		"00001009"{ $keyb = "US" }
758758
		"0000100C"{ $keyb = "SF" }
759759
		"00001809"{ $keyb = "US" }
760760
		"00010402"{ $keyb = "US" }
761761
		"00010405"{ $keyb = "CZ" }
762762
		"00010407"{ $keyb = "GR" }
763763
		"00010408"{ $keyb = "GK" }
764764
		"00010409"{ $keyb = "DV" }
765765
		"0001040A"{ $keyb = "SP" }
766766
		"0001040E"{ $keyb = "HU" }
767767
		"00010410"{ $keyb = "IT" }
768768
		"00010415"{ $keyb = "PL" }
769769
		"00010419"{ $keyb = "RU" }
770770
		"0001041B"{ $keyb = "SL" }
771771
		"0001041F"{ $keyb = "TR" }
772772
		"00010426"{ $keyb = "US" }
773773
		"00010C0C"{ $keyb = "CF" }
774774
		"00010C1A"{ $keyb = "US" }
775775
		"00020408"{ $keyb = "GK" }
776776
		"00020409"{ $keyb = "US" }
777777
		"00030409"{ $keyb = "USL" }
778778
		"00040409"{ $keyb = "USR" }
779779
		"00050408"{ $keyb = "GK" }
780780
		default { $keyb = "Unknown" }
781781
	}
784784
	Write-Output "		 				<th width='25%'><b>Keyboard Layout</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
785785
	Write-Output "		 				<td width='75%'>" $keyb "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
786786
	Write-Output " 					</tr>"| out-file -Append -encoding ASCII -filepath $Filename
787787
	Write-Output "				</TABLE>"| out-file -Append -encoding ASCII -filepath $Filename
788788
	Write-Output "			</div>"| out-file -Append -encoding ASCII -filepath $Filename
789789
	Write-Output "		</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
790790
	Write-Output "	</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
791791
	Write-Output "	<DIV class=filler></DIV>"| out-file -Append -encoding ASCII -filepath $Filename
793793
	#---------- End of COMPUTER DETAILS - REGIONAL SETTINGS Sub-section HTML Code ----------------------------------------
794794
	#---------- Start of COMPUTER DETAILS - EVENT LOGS Sub-section HTML Code ---------------------------------------------
795795
	Write-Output "	<DIV class=container>"| out-file -Append -encoding ASCII -filepath $Filename
796796
	Write-Output "		<DIV class=heading1>"| out-file -Append -encoding ASCII -filepath $Filename
797797
	Write-Output "			<SPAN class=sectionTitle tabIndex=0>Event Logs</SPAN>"| out-file -Append -encoding ASCII -filepath $Filename
798798
	Write-Output "			<A class=expando href='#'></A>"| out-file -Append -encoding ASCII -filepath $Filename
799799
	Write-Output "		</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
800800
	Write-Output "		<DIV class=container>"| out-file -Append -encoding ASCII -filepath $Filename
801801
	Write-Output "			<DIV class=tableDetail>"| out-file -Append -encoding ASCII -filepath $Filename
803803
	#---------- Start of COMPUTER DETAILS - EVENT LOGS - EVENT LOG SETTINGS Sub-section HTML Code ------------------------
805805
	Write-Output "..Event Log Settings"
807807
	$colLogFiles = Get-WmiObject -ComputerName $Target Win32_NTEventLogFile
809809
	Write-Output "	<DIV class=container>"| out-file -Append -encoding ASCII -filepath $Filename
810810
	Write-Output "		<DIV class=heading2>"| out-file -Append -encoding ASCII -filepath $Filename
811811
	Write-Output "			<SPAN class=sectionTitle tabIndex=0>Event Log Settings</SPAN>"| out-file -Append -encoding ASCII -filepath $Filename
812812
	Write-Output "			<A class=expando href='#'></A>"| out-file -Append -encoding ASCII -filepath $Filename
813813
	Write-Output "		</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
814814
	Write-Output "		<DIV class=container>"| out-file -Append -encoding ASCII -filepath $Filename
815815
	Write-Output "			<DIV class=tableDetail>"| out-file -Append -encoding ASCII -filepath $Filename
816816
	Write-Output "				<TABLE>"| out-file -Append -encoding ASCII -filepath $Filename
817817
	Write-Output "  					<tr>"| out-file -Append -encoding ASCII -filepath $Filename
818818
	Write-Output "    					<th width='25%'><b>Log Name</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
819819
	Write-Output "    					<th width='25%'><b>Overwrite Outdated Records</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
820820
	Write-Output "  					  	<th width='25%'><b>Maximum Size</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
821821
	Write-Output " 					   	<th width='25%'><b>Current Size</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
822822
	Write-Output " 					</tr>"| out-file -Append -encoding ASCII -filepath $Filename
823823
	ForEach ($objLogFile in $colLogfiles)
824824
	{
825825
		Write-Output " 					<tr>"| out-file -Append -encoding ASCII -filepath $Filename
826826
		Write-Output "	 					<td width='25%'>" $objLogFile.LogFileName "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
827827
		If ($objLogfile.OverWriteOutdated -lt 0)
828828
		{
829829
			Write-Output "	 					<td width='25%'>Never</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
830830
		}
831831
		if ($objLogFile.OverWriteOutdated -eq 0)
832832
		{
833833
			Write-Output "	 					<td width='25%'>As needed</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
834834
		}
835835
		Else
836836
		{
837837
			Write-Output "	 					<td width='25%'>After " $objLogFile.OverWriteOutdated " days</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
838838
		}
839839
		Write-Output "	 					<td width='25%'>" (($objLogfile.MaxFileSize)/1024) " KB</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
840840
		Write-Output "	 					<td width='25%'>" (($objLogfile.FileSize)/1024) " KB</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
841841
		Write-Output "  					</tr>"| out-file -Append -encoding ASCII -filepath $Filename
842842
	}
843843
	Write-Output "				</TABLE>"| out-file -Append -encoding ASCII -filepath $Filename
844844
	Write-Output "			</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
845845
	Write-Output "		</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
846846
	Write-Output "	</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
847847
	Write-Output "	<DIV class=filler></DIV>"| out-file -Append -encoding ASCII -filepath $Filename
849849
	#---------- End of COMPUTER DETAILS - EVENT LOGS - EVENT LOG SETTINGS Sub-section HTML Code --------------------------
850850
	# ---------- Start of COMPUTER DETAILS - EVENT LOGS - ERROR ENTRIES Sub-section HTML Code -----------------------------
852852
		write-output "..Event Log Errors"
854854
		$WmidtQueryDT = [System.Management.ManagementDateTimeConverter]::ToDmtfDateTime([DateTime]::Now.AddDays(-14))
855855
		$colLoggedEvents = Get-WmiObject -computer "Localhost" -query ("Select * from Win32_NTLogEvent Where Type='Error' and TimeWritten >='" + $WmidtQueryDT + "'")
857857
		Write-Output "	<DIV class=container>"| out-file -Append -encoding ASCII -filepath $Filename
858858
		Write-Output "		<DIV class=heading2>"| out-file -Append -encoding ASCII -filepath $Filename
859859
		Write-Output "			<SPAN class=sectionTitle tabIndex=0>ERROR Entries</SPAN>"| out-file -Append -encoding ASCII -filepath $Filename
860860
		Write-Output "			<A class=expando href='#'></A>"| out-file -Append -encoding ASCII -filepath $Filename
861861
		Write-Output "		</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
862862
		Write-Output "		<DIV class=container>"| out-file -Append -encoding ASCII -filepath $Filename
863863
		Write-Output "			<DIV class=tableDetail>"| out-file -Append -encoding ASCII -filepath $Filename
864864
		Write-Output "				<TABLE>"| out-file -Append -encoding ASCII -filepath $Filename
865865
		Write-Output "  					<tr>"| out-file -Append -encoding ASCII -filepath $Filename
866866
		Write-Output "    					<th width='10%'><b>Event Code</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
867867
		Write-Output "   					<th width='10%'><b>Source Name</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
868868
		Write-Output "    					<th width='15%'><b>Time</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
869869
		Write-Output "    					<th width='10%'><b>Log</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
870870
		Write-Output "    					<th width='55%'><b>Message</b></font></th>"| out-file -Append -encoding ASCII -filepath $Filename
871871
		Write-Output "  					</tr>"| out-file -Append -encoding ASCII -filepath $Filename
872872
		ForEach ($objEvent in $colLoggedEvents)
873873
		{
874874
			$dtmEventDate = $ObjEvent.ConvertToDateTime($objEvent.TimeWritten)
875875
			Write-Output " 					<tr>"| out-file -Append -encoding ASCII -filepath $Filename
876876
			Write-Output "	 					<td width='10%'>" $objEvent.EventCode "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
877877
			Write-Output "	 					<td width='10%'>" $objEvent.SourceName "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
878878
			Write-Output "	 					<td width='15%'>" $dtmEventDate "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
879879
			Write-Output "	 					<td width='10%'>" $objEvent.LogFile "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
880880
			Write-Output "	 					<td width='55%'>" $objEvent.Message "</font></td>"| out-file -Append -encoding ASCII -filepath $Filename
881881
			Write-Output "  					</tr>"| out-file -Append -encoding ASCII -filepath $Filename
882882
		}
883883
		Write-Output "				</TABLE>"| out-file -Append -encoding ASCII -filepath $Filename
884884
		Write-Output "			</DIV>"| out-file -Append -encoding ASCII -filepath $Filename
885885
		Write-Output "		</DI

ContributeMost Recent Contributions (feed)

Contribute ... Next Page