Providers

Choose a provider from the list on the left or search for a specific provider. Choose a provider from the list or search for a specific provider.
Cmdlets  About Help
 
 

DirectoryServices

DirectoryServices

pscx.dll

Synopsis

PSCX Provider: Provides access to LDAP servers like Active Directory or AD Lightweight Directory Services.

Detailed Description

The PSCX DirectoryServices provider lets you get, add, and change objects on LDAP directory services.

The PSCX DirectoryServices provider automatically creates a drive for the Active Directory domain the machine is joined to. You can create drives using the New-PSDrive command. The root of the drive should be a valid LDAP path to the root object.

You can get and change object attributes using the Get-ItemProperty and Set-ItemProperty commands. The current version of the provider supports user and group object types. Objects of other types can be retrieved and modified too, at least to some degree. You need to specify the -Raw attribute to get or change the real attribute of an object.

Notes

Tasks

Creating a DirectoryServices drive

-------------------------- EXAMPLE 1 --------------------------
This command connects to an AD LDS application partition running on some port on the mijavm machine.

New-PSDrive Adam DirectoryServices 'LDAP://mijavm:389/CN=Partition, DC=mijavm, DC=com'

Creating a DirectoryServices drive using specified credentials.

-------------------------- EXAMPLE 1 --------------------------
This command connects to a naming context on a remote Active Directory LDAP server using specified credentials.

$credential = Get-Credential New-PSDrive Litware DirectoryServices 'LDAP://157.58.88.61/DC=litwareinc, DC=com' -Credential $credential

Retrieving group members.

-------------------------- EXAMPLE 1 --------------------------
This command gets members of a specified Active Directory group.

Get-ItemProperty 'Litware:\Users\Litware FTE' Member

Specify the -Raw parameter when retrieving or changing the raw LDAP attributes.

Creating users.

-------------------------- EXAMPLE 1 --------------------------
This command creates a new user in the current organization unit and sets the manager property.

cd Litware:\Users new-item NewUser -Type user Set-ItemProperty newuser manager '.\Dianne Tibbot'

Getting group members.

-------------------------- EXAMPLE 1 --------------------------
This command returns members of the Litware FTE group.

(get-itemproperty 'Litware FTE').Member

Modifying multi-valued properties.

-------------------------- EXAMPLE 1 --------------------------
This command adds a member to the Litware FTE group.

set-itemproperty 'Litware FTE' Member TestUser -Add

-------------------------- EXAMPLE 2 --------------------------
This command removes a member from the Litware FTE group.

set-itemproperty 'Litware FTE' Member TestUser -Remove