Translate

Friday, January 23, 2026

VSCode start as admin fails with "launch failed" code 18

Since quite a while when you try to start VSCode as admin under certain circumstances (e.g. Applocker is active in your environment) then you may receive this error:

"The window terminated unexpectedly (reason: 'launch-failed', code: '18')


To workaround this simply open a command prompt as local admin and start code with these parameters:


code --no-sandbox --disable-gpu-sandbox






Wednesday, January 21, 2026

Powershell - how to gather data with your scripts in Azure Log Analytics

For specific use cases (e.g. to collect the state of your secure boot certificate updates) it might be required to run a script on your hosts and collect the data centrally. The best way to achieve this is to use Azure Log Analytics. 

Here is how you can achieve this:


1. Setup the Azure Log Analytics Workspace in Azure 

1.1 Search in the Azure Portal for "Azure Log Analytics Workspace" and add a new one.

Hint: Formerly Microsoft was showing this data in the portal but they removed it. Its still supported but not the preferred method anymore. Any other methods does not allow the PowerShell based upload. Instead you need the AMA client to gather data. Which does not work for a PowerShell script based solutions were you want to gather your own custom generated data.


2. Gather the required data (WorkspaceID and Preshared Key) for your script

2.1 connect with Powershell to your Subscription

2.2 Ensure Azure modules are loaded (Import-Module Az) or you use the Azure Cloud shell (easiest method)

2.3 Retrieve the Workspace ID (replace RessourceGroup name and Workspace name!)

(Get-AzOperationalInsightsWorkspace -ResourceGroupName rg-xxx -Name "law-xxx-test").CustomerID



Shown ID is your Workspace ID (note/copy it we need it later again!)


2.4 Retrieve the Workspace Keys for uploading

Get-AzOperationalInsightsWorkspaceSharedKeys -ResourceGroupName rg-xxx -Name "law-xxx-test"


Shown SharedKeys are required for the script as well. Please note / copy them and keep the data in a save place!

3. Powershell Code to send some data
For demonstration purposes we gather hostnamen and IP addresses. So you can simply modify the relevant part. This thing will generate your first data.

If there is no log created with this name (here MyHostLog) then it will be generated automatically for you when you send the first data.

Keep in mind you need to modify the former captured WorkspaceID and Workspace Key (I would recommend you use the primary key).

function Send-Ip {
 # Function to log Host Name and IP Address to custom log in Azure Log Analytics!
 # Simply use start-transcript at the beginning your script and 
 # stop-transcript as last line in your script for easy logging. 
 # This will catch up all the write-host and other output as well!
    Write-Host "Log Host Name and IP Address to custom log"
    $apiVersion = "2016-04-01"
 # IMPORTANT! Adjust the code with your own data gathered in step 2!
    $workspaceId = "11111111-2222-3333-4444-555555555555"
    $workspaceKey = "wJxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx0ww=="
   
 # Name of your log in your Azure Log Analytics Workspace
    $logType = "MyHostLog"
 # Generation of some sample custom log data. Change this for your purpose
    $hostname = $env:COMPUTERNAME
    $ipAddress = (Get-NetIPAddress -AddressFamily IPv4 | Where-Object { $_.InterfaceAlias -match "Ethernet*" }).IPAddress
    $timestamp = Get-Date -Format "yyyy-MM-ddTHH:mm:ssZ"
 # Creation of the log entry. Its good to have a timestamp and may be a host reference if you want! And add here whatever you want!
    $logEntry = @(
        @{
            TimeGenerated = $timestamp
            Hostname      = $hostname
            IPAddress     = $ipAddress
        }
    )
 # Generate log entry body and header to send. It will be encrypted and signed with your shared Workspace key from above.
    $body = $logEntry | ConvertTo-Json -Depth 3
    # Ensure the date is in RFC1123 format
    $date = [DateTime]::UtcNow.ToString("r")
    # Construct the string to sign
    $stringToHash = "POST`n$($body.Length)`napplication/json`nx-ms-date:$date`n/api/logs"
    $hmacsha256 = New-Object System.Security.Cryptography.HMACSHA256
    $hmacsha256.Key = [Convert]::FromBase64String($workspaceKey)
    $hash = $hmacsha256.ComputeHash([Text.Encoding]::UTF8.GetBytes($stringToHash))
    $signature = [Convert]::ToBase64String($hash)
    $authkey = $workspaceId + ":" + $signature
    $authorization = "SharedKey $authkey"
    $headers = @{
        "Content-Type"  = "application/json"
        "Authorization" = $authorization
        "Log-Type"      = $logType
        "x-ms-date"     = $date
    }
# Lets look into the header we have created (this is just for reference in your local logs if you want!)
   Write-Host "Header:"
   $headers
   Write-Host "=================================================="
# Lets look into the body we have created (this is just for reference in your local logs if you want!)
    Write-Host "Body:"
    $body
# Now lets send the data to the workspace (may be you want to adjust the catch block & finally text)
    try {
                $response = Invoke-RestMethod -Method Post -Uri "https://$workspaceId.ods.opinsights.azure.com/api/logs?api-version=$apiVersion" -Headers $headers -Body $body
                # Output the response (so it got catched in start-transcript log, no response is fine as well!)
                Write-Host "Response: $response"         
        }
        catch {
            Write-Error "Failed to send the IpReport: $_"
        }
        finally {
            Write-Host "Processing done for IP reporting!"
        }
}
# Now call the function
Send-Ip


