https://github.com/svrooij/directadmin
Control your directadmin users from your C# application.
https://github.com/svrooij/directadmin
Last synced: 19 days ago
JSON representation
Control your directadmin users from your C# application.
- Host: GitHub
- URL: https://github.com/svrooij/directadmin
- Owner: svrooij
- License: mit
- Created: 2015-06-12T10:53:31.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-07-21T10:58:35.000Z (almost 8 years ago)
- Last Synced: 2025-04-09T13:42:36.984Z (20 days ago)
- Language: C#
- Homepage: https://www.nuget.org/packages/DirectAdmin.Client/
- Size: 481 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DirectAdmin
Control your DirectAdmin users from your C# application[](https://ci.appveyor.com/project/svrooij/directadmin)
## Getting started
Install DirectAdmin.Client with NuGet. PackageManager `PM> Install-Package DirectAdmin.Client`
```C#
using DirectAdmin.Client;
// If you will be creating new users, you should also add DirectAdmin.Client.RequestOptions
using DirectAdmin.Client.RequestOptions;...
using(var client = new DirectAdminClient(
new DirectAdminClientOptions{
ServerName = "directadmin.domain.com",
Username = "yourUsername",
Password = "yourPassword", // Could also be an API key, see below
Port = 2222, // This is the default port number
UseHttps = false // Set to true if your directadmin installation is protected with an SSL certificate
}
)){
// List all users
var users = await client.ListUsers();// Set a password for a user
await client.ResetPasswordForUser("userName","newPassword");// Create a new user
await client.CreateUser(new CreateUserOptions{
DefaultIpAddress = "198.51.100.24",
Domain = "stephan.com",
Email = "[email protected]",
NotifyUser = true, // Should the user get an email containing the hosting information?
PackageName = "NameOfAHostingPackage",
Password = "theNewPasswordForTheUser",
Username = "Stephan"
});
}
```## Use an API key for **improved security**!
Directadmin has an option to create a (restricted) [API key](http://help.directadmin.com/item.php?id=523). This can be used instead of the ``Password`` in the ``DirectAdminClientOptions``.
To create an API key go to ``/CMD_LOGIN_KEYS`` in your DirectAdmin installation. Or Select ``User Level`` and click ``Login Keys``## Issues or feature requests?
If you found an issue with the software, please visit the [github repo](https://github.com/svrooij/DirectAdmin) and create an issue.