How to format output to csv from "Get-AzureADAuditDirectoryLogs" ?

%3CLINGO-SUB%20id%3D%22lingo-sub-2925035%22%20slang%3D%22en-US%22%3EHow%20to%20format%20output%20to%20csv%20from%20%22Get-AzureADAuditDirectoryLogs%22%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2925035%22%20slang%3D%22en-US%22%3E%3CDIV%20class%3D%22%22%3E%3CDIV%3E%3CDIV%20class%3D%22%22%3E%3CDIV%3E%3CSTRONG%3EHello%2C%3C%2FSTRONG%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CDIV%3EI'm%20working%20with%20command%20%22%3CSTRONG%3EGet-AzureADAuditDirectoryLogs%3C%2FSTRONG%3E%22%20to%20store%20Azure%20Log%20locally.%20The%20result%20look%20like%20json%20but%20I%20failed%20to%20use%20%22convertfrom-json%22%20to%20get%20those%20data%20separately%20to%20column.%20Does%20anyone%20know%20which%20is%20this%20kind%20of%20output%20and%20how%20I%20can%20convert%20it%20to%20csv%20%3F%20All%20I%20need%20is%20get%20output%20in%20%22%3CSTRONG%3EUserPrincipalName%3C%2FSTRONG%3E%22.%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSTRONG%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%221.jpg%22%20style%3D%22width%3A%20929px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F324115iC28F86471C1300D8%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%221.jpg%22%20alt%3D%2201%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3E01%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSTRONG%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F324116iD7143FBBAAF8CCA2%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%222.jpg%22%20alt%3D%2202%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3E02%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3EMany%20Thank%20for%20any%20help.%3C%2FDIV%3E%3CDIV%3ECheers.%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2925035%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EGet-AzureADAuditDirectoryLogs%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2925221%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20format%20output%20to%20csv%20from%20%22Get-AzureADAuditDirectoryLogs%22%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2925221%22%20slang%3D%22en-US%22%3ENever%20mind%2C%20I%20have%20sorted%20it.%3C%2FLINGO-BODY%3E
New Contributor
Hello,
 
I'm working with command "Get-AzureADAuditDirectoryLogs" to store Azure Log locally. The result look like json but I failed to use "convertfrom-json" to get those data separately to column. Does anyone know which is this kind of output and how I can convert it to csv ? All I need is get output in "UserPrincipalName".
 
 
 
0101
 
 
0202
 
 
Many Thank for any help.
Cheers.
 
2 Replies
Never mind, I have sorted it.
Hi how did you fix this, same problem for me