Skip to content

RadioSystems/Cake.ActiveDirectory

Repository files navigation

Cake.ActiveDirectory

Cake Addin for working with Active Directory.

License

Information

Stable Pre-release
GitHub Release - GitHub release
NuGet NuGet
NuGet

Build Status

beta-builds MyGet Build Status Build status

Code Coverage

Coverage Status

Quick Links

Chat Room

Come join in the conversation about Cake.CsvHelper in our Gitter Chat Room

Join the chat at https://gitter.im/cake-contrib/Lobby

Build

To build this package we are using Cake.

On Windows PowerShell run:

./build

About

This Addin only contains the functionality that we needed. We are more than happy to accept pull requests that will grow this library. It uses the LandPy.ActiveDirectory library for all Active Directory interaction.

Usage

Adding to your cake file

//Beta version
#addin nuget:https://www.myget.org/F/beta-builds/api/v2?package=Cake.ActiveDirectory 

// Release version
#addin nuget:?package=Cake.ActiveDirectory 

Creating a user

CreateUser("cake-user", "cake-group", new UserSettings { 
    LoginName = "domainAdmin", 
    Password = "adminPassword", 
    DomainName = "Cake.net"});

Updating a user

UpdateUser("employeeId", "1234", new UserSettings { 
    LoginName = "domainAdmin", 
    Password = "adminPassword", 
    DomainName = "Cake.net",
    Email = "test@cake-yeah.com" });

Getting a user's UPN from their email address.

var upn = FindUserPrincipalNameByProperty("proxyAddresses", "jdoe@example.com", new UserSettings { 
            LoginName = "domainAdmin", 
            Password = "adminPassword", 
            DomainName = "Cake.net" });