Forum Discussion
MattH010101
Nov 14, 2022Copper Contributor
Can't write to custom logs
I am new to Intune. I have created a log analytics workspace. Using PowerShell I want to write to this location. My web address is always wrong, regardless of what I use. PowerShell gives me...
Jul 15, 2026
Hi MattH010101,
Your script is failing because the URI is wrong. For Azure Log Analytics, you never use your tenant domain, subscription ID, or onmicrosoft.com domain. I guess you can use:
https://<WorkspaceID>.ods.opinsights.azure.com/api/logs?api-version=2016-04-01
And CustomerId = Workspace ID, SharedKey = Primary Key from the Log Analytics workspace.
Workspace ID → CustomerId:
Azure Portal → Log Analytics Workspace → Agents → Workspace ID
Primary Key → Shared Key:
Same page → Private Key