C# Class ADLib.ADUser

Represents an AD User object, wraps an AD UserPrincipal
Inheritance: ADObject
Show file Open project: bolenc/Active-Directory-Examples Class Usage Examples

Private Properties

Property Type Description
Sync_Groups void

Public Methods

Method Description
ADUser ( ActiveDirectory connection ) : System

Create a new AD User on the given connection

ADUser ( ActiveDirectory connection, System.DirectoryServices.AccountManagement.UserPrincipal user ) : System

Create an AD User from the given connection and UserPrincipal

MoveTo ( ) : void
Save ( ) : void

Save the local ADUser data to the remote server

addToGroup ( string groupName ) : void

Add the ADUser to a group

find ( ) : IEnumerable
removeFromGroup ( string groupName ) : void

Remove the ADUser from a group

Private Methods

Method Description
Sync_Groups ( ) : void

Synchronize groups between the local ADUser object and the AD server record

Method Details

ADUser() public method

Create a new AD User on the given connection
public ADUser ( ActiveDirectory connection ) : System
connection ActiveDirectory The AD connection
return System

ADUser() public method

Create an AD User from the given connection and UserPrincipal
public ADUser ( ActiveDirectory connection, System.DirectoryServices.AccountManagement.UserPrincipal user ) : System
connection ActiveDirectory The AD connection
user System.DirectoryServices.AccountManagement.UserPrincipal An existing UserPrincipal object
return System

MoveTo() public method

public MoveTo ( ) : void
return void

Save() public method

Save the local ADUser data to the remote server
public Save ( ) : void
return void

addToGroup() public method

Add the ADUser to a group
public addToGroup ( string groupName ) : void
groupName string The name of the group to which the user should be added
return void

find() public method

public find ( ) : IEnumerable
return IEnumerable

removeFromGroup() public method

Remove the ADUser from a group
public removeFromGroup ( string groupName ) : void
groupName string The name of the group from which the ADUser should be removed
return void