Skip to content

Suspend-ADUser

SYNOPSIS

Suspends an Active Directory user account.

SYNTAX

Suspend-ADUser [-Identity] <String> [-Task] <Int32> [<CommonParameters>]

DESCRIPTION

The `Suspend-ADUser` function disables an Active Directory user account, moves it to an "Inactive" organizational unit (OU), and adds a note to the account for tracking purposes. It ensures the user is not already disabled and handles organizational structure validation.

EXAMPLES

EXAMPLE 1

Suspend-ADUser -Identity "jdoe" -Task 12345

Disables the user account "jdoe," moves it to the "Inactive" OU, and logs the task with number 12345.

PARAMETERS

-Identity

The identity of the Active Directory user to suspend (e.g., DistinguishedName, sAMAccountName, or UserPrincipalName).

Type: String
Parameter Sets: (All)
Aliases: DN, DistinguishedName, sAMAccountName, UPN, UserPrincipalName

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

-Task

The HEAT task number associated with the suspension operation.

Type: Int32
Parameter Sets: (All)
Aliases: TaskNumber, TaskNr

Required: True
Position: 2
Default value: 0
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.

INPUTS

OUTPUTS

NOTES