Skip to content

Commit

Permalink
Add Set-OpenADObject (#76)
Browse files Browse the repository at this point in the history
Adds the cmdlet Set-OpenADObject that can modify existing AD objects
like Set-ADObject.
  • Loading branch information
jborean93 authored Mar 13, 2024
1 parent 076da1d commit 29a0057
Show file tree
Hide file tree
Showing 46 changed files with 2,353 additions and 314 deletions.
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"type": "shell",
"args": [
"-Command",
"Import-Module ${workspaceFolder}/output/PSOpenAD; Import-Module ${workspaceFolder}/tools/Modules/platyPS; Update-MarkdownHelpModule ${workspaceFolder}/docs/en-US -AlphabeticParamsOrder -RefreshModulePage -UpdateInputOutput"
"Import-Module ${workspaceFolder}/output/PSOpenAD; Import-Module ${workspaceFolder}/output/Modules/platyPS; Update-MarkdownHelpModule ${workspaceFolder}/docs/en-US -AlphabeticParamsOrder -RefreshModulePage -UpdateInputOutput"
],
"problemMatcher": [],
"dependsOn": [
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## v0.5.0 - TBD

+ Added the following cmdlets:
+ [Set-OpenADObject](./docs/en-US/Set-OpenADObject.md): Sets existing AD objects
+ Fix up deadlock when reading the AD schema with an auxiliary class that inherits from `top`

## v0.4.1 - 2023-10-16

+ Fix up safe SSPI context handle lifetime handling to avoid process crash
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,26 @@ These cmdlets have the following requirements

## Installing

The easiest way to install this module is through [PowerShellGet](https://docs.microsoft.com/en-us/powershell/gallery/overview).
The easiest way to install this module is through [PowerShellGet](https://docs.microsoft.com/en-us/powershell/gallery/overview) or [PSResourceGet](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.psresourceget/?view=powershellget-3.x).

You can install this module by running;
You can install this module by running either of the following `Install-PSResource` or `Install-Module` command.

```powershell
# Install for only the current user
Install-PSResource -Name PSOpenAD -Scope CurrentUser
Install-Module -Name PSOpenAD -Scope CurrentUser
# Install for all users
Install-PSResource -Name PSOpenAD -Scope AllUsers
Install-Module -Name PSOpenAD -Scope AllUsers
```

The `Install-PSResource` cmdlet is part of the new `PSResourceGet` module from Microsoft available in newer versions while `Install-Module` is present on older systems.

## Contributing

Contributing is quite easy, fork this repo and submit a pull request with the changes.
To build this module run `.\build.ps1 -Task Build` in PowerShell.
To test a build run `.\build.ps1 -Task Test` in PowerShell.
The script `./tools/run-samba.sh` can be used to run Samba inside a test container that is needed to run some of the tests locally.
This script will ensure all dependencies are installed before running the test suite.
17 changes: 16 additions & 1 deletion docs/en-US/Get-OpenADAuthSupport.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Get client authentication capabilities.
## SYNTAX

```
Get-OpenADAuthSupport [<CommonParameters>]
Get-OpenADAuthSupport [-ProgressAction <ActionPreference>] [<CommonParameters>]
```

## DESCRIPTION
Expand All @@ -30,6 +30,21 @@ Get the authentication support information for the current client.

## PARAMETERS

### -ProgressAction
New common parameter introduced in PowerShell 7.4.

```yaml
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
Expand Down
27 changes: 22 additions & 5 deletions docs/en-US/Get-OpenADComputer.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,28 @@ Get one or more Active Directory computers.
```
Get-OpenADComputer [-Server <String>] [-AuthType <AuthenticationMethod>]
[-SessionOption <OpenADSessionOptions>] [-StartTLS] [-Credential <PSCredential>] [-LDAPFilter <String>]
[-SearchBase <String>] [-SearchScope <SearchScope>] [-Property <String[]>] [<CommonParameters>]
[-SearchBase <String>] [-SearchScope <SearchScope>] [-Property <String[]>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
```

### SessionIdentity
```
Get-OpenADComputer -Session <OpenADSession> [-Identity] <ADPrincipalIdentityWithDollar> [-Property <String[]>]
[<CommonParameters>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
```

### SessionLDAPFilter
```
Get-OpenADComputer -Session <OpenADSession> [-LDAPFilter <String>] [-SearchBase <String>]
[-SearchScope <SearchScope>] [-Property <String[]>] [<CommonParameters>]
[-SearchScope <SearchScope>] [-Property <String[]>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
```

### ServerIdentity
```
Get-OpenADComputer [-Server <String>] [-AuthType <AuthenticationMethod>]
[-SessionOption <OpenADSessionOptions>] [-StartTLS] [-Credential <PSCredential>]
[-Identity] <ADPrincipalIdentityWithDollar> [-Property <String[]>] [<CommonParameters>]
[-Identity] <ADPrincipalIdentityWithDollar> [-Property <String[]>] [-ProgressAction <ActionPreference>]
[<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -136,7 +138,7 @@ Accept wildcard characters: False
```

### -Identity
Specifies the Active Directory computer object to search for using one fo the following formats:
Specifies the Active Directory computer object to search for using one of the following formats:

+ `DistinguishedName`

Expand Down Expand Up @@ -180,6 +182,21 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -ProgressAction
New common parameter introduced in PowerShell 7.4.

```yaml
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Property
The attributes to retrieve for each computer object returned.
The values of each attribute is in the form of an LDAP attribute name and are case insensitive.
Expand Down
25 changes: 20 additions & 5 deletions docs/en-US/Get-OpenADGroup.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,26 @@ Gets one or more Active Directory groups.
```
Get-OpenADGroup [-Server <String>] [-AuthType <AuthenticationMethod>] [-SessionOption <OpenADSessionOptions>]
[-StartTLS] [-Credential <PSCredential>] [-LDAPFilter <String>] [-SearchBase <String>]
[-SearchScope <SearchScope>] [-Property <String[]>] [<CommonParameters>]
[-SearchScope <SearchScope>] [-Property <String[]>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
```

### SessionIdentity
```
Get-OpenADGroup -Session <OpenADSession> [-Identity] <ADPrincipalIdentity> [-Property <String[]>]
[<CommonParameters>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
```

### SessionLDAPFilter
```
Get-OpenADGroup -Session <OpenADSession> [-LDAPFilter <String>] [-SearchBase <String>]
[-SearchScope <SearchScope>] [-Property <String[]>] [<CommonParameters>]
[-SearchScope <SearchScope>] [-Property <String[]>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
```

### ServerIdentity
```
Get-OpenADGroup [-Server <String>] [-AuthType <AuthenticationMethod>] [-SessionOption <OpenADSessionOptions>]
[-StartTLS] [-Credential <PSCredential>] [-Identity] <ADPrincipalIdentity> [-Property <String[]>]
[<CommonParameters>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -136,7 +136,7 @@ Accept wildcard characters: False
```

### -Identity
Specifies the Active Directory group object to search for using one fo the following formats:
Specifies the Active Directory group object to search for using one of the following formats:

+ `DistinguishedName`

Expand Down Expand Up @@ -180,6 +180,21 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -ProgressAction
New common parameter introduced in PowerShell 7.4.

```yaml
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Property
The attributes to retrieve for each group object returned.
The values of each attribute is in the form of an LDAP attribute name and are case insensitive.
Expand Down
25 changes: 21 additions & 4 deletions docs/en-US/Get-OpenADGroupMember.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,28 @@ Gets the members of an Active Directory group.
```
Get-OpenADGroupMember [-Recursive] [-Server <String>] [-AuthType <AuthenticationMethod>]
[-SessionOption <OpenADSessionOptions>] [-StartTLS] [-Credential <PSCredential>]
[-Identity] <ADPrincipalIdentity> [-Property <String[]>] [<CommonParameters>]
[-Identity] <ADPrincipalIdentity> [-Property <String[]>] [-ProgressAction <ActionPreference>]
[<CommonParameters>]
```

### SessionIdentity
```
Get-OpenADGroupMember [-Recursive] -Session <OpenADSession> [-Identity] <ADPrincipalIdentity>
[-Property <String[]>] [<CommonParameters>]
[-Property <String[]>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
```

### SessionLDAPFilter
```
Get-OpenADGroupMember [-Recursive] -Session <OpenADSession> [-LDAPFilter <String>] [-SearchBase <String>]
[-SearchScope <SearchScope>] [-Property <String[]>] [<CommonParameters>]
[-SearchScope <SearchScope>] [-Property <String[]>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
```

### ServerLDAPFilter
```
Get-OpenADGroupMember [-Recursive] [-Server <String>] [-AuthType <AuthenticationMethod>]
[-SessionOption <OpenADSessionOptions>] [-StartTLS] [-Credential <PSCredential>] [-LDAPFilter <String>]
[-SearchBase <String>] [-SearchScope <SearchScope>] [-Property <String[]>] [<CommonParameters>]
[-SearchBase <String>] [-SearchScope <SearchScope>] [-Property <String[]>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -168,6 +170,21 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -ProgressAction
New common parameter introduced in PowerShell 7.4.

```yaml
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Property
The attributes to retrieve for each computer object returned.
The values of each attribute is in the form of an LDAP attribute name and are case insensitive.
Expand Down
28 changes: 23 additions & 5 deletions docs/en-US/Get-OpenADObject.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,29 @@ Gets one or more Active Directory objects.
```
Get-OpenADObject [-IncludeDeletedObjects] [-Server <String>] [-AuthType <AuthenticationMethod>]
[-SessionOption <OpenADSessionOptions>] [-StartTLS] [-Credential <PSCredential>] [-LDAPFilter <String>]
[-SearchBase <String>] [-SearchScope <SearchScope>] [-Property <String[]>] [<CommonParameters>]
[-SearchBase <String>] [-SearchScope <SearchScope>] [-Property <String[]>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
```

### SessionIdentity
```
Get-OpenADObject [-IncludeDeletedObjects] -Session <OpenADSession> [-Identity] <ADObjectIdentity>
[-Property <String[]>] [<CommonParameters>]
[-Property <String[]>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
```

### SessionLDAPFilter
```
Get-OpenADObject [-IncludeDeletedObjects] -Session <OpenADSession> [-LDAPFilter <String>]
[-SearchBase <String>] [-SearchScope <SearchScope>] [-Property <String[]>] [<CommonParameters>]
[-SearchBase <String>] [-SearchScope <SearchScope>] [-Property <String[]>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
```

### ServerIdentity
```
Get-OpenADObject [-IncludeDeletedObjects] [-Server <String>] [-AuthType <AuthenticationMethod>]
[-SessionOption <OpenADSessionOptions>] [-StartTLS] [-Credential <PSCredential>]
[-Identity] <ADObjectIdentity> [-Property <String[]>] [<CommonParameters>]
[-Identity] <ADObjectIdentity> [-Property <String[]>] [-ProgressAction <ActionPreference>]
[<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -127,7 +130,7 @@ Accept wildcard characters: False
```

### -Identity
Specifies the Active Directory object to search for using one fo the following formats:
Specifies the Active Directory object to search for using one of the following formats:

+ `DistinguishedName`

Expand Down Expand Up @@ -183,6 +186,21 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -ProgressAction
New common parameter introduced in PowerShell 7.4.

```yaml
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Property
The attributes to retrieve for each object returned.
The values of each attribute is in the form of an LDAP attribute name and are case insensitive.
Expand Down
26 changes: 22 additions & 4 deletions docs/en-US/Get-OpenADPrincipalGroupMembership.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,29 @@ Get the Active Directory groups that an object belongs to.
```
Get-OpenADPrincipalGroupMembership [-Recursive] [-Server <String>] [-AuthType <AuthenticationMethod>]
[-SessionOption <OpenADSessionOptions>] [-StartTLS] [-Credential <PSCredential>]
[-Identity] <ADPrincipalIdentity> [-Property <String[]>] [<CommonParameters>]
[-Identity] <ADPrincipalIdentity> [-Property <String[]>] [-ProgressAction <ActionPreference>]
[<CommonParameters>]
```

### SessionIdentity
```
Get-OpenADPrincipalGroupMembership [-Recursive] -Session <OpenADSession> [-Identity] <ADPrincipalIdentity>
[-Property <String[]>] [<CommonParameters>]
[-Property <String[]>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
```

### SessionLDAPFilter
```
Get-OpenADPrincipalGroupMembership [-Recursive] -Session <OpenADSession> [-LDAPFilter <String>]
[-SearchBase <String>] [-SearchScope <SearchScope>] [-Property <String[]>] [<CommonParameters>]
[-SearchBase <String>] [-SearchScope <SearchScope>] [-Property <String[]>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
```

### ServerLDAPFilter
```
Get-OpenADPrincipalGroupMembership [-Recursive] [-Server <String>] [-AuthType <AuthenticationMethod>]
[-SessionOption <OpenADSessionOptions>] [-StartTLS] [-Credential <PSCredential>] [-LDAPFilter <String>]
[-SearchBase <String>] [-SearchScope <SearchScope>] [-Property <String[]>] [<CommonParameters>]
[-SearchBase <String>] [-SearchScope <SearchScope>] [-Property <String[]>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -157,6 +160,21 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -ProgressAction
New common parameter introduced in PowerShell 7.4.

```yaml
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Property
The attributes to retrieve for each group object returned.
The values of each attribute is in the form of an LDAP attribute name and are case insensitive.
Expand Down
Loading

0 comments on commit 29a0057

Please sign in to comment.