Reputation: 1804
We developed an store app it works fine when we deployed in domain2 it not working.As it throwing an error we fixed that error in the domain2 and installed in the domain1 it doesn't work but it working fine in domain2.
I tried using
string dnsName = await Windows.System.UserProfile.UserInformation.GetDomainNameAsync();
but it returning empty string
for eg, I'm having two domains like Dev and Test,my need is to get the name as Dev and Test.
any solution or code is provided is much appreciated.
Upvotes: 0
Views: 1828
Reputation: 23784
Use of this requires the Enterprise Authentication capability, which in turn requires a business account (not an individual developer account) on the Windows Store. All that's possible to do of course.
I'd thought the result would be blank if Enterprise Authentication were not checked. The documentation says that GetDomainNameAsync does not throw an exception, but I'm definitely seeing a UnauthorizedAccessException in that case.
So presuming that is not the issue, note you will get an empty string on that call if the user turned off the sharing of that information via PC Setttings:
Upvotes: 2