help me to write a function in c#.net core that add user to exchange using novell library or any library that could do it . the point is that I need run my code on linux.
Asked
Active
Viewed 140 times
-1
-
You can't expect anyone to write your code for you. But if you search Google for ["create AD user c#"](https://www.google.com/search?q=create+AD+user+c%23) you will find answers. You can use `System.DirectoryServices` in .NET Core by using the [`Microsoft.Windows.Compatibility`](https://www.nuget.org/packages/Microsoft.Windows.Compatibility) NuGet package - but then your project can only run on Windows (which may or may not be a problem) – Gabriel Luci Jan 17 '20 at 15:14
-
thanks Gabriel, i tried write code that can add user to exchange and i don't success then i search for create user to exchange, but i couldn't found answer. I need a library that can work with exchange, I can't use System.DirectoryServices because I need to run my project on Linux and i need Add user to exchange, not to active directory – Mehdi Razmjooie Jan 17 '20 at 20:13
-
Sorry, I missed the word "exchange". I read it too fast. – Gabriel Luci Jan 17 '20 at 20:37
1 Answers
0
I assume you're talking about on premises Exchange (not Exchange Online, or Office 365).
You can't do this from Linux unfortunately.
Exchange does have a web service, but it cannot be used to create mailboxes.
The only way to create mailboxes in Exchange is to use PowerShell commands. This isn't terribly easy either. I have automated mailbox creation in C#, and I had to call the PowerShell commands from C# (and it has a ton of weird quirks - it's awful). But that, of course, can only be done on Windows.

Gabriel Luci
- 38,328
- 4
- 55
- 84
-
actually i found powershell commands for this problem, but i couldn't use powershell, i must do with c#.net core and run on linux. – Mehdi Razmjooie Jan 17 '20 at 21:02
-
Right. That's why I said it cannot be done... You can only create a mailbox with PowerShell, but you can't run the PowerShell commands on Linux. – Gabriel Luci Jan 17 '20 at 21:03