Skip to content

Commit

Permalink
xActiveDirectory: Fixes Issue #340 #339 #335 #330 (#440)
Browse files Browse the repository at this point in the history
- Fixed Comment based help for the following resources:
  - xADUser (issue #340).
  - xADOrganizational Unit (issue #339).
  - xADDomain (issue #335).
  - xADRecycleBin (issue #330).
  • Loading branch information
kungfu71186 authored and johlju committed Jul 21, 2019
1 parent 6cc03a6 commit 621e285
Show file tree
Hide file tree
Showing 5 changed files with 1,004 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@
([issue #40](https://github.com/PowerShell/xActiveDirectory/issues/40)).
[Svilen @SSvilen](https://github.com/SSvilen)
- Refactored unit tests for Test-TargetResource.
- Fixed Comment based help for the following resources:
- xADUser ([issue #340](https://github.com/PowerShell/xActiveDirectory/issues/340)).
- xADOrganizational Unit ([issue #339](https://github.com/PowerShell/xActiveDirectory/issues/339)).
- xADDomain ([issue #335](https://github.com/PowerShell/xActiveDirectory/issues/335)).
- xADRecycleBin ([issue #330](https://github.com/PowerShell/xActiveDirectory/issues/330)).

## 3.0.0.0

Expand Down
114 changes: 114 additions & 0 deletions DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,44 @@ function Get-TrackingFilename
return Join-Path -Path ($env:temp) -ChildPath ('{0}.xADDomain.completed' -f $DomainName)
}

<#
.SYNOPSIS
Get the current state of the Domain.
.PARAMETER DomainName
The fully qualified domain name (FQDN) of the new domain.
.PARAMETER DomainAdministratorCredential
Credentials used to query for domain existence.
.PARAMETER SafemodeAdministratorPassword
Password for the administrator account when the computer is started in Safe Mode.
.PARAMETER ParentDomainName
Fully qualified domain name (FQDN) of the parent domain.
.PARAMETER DomainNetBIOSName
NetBIOS name for the new domain.
.PARAMETER DnsDelegationCredential
Credential used for creating DNS delegation.
.PARAMETER DatabasePath
Path to a directory that contains the domain database.
.PARAMETER LogPath
Path to a directory for the log file that will be written.
.PARAMETER SysvolPath
Path to a directory where the Sysvol file will be written.
.PARAMETER ForestMode
The Forest Functional Level for the entire forest.
.PARAMETER DomainMode
The Domain Functional Level for the entire domain.
#>
function Get-TargetResource
{
[OutputType([System.Collections.Hashtable])]
Expand Down Expand Up @@ -192,6 +230,44 @@ function Get-TargetResource

} #end function Get-TargetResource

<#
.SYNOPSIS
Tests the current state of the Domain.
.PARAMETER DomainName
The fully qualified domain name (FQDN) of the new domain.
.PARAMETER DomainAdministratorCredential
Credentials used to query for domain existence.
.PARAMETER SafemodeAdministratorPassword
Password for the administrator account when the computer is started in Safe Mode.
.PARAMETER ParentDomainName
Fully qualified domain name (FQDN) of the parent domain.
.PARAMETER DomainNetBIOSName
NetBIOS name for the new domain.
.PARAMETER DnsDelegationCredential
Credential used for creating DNS delegation.
.PARAMETER DatabasePath
Path to a directory that contains the domain database.
.PARAMETER LogPath
Path to a directory for the log file that will be written.
.PARAMETER SysvolPath
Path to a directory where the Sysvol file will be written.
.PARAMETER ForestMode
The Forest Functional Level for the entire forest.
.PARAMETER DomainMode
The Domain Functional Level for the entire domain.
#>
function Test-TargetResource
{
[OutputType([System.Boolean])]
Expand Down Expand Up @@ -293,6 +369,44 @@ function Test-TargetResource
}
} #end function Test-TargetResource

<#
.SYNOPSIS
Sets the state of the Domain.
.PARAMETER DomainName
The fully qualified domain name (FQDN) of the new domain.
.PARAMETER DomainAdministratorCredential
Credentials used to query for domain existence.
.PARAMETER SafemodeAdministratorPassword
Password for the administrator account when the computer is started in Safe Mode.
.PARAMETER ParentDomainName
Fully qualified domain name (FQDN) of the parent domain.
.PARAMETER DomainNetBIOSName
NetBIOS name for the new domain.
.PARAMETER DnsDelegationCredential
Credential used for creating DNS delegation.
.PARAMETER DatabasePath
Path to a directory that contains the domain database.
.PARAMETER LogPath
Path to a directory for the log file that will be written.
.PARAMETER SysvolPath
Path to a directory where the Sysvol file will be written.
.PARAMETER ForestMode
The Forest Functional Level for the entire forest.
.PARAMETER DomainMode
The Domain Functional Level for the entire domain.
#>
function Set-TargetResource
{
<#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ Import-Module -Name (Join-Path -Path $script:localizationModulePath -ChildPath '

$script:localizedData = Get-LocalizedData -ResourceName 'MSFT_xADOrganizationalUnit'

<#
.SYNOPSIS
Gets the Organization Unit (OU) from Active Directory
.PARAMETER Name
The name of Organization Unit (OU).
.PARAMETER Path
Specifies the X.500 path of the Organization Unit (OU) or container
where the new object is created.
#>
function Get-TargetResource
{
[CmdletBinding()]
Expand Down Expand Up @@ -57,6 +69,37 @@ function Get-TargetResource
}
} # end function Get-TargetResource

<#
.SYNOPSIS
Tests the state of the specified Organization Unit (OU).
.PARAMETER Name
The name of Organization Unit (OU).
.PARAMETER Path
Specifies the X.500 path of the Organization Unit (OU) or container
where the new object is created.
.PARAMETER Ensure
Specifies whether the Organization Unit (OU) is present or absent.
Default value is 'Present'.
.PARAMETER Credential
The credential to be used to perform the operation on Active Directory.
.PARAMETER ProtectedFromAccidentalDeletion
Specifies if the Organization Unit (OU) container should be protected
from deletion. Default value is $true.
.PARAMETER Description
The description of the Organization Unit (OU). Default value is empty
('') description.
.PARAMETER RestoreFromRecycleBin
Try to restore the Organization Unit (OU) from the recycle bin before
creating a new one.
#>
function Test-TargetResource
{
[CmdletBinding()]
Expand Down Expand Up @@ -153,6 +196,37 @@ function Test-TargetResource

} #end function Test-TargetResource

<#
.SYNOPSIS
Sets the state of the Organization Unit (OU) in Active Directory.
.PARAMETER Name
The name of Organization Unit (OU).
.PARAMETER Path
Specifies the X.500 path of the Organization Unit (OU) or container
where the new object is created.
.PARAMETER Ensure
Specifies whether the Organization Unit (OU) is present or absent.
Default value is 'Present'.
.PARAMETER Credential
The credential to be used to perform the operation on Active Directory.
.PARAMETER ProtectedFromAccidentalDeletion
Specifies if the Organization Unit (OU) container should be protected
from deletion. Default value is $true.
.PARAMETER Description
The description of the Organization Unit (OU). Default value is empty
('') description.
.PARAMETER RestoreFromRecycleBin
Try to restore the Organization Unit (OU) from the recycle bin before
creating a new one.
#>
function Set-TargetResource
{
[CmdletBinding()]
Expand Down
33 changes: 33 additions & 0 deletions DSCResources/MSFT_xADRecycleBin/MSFT_xADRecycleBin.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ Import-Module -Name (Join-Path -Path $script:localizationModulePath -ChildPath '

$script:localizedData = Get-LocalizedData -ResourceName 'MSFT_xADRecycleBin'

<#
.SYNOPSIS
Gets the state of the Active Directory recycle bin.
.PARAMETER ForestFQDN
The fully qualified domain name (FQDN) of the forest in which to change the Recycle Bin feature.
.PARAMETER EnterpriseAdministratorCredential
The user account credentials to use to perform this task.
#>
function Get-TargetResource
{
[CmdletBinding()]
Expand Down Expand Up @@ -71,6 +82,17 @@ function Get-TargetResource
}
}

<#
.SYNOPSIS
Sets the state of the Active Directory recycle bin.
.PARAMETER ForestFQDN
The fully qualified domain name (FQDN) of the forest in which to change the Recycle Bin feature.
.PARAMETER EnterpriseAdministratorCredential
The user account credentials to use to perform this task.
#>
function Set-TargetResource
{
[CmdletBinding(SupportsShouldProcess = $true)]
Expand Down Expand Up @@ -131,6 +153,17 @@ function Set-TargetResource
}
}

<#
.SYNOPSIS
Tests the state the Active Directory recycle bin.
.PARAMETER ForestFQDN
The fully qualified domain name (FQDN) of the forest in which to change the Recycle Bin feature.
.PARAMETER EnterpriseAdministratorCredential
The user account credentials to use to perform this task.
#>
function Test-TargetResource
{
[CmdletBinding()]
Expand Down
Loading

0 comments on commit 621e285

Please sign in to comment.