Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeviceManagement_ManagedDevices OS language missing #12

Closed
POF10 opened this issue Nov 13, 2018 · 3 comments
Closed

DeviceManagement_ManagedDevices OS language missing #12

POF10 opened this issue Nov 13, 2018 · 3 comments

Comments

@POF10
Copy link

POF10 commented Nov 13, 2018

Hello-hello,

Using API operatingSystemLanguage is under hardware information property:

$Resource = "deviceManagement/manageddevices('"+$id+"')?`$select=hardwareInformation"
$uri = "https://graph.microsoft.com/$graphApiVersion/$($Resource)"
(Invoke-RestMethod -Uri $uri –Headers $authToken –Method get).hardwareinformation

serialNumber                                                   : 6242-1968-7072-4957-4783-9852-85
totalStorageSpace                                              : 53684994048
freeStorageSpace                                               : 9166786560
imei                                                           :
meid                                                           :
manufacturer                                                   : Microsoft Corporation
model                                                          : Virtual Machine
phoneNumber                                                    :
subscriberCarrier                                              :
cellularTechnology                                             :
wifiMac                                                        :
operatingSystemLanguage                                        : en-US
isSupervised                                                   : False
isEncrypted                                                    : False
isSharedDevice                                                 : False
tpmSpecificationVersion                                        :
operatingSystemEdition                                         : 4
deviceFullQualifiedDomainName                                  :
deviceGuardVirtualizationBasedSecurityHardwareRequirementState : meetHardwareRequirements
deviceGuardVirtualizationBasedSecurityState                    : notConfigured
deviceGuardLocalSystemAuthorityCredentialGuardState            : virtualizationBasedSecurityNotRunning
sharedDeviceCachedUsers                                        : {}

Using InPS there is no hardwareInformation property to select or operatingSystemLanguage property itself:

image
image

Thanks.
/Maksim

@rohitramu
Copy link
Contributor

Is your $graphApiVersion variable set to "beta"? If so, that would explain the difference in properties. The PowerShell SDK is generated against the v1.0 schema. For convenience, there is a cmdlet called Invoke-MSGraphRequest to allow you to craft a custom call:

# Set the schema version to "beta"
Update-MSGraphEnvironment -SchemaVersion 'beta'

# Craft a custom call (the Get-MSGraphAllPages will automatically do paging and unwrap the values in all pages)
$result = Invoke-MSGraphRequest -Url 'deviceManagement/managedDevices?$select=hardwareInformation' | Get-MSGraphAllPages

@POF10
Copy link
Author

POF10 commented Nov 14, 2018

Hi Rohit,

Right, $graphApiVersion is set to 'beta'. After changing SDK schema ver. to 'beta' and calling via custom call everything works fine and I get what I need.

Thanks.

P.S. some additional feedback.
Hardware Information property now exists as well when running like:

(Get-DeviceManagement_ManagedDevices -managedDeviceId eb0872d3-3148-44fb-9b30-ffd66b156362).hardwareinformation


serialNumber                                                   :
totalStorageSpace                                              : 0
freeStorageSpace                                               : 0
imei                                                           :
meid                                                           :
manufacturer                                                   :
model                                                          :
phoneNumber                                                    :
subscriberCarrier                                              :
cellularTechnology                                             :
wifiMac                                                        :
operatingSystemLanguage                                        :
isSupervised                                                   : False
isEncrypted                                                    : False
isSharedDevice                                                 : False
tpmSpecificationVersion                                        :
operatingSystemEdition                                         :
deviceFullQualifiedDomainName                                  :
deviceGuardVirtualizationBasedSecurityHardwareRequirementState : meetHardwareRequirements
deviceGuardVirtualizationBasedSecurityState                    : running
deviceGuardLocalSystemAuthorityCredentialGuardState            : running
sharedDeviceCachedUsers                                        : {}

But it returns nothing (same as via raw HTTP call which is expected) so ?$select=hardwareInformation is used in HTTP call which does the trick. Would be good if 'beta' stuff would be available to Intune PS SDK so it would be possible to do :
Get-DeviceManagement_ManagedDevices -select hardwareInformation
and receive same thing as via custom call\http call.

@POF10 POF10 closed this as completed Nov 14, 2018
@rohitramu
Copy link
Contributor

rohitramu commented Nov 14, 2018

Thanks for the feedback Maksim. We are actually not generating the SDK for "beta" exactly for that reason: "beta" should not be used in production code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants