{"id":5287,"date":"2026-06-11T13:34:08","date_gmt":"2026-06-11T13:34:08","guid":{"rendered":"https:\/\/geekmungus.co.uk\/?p=5287"},"modified":"2026-06-11T13:34:08","modified_gmt":"2026-06-11T13:34:08","slug":"using-invoke-vmscript-to-determine-event-id-1808","status":"publish","type":"post","link":"https:\/\/geekmungus.co.uk\/?p=5287","title":{"rendered":"Using Invoke-VMScript to Determine Event ID 1808"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">You can obtain information from a Virtual Machine via its VMTools service via the VMware PowerCLI, here is a simple working example you can build from to determine ID 1808 which shows that the machine has successfully completed its Secure Boot remediation (i.e. installing the new 2023 certificates to NVRAM and swapping to the new Boot Manager signed by the 2023 certificates).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Obviously don&#8217;t have the credentials written directly into the file, add something to collect them from a Secrets Manager or arguments, environment variables instead!<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$VMHost = \"host.domain.com\"\n\n$hostUsername = \"root\"\n$hostPassword = \"password\"\n\n$guestUsername = \"DOMAIN\\Administrator\"\n$guestPassword = \"password\"\n\n$vm = \"myVirtualMachine\"\n\n$hostConnect = Connect-VIServer $VMHost -User $hostUsername -Password $hostPassword\n\n$scriptOutput = Invoke-VMScript -VM $vm -ScriptType Powershell -ScriptText {Get-EventLog -LogName System -InstanceId 1808 -ErrorAction SilentlyContinue} -GuestUser $guestUsername -GuestPassword $guestPassword -ErrorAction SilentlyContinue -WarningAction SilentlyContinue\n\nWrite-Host\nWrite-Host \"Example Invoke-VMScript\" -ForegroundColor Cyan\nWrite-Host\n\nif ($scriptOutput) {\n    Write-Host \"$vm = \" -NoNewline\n    Write-Host \"Secure Boot Remediation Complete\" -ForegroundColor Green\n} else {\n    Write-Host \"$vm = \" -NoNewline\n    Write-Host \"Secure Boot Incomplete!\" -ForegroundColor Red\n}\n\nDisconnect-VIServer -Server $hostConnect -Confirm:$false<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>You can obtain information from a Virtual Machine via its VMTools service via the VMware PowerCLI, here is a simple working example you can build from to determine ID 1808 which shows that the machine has successfully completed its Secure Boot remediation (i.e. installing the new 2023 certificates to NVRAM and swapping to the new &#8230; <a title=\"Using Invoke-VMScript to Determine Event ID 1808\" class=\"read-more\" href=\"https:\/\/geekmungus.co.uk\/?p=5287\" aria-label=\"Read more about Using Invoke-VMScript to Determine Event ID 1808\">Read more<\/a><\/p>\n","protected":false},"author":4,"featured_media":4291,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14,60,25],"tags":[],"class_list":["post-5287","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-microsoft-windows","category-powershell","category-vmware"],"_links":{"self":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/5287","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5287"}],"version-history":[{"count":1,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/5287\/revisions"}],"predecessor-version":[{"id":5288,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/5287\/revisions\/5288"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/media\/4291"}],"wp:attachment":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5287"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5287"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5287"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}