Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xADObjectPermissionEntry: Using more generic "AD:" to prevent errors #243

Merged
merged 22 commits into from
Mar 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d622c17
Merge pull request #82 from PowerShell/dev
kwirkykat Mar 30, 2016
295e8b5
Merge pull request #93 from PowerShell/dev
kwirkykat May 18, 2016
0f0d3fe
Merge pull request #102 from PowerShell/dev
kwirkykat Jun 29, 2016
7da96fa
Merge pull request #112 from PowerShell/dev
kwirkykat Aug 10, 2016
2a56926
Merge pull request #123 from PowerShell/dev
kwirkykat Nov 2, 2016
ea9e6ff
Merge pull request #129 from PowerShell/dev
kwirkykat Dec 14, 2016
8e4905a
Merge pull request #138 from PowerShell/dev
kwirkykat Jan 11, 2017
93285d2
Merge pull request #182 from PowerShell/dev
kwirkykat Feb 8, 2018
f4e0980
Merge pull request #188 from PowerShell/dev
kwirkykat Mar 21, 2018
1e3046a
Merge pull request #209 from PowerShell/dev
kwirkykat Jun 13, 2018
776fe7b
Merge pull request #216 from PowerShell/dev
kwirkykat Jul 25, 2018
36fe9aa
Merge pull request #226 from PowerShell/dev
kwirkykat Sep 5, 2018
b2e3aef
Merge pull request #233 from PowerShell/dev
kwirkykat Oct 24, 2018
f8c8ea2
Merge pull request #237 from PowerShell/dev
kwirkykat Jan 9, 2019
c8ef399
Merge pull request #242 from PowerShell/dev
kwirkykat Feb 20, 2019
c34f2ad
Using more generic AD: to circumvent errors: https://github.com/Power…
DennisGaida Feb 28, 2019
bb5308c
Merge branch 'master' of https://github.com/DennisGaida/xActiveDirect…
DennisGaida Mar 19, 2019
bb7b7fd
Merge branch 'dev' of https://github.com/PowerShell/xActiveDirectory …
DennisGaida Mar 19, 2019
405cd1b
Using more generic AD: to circumvent errors: https://github.com/Power…
DennisGaida Feb 28, 2019
9ca505c
Merge branch 'dev' of https://github.com/DennisGaida/xActiveDirectory…
DennisGaida Mar 25, 2019
63b1d52
* Updated changelog with xADObjectPermissionEntry
DennisGaida Mar 25, 2019
81146e9
Merge remote-tracking branch 'upstream/dev' into dev
DennisGaida Mar 25, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function Get-TargetResource
}

# Get the current acl
$acl = Get-Acl -Path "Microsoft.ActiveDirectory.Management\ActiveDirectory:://RootDSE/$Path"
$acl = Get-Acl -Path "AD:$Path"

foreach ($access in $acl.Access)
{
Expand Down Expand Up @@ -187,7 +187,7 @@ function Set-TargetResource
Import-Module -Name 'ActiveDirectory' -Verbose:$false

# Get the current acl
$acl = Get-Acl -Path "Microsoft.ActiveDirectory.Management\ActiveDirectory:://RootDSE/$Path"
$acl = Get-Acl -Path "AD:$Path"

if ($Ensure -eq 'Present')
{
Expand Down Expand Up @@ -229,7 +229,7 @@ function Set-TargetResource
}

# Set the updated acl to the object
$acl | Set-Acl -Path "Microsoft.ActiveDirectory.Management\ActiveDirectory:://RootDSE/$Path"
$acl | Set-Acl -Path "AD:$Path"
}

<#
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ The xADForestProperties DSC resource will manage User Principal Name (UPN) suffi

* Added xADReplicationSiteLink
* New resource added to facilitate replication between AD sites
* Updated xADObjectPermissionEntry to use `AD:` which is more generic when using `Get-Acl` and `Set-Acl` than using `Microsoft.ActiveDirectory.Management\ActiveDirectory:://RootDSE/`
* Changes to xADComputer
* Minor clean up of unit tests.
* Changes to xADUser
Expand Down
4 changes: 2 additions & 2 deletions Tests/Unit/MSFT_xADObjectPermissionEntry.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ try
}
$mockGetAclPresent = {
$mock = [PSCustomObject] @{
Path = 'Microsoft.ActiveDirectory.Management\ActiveDirectory:://RootDSE/CN=PC01,CN=Computers,DC=contoso,DC=com'
Path = 'AD:CN=PC01,CN=Computers,DC=contoso,DC=com'
Owner = 'BUILTIN\Administrators'
Access = @(
[PSCustomObject] @{
Expand All @@ -72,7 +72,7 @@ try
}
$mockGetAclAbsent = {
$mock = [PSCustomObject] @{
Path = 'Microsoft.ActiveDirectory.Management\ActiveDirectory:://RootDSE/CN=PC,CN=Computers,DC=lab,DC=local'
Path = 'AD:CN=PC,CN=Computers,DC=lab,DC=local'
Owner = 'BUILTIN\Administrators'
Access = @()
}
Expand Down