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

How to retrieve actual value of OmaSettingStringXml.Value? #2188

Closed
RytisLT opened this issue Oct 31, 2023 · 4 comments
Closed

How to retrieve actual value of OmaSettingStringXml.Value? #2188

RytisLT opened this issue Oct 31, 2023 · 4 comments

Comments

@RytisLT
Copy link

RytisLT commented Oct 31, 2023

I'm using the following code to retrieve OmaSettingStringXml

var creds = new ClientSecretCredential(_config.TenantId, _config.ClientId, _config.ClientSecret);
var client = new GraphServiceClient(creds, new[] { "https://graph.microsoft.com/.default" }); 
var cfgReq = client.DeviceManagement.DeviceConfigurations[_config.DeviceConfigurationId];
var item = (Windows10CustomConfiguration)(await cfgReq.GetAsync())!;
var setting = item.OmaSettings?.OfType<OmaSettingStringXml>().First();
var valueString = Encoding.UTF8.GetString(setting?.Value!);
Console.WriteLine(valueString); // is always <a/>

The OmaSettingStringXml.Value always contains <a/> even though inspecting the value through Azure UI shows a different value. How can I retrieve the actual XML?

@andrueastman
Copy link
Member

Thanks for raising this @RytisLT

To help us understand if this is SDK or API related? Any chance you get a similar issue when you make the same request using the Graph Explorer?

@RytisLT
Copy link
Author

RytisLT commented Nov 2, 2023

@andrueastman It is API related, same result using simple HTTP requests, except that value is base64 encoded

@andrueastman
Copy link
Member

@RytisLT As this is an API related question and this repo is mainly intended for SDK related issues, we may not be best placed to answer this question.
Any chance you can post the question at the link below to get feedback from the API owners? It would be great if you could post back the link to the created query so that anyone who comes across this may also be able to get the information.

https://learn.microsoft.com/en-us/answers/tags/161/ms-graph

Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

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

No branches or pull requests

2 participants