I am looking for a direction on how I can extract the Order ID value tagged to the Autopilot device Object property ‘DevicePhysicalIds’. For example
Get-AzureADDevice -ObjectId 86d62fa8-5366-49b7-85f8-439fd7c829eb |Select-Object DevicePhysicalIds
gives me the below output
DevicePhysicalIds
{[OrderId]:Finance: HAAD Join Skip AD ping test, [ZTDID]:4d53004b-5157-4eeb-97a6-dae4019806e7, [USER-HWID]:1e3d16a7-20ba-413a-a930-a658f0c0c294:6896159468190780
You can help us helping you when you post code, console output or error messages to format it as code here in the forum.
I don’t have access to an Azure tennant to test but my first step yould be to “drill in” the property you’re after and see how it looks. When a cmdlets outputs a list of properties instead of just one single properties you can use -ExpandProperty to enumerate this list … like this:
HI All, Thank you for your response and for onboarding me to Powershell.org.
When I expand the object property I can see the values are there as a collection and I do not know ways to get only one string value … say [OrderId] from the string collection. I am attaching another screen shot with its member type… please see…
First of all - please stop posting pictures of code or text - that’s most of the time not helpful. If you want to share code, console output, sample data or error messages copy the text and post it here formatted as code. This way we can copy it and play with it to be able to reproduce part of your environment.
You’ve moved forward and you’re almost there … why so desparate?