Thats it!  Simply ajdust the sample code as you want. 

You find in Azure Log Analytics workspace table "MyHostLog_CL" your first new entry:



Enjoy the show!

Thursday, October 30, 2025

Secure Boot Certificate Upate

Currently there is a real important topic ongoing with the same reach like the good old Y2K bug. We will finally see if it had serious impact or not. But nevertheless we cant ignore it and need to check the real impact. 

What is it about? 

The Microsoft Secure Boot Certificates will expire in June 2026. 

The details and the real impact are currently under investigation.

So please check out on this blog when I can share more.
Then I will provide also PowerShell scripts how you can check by your own.

The latest Microsoft published news about Secure Boot expiring certificates can be found on:
https://aka.ms/getsecureboot

Wednesday, April 2, 2025

Edge Browser Troubleshooting Tools

Whenever you are working with Edge Browser in case of troubleshooting you may wonder how to figure out which policies are used or other additional troubleshooting you want to do. Actually Edge browser had a ton of them under the hood that most people do not know about.



The easiest way to get the list of possible functions is type in the browser edge://about

This is additionally to the already known F12 Developer Tools (!)

The link edge://about gives you a pretty long list with these functions:

Edge URL
Description
edge://about
Lists all internal URLs. Same as edge://edge-urls/
edge://accessibility
Inspect the representation of accessibility in Edge and modify accessibility modes.
edge://appcache-internals
Lists information about the application cache (that sites may use).
edge://application-guard-internals
Returns the status of the Windows-specific Application Guard feature, host information, a log, and utilities to check URL trust, Ping, and more.
edge://apps
Lists all applications installed in Microsoft Edge.
edge://autofill-internals
Lists captured autofill logs.
edge://blob-internals
Lists blob data if available.
edge://bluetooth-internals
Provides information on Bluetooth connectivity including available adapters, devices, and debug logs.
edge://compat
Compatibility hub that lists Enterprise Mode Site List entries, User agent overrides, CDM overrides, and the status of Internet Explorer mode (including diagnostics).
edge://components
Installed plugins and components. The Adobe Flash Player version is listed here if installed, as is the Widevine Content Decryption Module, Trust Protection Lists, and other components.
edge://conflicts
The page lists all modules loaded in the browser and rendered processes, and modules registered to load at a later point in time.
edge://crashes
Lists all recently reported crashes. Includes option to clear the listing.
edge://credits
Lists credits for various components and features that Edge uses.
edge://data-viewer
Linked to diagnostic data.
edge://device-log
Provides device information, e.g. events of Bluetooth or USB devices.
edge://discards
Tabs may be discarded by the browser, e.g. to free up memory. The page lists those tabs and related information.
edge://download-internals
Displays the download status, and provides options to start a download.
edge://downloads
Opens the internal downloads management page listing all downloads of Edge.
edge://edge-dlp-internals
Data Loss Prevention (DLP) internals for Edge.
edge://extensions
Lists all installed extensions.
edge://flags
Access to experimental features and settings.
edge://gpu
Provides information about the GPU and related settings.
edge://histograms
Displays histograms of various metrics.
edge://history
Opens the browsing history page.
edge://indexeddb-internals
Provides information about IndexedDB databases.
edge://inspect
Allows inspection of pages and extensions.
edge://interstitials
Lists interstitial pages.
edge://invalidations
Provides information about invalidations.
edge://local-state
Displays the local state file.
edge://media-engagement
Provides information about media engagement.
edge://media-internals
Provides detailed information about media playback.
edge://nacl
Provides information about Native Client (NaCl) modules.
edge://net-export
Allows exporting network logs.
edge://net-internals
Provides detailed network information and settings.
edge://network-errors
Lists network error codes and their descriptions.
edge://new-tab-page
Opens a new tab page.
edge://ntp-tiles-internals
Provides information about new tab page tiles.
edge://omnibox
Provides information about the omnibox (address bar) suggestions.
edge://password-manager-internals
Provides information about the password manager.
edge://policy
Lists all policies applied to the browser.
edge://predictors
Provides information about predictors.
edge://prefs-internals
Displays internal preferences.
edge://print
Opens the print dialog.
edge://process-internals
Provides information about browser processes.
edge://quota-internals
Provides information about storage quotas.
edge://sandbox
Provides information about sandboxed processes.
edge://serviceworker-internals
Provides information about service workers.
edge://settings
Opens the settings page.
edge://signin-internals
Provides information about the sign-in process.
edge://site-engagement
Provides information about site engagement.
edge://suggestions
Provides information about suggestions.
edge://sync-internals
Provides information about sync.
edge://system
Provides information about the system.
edge://terms
Displays the terms of service.
edge://tracing
Provides tracing information.
edge://translate-internals
Provides information about the translation feature.
edge://ukm
Provides information about the UKM (User Keyed Metrics) system.
edge://usb-internals
Provides information about USB devices.
edge://user-actions
Provides information about user actions.
edge://version
Displays the version information.
edge://webrtc-internals
Provides information about WebRTC.
edge://webrtc-logs
Provides access to WebRTC logs.
edge://web-app-internals
Provides information about web apps.
edge://web-contents
Provides information about web contents.
edge://webusb-internals
Provides information about WebUSB.
edge://whats-new
Displays the "What's New" page.
edge://flags
Access to experimental features and settings.
edge://gpu
Provides information about the GPU and related settings.
edge://histograms
Displays histograms of various metrics.
edge://history
Opens the browsing history page.
edge://indexeddb-internals
Provides information about IndexedDB databases.
edge://inspect
Allows inspection of pages and extensions.
edge://interstitials
Lists interstitial pages.
edge://invalidations
Provides information about invalidations.
edge://local-state
Displays the local state file.
edge://media-engagement
Provides information about media engagement.
edge://media-internals
Provides detailed information about media playback.
edge://nacl
Provides information about Native Client (NaCl) modules.
edge://net-export
Allows exporting network logs.
edge://net-internals
Provides detailed network information and settings.
edge://network-errors
Lists network error codes and their descriptions.
edge://new-tab-page
Opens a new tab page.
edge://ntp-tiles-internals
Provides information about new tab page tiles.
edge://omnibox
Provides information about the omnibox (address bar) suggestions.
edge://password-manager-internals
Provides information about the password manager.
edge://policy
Lists all policies applied to the browser.
edge://predictors
Provides information about predictors.
edge://prefs-internals
Displays internal preferences.
edge://print
Opens the print dialog.
edge://process-internals
Provides information about browser processes.
edge://quota-internals
Provides information about storage quotas.
edge://sandbox
Provides information about sandboxed processes.
edge://serviceworker-internals
Provides information about service workers.
edge://settings
Opens the settings page.
edge://signin-internals
Provides information about the sign-in process.
edge://site-engagement
Provides information about site engagement.
edge://suggestions
Provides information about suggestions.
edge://sync-internals
Provides information about sync.
edge://system
Provides information about the system.
edge://terms
Displays the terms of service.
edge://tracing
Provides tracing information.
edge://translate-internals
Provides information about the translation feature.
edge://ukm
Provides information about the UKM (User Keyed Metrics) system.
edge://usb-internals
Provides information about USB devices.
edge://user-actions
Provides information about user actions.
edge://version
Displays the version information.
edge://webrtc-internals
Provides information about WebRTC.
edge://webrtc-logs
Provides access to WebRTC logs.
edge://web-app-internals
Provides information about web apps.
edge://web-contents
Provides information about web contents.
edge://webusb-internals
Provides information about WebUSB.
edge://whats-new
Displays the "What's New" page.

Here an example for policies (type in the address bar simply edge://policy)