question

Guangsong-3309 avatar image
0 Votes"
Guangsong-3309 asked ·

How to programmatically create a Device Account (with Email property) in headless mode?

Hi all,

Windows 10 IoT Core v1809 headless mode runs on the DB410c, C# UWP project, is there any idea about how to programmatically create a Device Account with Email property?

I have tested the CreateDeviceAccountAsync() in the Windows 10 Pro and work fine, but this can't work in the Windows 10 IoT Core v1809 headless mode. The Email account can be set in the DeviceAccountConfiguration instance.

Any ideas?

 public static IAsyncOperation<string> CreateDeviceAccountAsync(DeviceAccountConfiguration account);

Thanks!


windows-iot-10-core
· 2
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,
You need to develop a UWP application as a background application to adapt to the Windows IoT Core configured with headless mode.
https://docs.microsoft.com/en-us/windows/iot-core/develop-your-app/backgroundapplications

0 Votes 0 ·

Thanks for the reply.

I want to know how to create an email account but not how to create an app in headless mode.

0 Votes 0 ·

1 Answer

robinmholt-Daikin avatar image
0 Votes"
robinmholt-Daikin answered ·

Where are you creating this email account? Is it through a website submission? If so, you could use a powershell script with an 'Invoke-WebRequest' to do the website submission to create the email account, but Windows 10 IoT Core does not have the concept of an Mail Transfer Agent (MTA).

If you are asking about creating another user account, you can use the 'net user' set of commands to create the user.

Either of those could go in the oemcustomization.cmd script which is executed at boot each time. For details on that, look in the Windows 10 IoT Core documentation here: https://docs.microsoft.com/en-us/windows-hardware/manufacture/iot/oscustomizations#runtime-customizations

· 3 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,

Thanks for the reply!

I want to create a Device Account of the Windows 10 IoT Core.

I have tested the CreateDeviceAccountAsync() in the Windows 10 Pro and work fine, but this can't work in the Windows 10 IoT Core v1809 headless mode. The Email account can be set in the DeviceAccountConfiguration instance.

The "net" utility can't add a Device Account.

Any ideas?


0 Votes 0 ·

I would be surprised if you can use that at all on Windows 10 IoT Core. Windows 10 IoT Core is really intended for embedded applications. If you have an Azure Active Directory, you could Domain Join the device and then your AAD accounts could be used for background services, etc.

It looks like you are trying to create a service account using Microsoft for your directory services. Could you please be more details about why you want the account created this way? Maybe we can find an alternative which is actually more useful.

0 Votes 0 ·

I want to use Windows.ApplicationModel.Email namespace on Windows 10 IoT Core headless mode but not the third one like MailKit. But the only way I have found to add an Email account is to create a Device Account with the Email property first.
It is fine if there have any other ways to use Windows.ApplicationModel.Email namespace in headless mode?

Thanks.


0 Votes 0 ·