Site icon TOSS

Test-ADDSDomainControllerUninstallation

powershell

Test-ADDSDomainControllerUninstallation is accessible with the help of addsdeployment module. To install addsdeployment on your system please refer to this link.

Synopsis

Runs the prerequisites (only) for uninstalling a domain controller in Active Directory.

Description

The Test-ADDSDomainControllerUninstallation cmdlet runs those prerequisite checks (only) which would be performed if you were to use the Uninstall-ADDSDomainController cmdlet to uninstall a domain controller in Active Directory. It differs from using the -WhatIf parameter with the Uninstall-ADDSDomainController cmdlet in that instead of summarizing the changes that would occur during the uninstallation process, this cmdlet actually tests whether those changes are possible given the current environment.

For more information on the scope of these prerequisite checks that the ADDSDeployment module performs when using this cmdlet see the section “Prerequisite Checking” in Understand and Troubleshoot AD DS Simplified Administration.

Parameters

-Credential 
         Specifies the user name and password that corresponds to the account used to install the domain controller. To prompt the user to supply a password, use Runs the prerequisites (only) to determine if installing a domain controller is possible that includes a DNS server for the corp.contoso.com domain (using domain administrator credentials) and that prompts the user to correctly specify the Directory Services Restore Mode (DSRM) password."(Get-Credential)" in place of an existing PSCredential type. This causes Windows PowerShell to prompt the user to enter credentials using the Windows security login UI.

    Required?                    false
    Position?                    named
    Default value                NULL
    Accept pipeline input?       false
    Accept wildcard characters?  false

-DemoteOperationMasterRole <SwitchParameter>
    Indicates that (forced) demotion should continue even if an operations master role is discovered on domain controller from which AD DS is being removed.

    Required?                    false
    Position?                    named
    Default value                NULL
    Accept pipeline input?       false
    Accept wildcard characters?  false

-DnsDelegationRemovalCredential <PSCredential>
    Specifies the account credentials (user name and password) to use when you create or remove the DNS delegation. If you do not specify a value, the account credentials that you specify for the AD DS installation or removal are used to remove the DNS delegation. As an alternative, you can specify the asterisk (*) to prompt the user to enter credentials.

    Required?                    false
    Position?                    named
    Default value                NULL
    Accept pipeline input?       false
    Accept wildcard characters?  false

-Force <SwitchParameter>
    When this parameter is specified any warnings that might normally appear during the uninstallation and removal of the domain controller will be suppressed to allow the cmdlet to complete its operation. This parameter can be useful to include when scripting uninstallation.

    Required?                    false
    Position?                    named
    Default value                
    Accept pipeline input?       false
    Accept wildcard characters?  false

-ForceRemoval <SwitchParameter>
    Forces the removal of a domain controller. Use this parameter to force the uninstall of AD DS if you need to remove the domain controller and do not have connectivity to other domain controllers within the domain topology.

    Required?                    true
    Position?                    named
    Default value                NULL
    Accept pipeline input?       false
    Accept wildcard characters?  false

-IgnoreLastDCInDomainMismatch <SwitchParameter>
    Used in conjunction with -LastDomainControllerInDomain. This parameter specifies whether the Windows PowerShell ignores any inconsistency that it detects with the value that you specify for -LastDomainControllerInDomain. For example, if you specify -LastDomainControllerInDomain but Windows PowerShell detects that there is actually another active domain controller in the domain, you can specify -IgnoreLastDCInDomainMismatch to have Windows PowerShell continue the removal of AD DS from the domain controller despite the inconsistency that it has detected. Similarly, if you do not specify -LastDomainControllerInDomain but Windows PowerShell cannot detect that another domain controller is in the domain, you can specify -IgnoreLastDCInDomainMismatch to have Windows PowerShell continue to remove AD DS from the domain controller.

    Required?                    false
    Position?                    named
    Default value                NULL
    Accept pipeline input?       false
    Accept wildcard characters?  false

