Skip to content

Commit

Permalink
Changes to xActiveDirectory
Browse files Browse the repository at this point in the history
- Changes to xADObjectPermissionEntry
  - Remove remnants of the `SupportsShouldProcess` (issue dsccommunity#329).
- Changes to xADRecycleBin
  - Removed `SupportsShouldProcess` from the resource since DSC does not
    support that interactive function (issue dsccommunity#328).
  • Loading branch information
johlju committed Jul 21, 2019
1 parent 22010a5 commit 0604804
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
([issue #332](https://github.com/PowerShell/xActiveDirectory/pull/332)).
- Changes to xADRecycleBin
- Updated tests and remove unnecessary mocks of `Write-Error`.
- Removed `SupportsShouldProcess` from the resource since DSC does not
support that interactive function ([issue #328](https://github.com/PowerShell/xActiveDirectory/issues/328)).
- Changes to xADServicePrincipalName
- Minor change to the unit tests that did not correct assert the localized
string when an account is not found.
Expand All @@ -73,6 +75,8 @@
([issue #40](https://github.com/PowerShell/xActiveDirectory/issues/40)).
[Svilen @SSvilen](https://github.com/SSvilen)
- Refactored unit tests for Test-TargetResource.
- Changes to xADObjectPermissionEntry
- Remove remnants of the `SupportsShouldProcess` ([issue #329](https://github.com/PowerShell/xActiveDirectory/issues/329)).

## 3.0.0.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ function Get-TargetResource
#>
function Set-TargetResource
{
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSShouldProcess', '')]
[CmdletBinding(SupportsShouldProcess = $true)]
[CmdletBinding()]
param
(
[Parameter()]
Expand Down
15 changes: 6 additions & 9 deletions DSCResources/MSFT_xADRecycleBin/MSFT_xADRecycleBin.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function Get-TargetResource

function Set-TargetResource
{
[CmdletBinding(SupportsShouldProcess = $true)]
[CmdletBinding()]
param
(
[Parameter(Mandatory = $true)]
Expand All @@ -100,15 +100,12 @@ function Set-TargetResource
throw ($script:localizedData.ForestFunctionalLevelError -f $forest.ForestMode)
}

if ($PSCmdlet.ShouldProcess($forest.RootDomain, "Enable Active Directory Recycle Bin"))
{
Write-Verbose -Message $script:localizedData.EnablingRecycleBin
Write-Verbose -Message ($script:localizedData.EnablingRecycleBin -f $forest.RootDomain)

Enable-ADOptionalFeature 'Recycle Bin Feature' -Scope ForestOrConfigurationSet `
-Target $forest.RootDomain -Server $forest.DomainNamingMaster `
-Credential $EnterpriseAdministratorCredential `
-Verbose
}
Enable-ADOptionalFeature 'Recycle Bin Feature' -Scope ForestOrConfigurationSet `
-Target $forest.RootDomain -Server $forest.DomainNamingMaster `
-Credential $EnterpriseAdministratorCredential `
-Verbose
}
catch [Microsoft.ActiveDirectory.Management.ADIdentityNotFoundException], [Microsoft.ActiveDirectory.Management.ADServerDownException]
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ ConvertFrom-StringData @'
ForestFunctionalLevelError = Forest functional level '{0}' does not meet minimum requirement of Windows2008R2Forest or greater. (ADRB0006)
RecycleBinEnabled = Active Directory Recycle Bin is enabled. (ADRB0007)
RecycleBinNotEnabled = Active Directory Recycle Bin is not enabled. (ADRB0008)
EnablingRecycleBin = Enabling Active Directory Recycle Bin. (ADRB0009)
EnablingRecycleBin = Enabling Active Directory Recycle Bin in the forest '{0}'. (ADRB0009)
'@

0 comments on commit 0604804

Please sign in to comment.