-IgnoreLastDnsServerForZone <SwitchParameter>
    Specifies whether to continue the removal of AD DS despite the fact that the domain controller is the last DNS server for one or more of the Active Directory-integrated DNS zones that it hosts.

    Required?                    false
    Position?                    named
    Default value                NULL
    Accept pipeline input?       false
    Accept wildcard characters?  false

-LastDomainControllerInDomain <SwitchParameter>
    Specifies whether the computer from which AD DS is being removed is the last domain controller in the domain.

    Required?                    false
    Position?                    named
    Default value                NULL
    Accept pipeline input?       false
    Accept wildcard characters?  false

-LocalAdministratorPassword <SecureString>
    Specifies a local administrator account password when AD DS is removed from a domain controller. In earlier releases, where uninstall of AD DS was done using Dcpromo.exe for demotion, the default was to allow an empty password for this setting. In Windows PowerShell, the ADDS Deployment module requires that a non-empty password string value be assigned. If a value is not provided for this parameter, you will be prompted to enter a value for the password at the Windows PowerShell prompt. The password value must be a secure string.

    Required?                    false
    Position?                    named
    Default value                NULL
    Accept pipeline input?       false
    Accept wildcard characters?  false

-NoRebootOnCompletion <SwitchParameter>
    Specifies whether to not restart the computer upon completion, regardless of success. (By default, reboot upon completion occurs when this cmdlet is used and this parameter is omitted.)

    Required?                    false
    Position?                    named
    Default value                
    Accept pipeline input?       false
    Accept wildcard characters?  false

-RemoveApplicationPartitions <SwitchParameter>
    Specifies whether to remove application partitions during the removal of AD DS from a domain controller.

    Required?                    false
    Position?                    named
    Default value                NULL
    Accept pipeline input?       false
    Accept wildcard characters?  false

-RemoveDnsDelegation <SwitchParameter>
    Specifies whether to preserve DNS delegations that point to this DNS server from the parent DNS zone.

    Required?                    false
    Position?                    named
    Default value                NULL
    Accept pipeline input?       false
    Accept wildcard characters?  false

-RetainDCMetadata <SwitchParameter>
    If this parameter is used it indicates that the domain controller should retain metadata for the domain after removal of AD DS from it.

    Required?                    false
    Position?                    named
    Default value                
    Accept pipeline input?       false
    Accept wildcard characters?  false

Syntax

Test-ADDSDomainControllerUninstallation [-LocalAdministratorPassword <SecureString>] [-Credential <PSCredential>] [-DemoteOperationMasterRole] [-DnsDelegationRemovalCredential <PSCredential>] [-IgnoreLastDCInDomainMismatch] [-IgnoreLastDnsServerForZone] [-LastDomainControllerInDomain] [-NoRebootOnCompletion] [-RemoveApplicationPartitions] [-RemoveDnsDelegation] [-RetainDCMetadata] [-Force] [<CommonParameters>]

Test-ADDSDomainControllerUninstallation [-LocalAdministratorPassword <SecureString>] [-Credential <PSCredential>] [-DemoteOperationMasterRole] [-ForceRemoval] [-NoRebootOnCompletion] [-Force] [<CommonParameters>]

————————– EXAMPLE 1 ————————–
C:\PS>Test-ADDSDomainControllerUninstallation
Runs the prerequisites (only) to determine if uninstalling an additional domain controller in a domain is possible and in such a way that it will prompt the user to set and confirm the local Administrator password prior to completing the uninstallation process.

You can check the Version, CommandType and Source of this cmdlet by giving below command.

Get-Command Test-ADDSDomainControllerUninstallation

You can also read about
. Uninstall-ADDSDomainController

Click on this Link for an Single place where you get all the PowerShell cmdlet sorted based on the modules.

You can also refer other blogs on PowerShell at link

You can also refer other blogs on Microsoft at link

And also if you required any technology you want to learn, let us know below we will publish them in our site http://tossolution.com/

Like our page in Facebook and follow us for New technical information.

References are taken from Microsoft

Exit mobile version