Skip to content

ConvertTo-SoftUser

SYNOPSIS

Converts an Active Directory user to a "Soft User" by downgrading permissions and moving the user to a specific organizational unit.

SYNTAX

ConvertTo-SoftUser [-Identity] <String> [-Task] <Int32> [<CommonParameters>]

DESCRIPTION

The `ConvertTo-SoftUser` function removes excessive permissions, mailbox rights, and home drive for the specified Active Directory user. It then moves the user to a designated "Soft User" organizational unit (OU), renames the user with a "[SOFT]" prefix, and logs the action in Active Directory notes.

EXAMPLES

EXAMPLE 1

ConvertTo-SoftUser -Identity "jdoe" -Task 123

Converts the user "jdoe" to a "Soft User" by removing permissions, moving the user to the "Soft User" OU, and logging the action with task ID 123.

EXAMPLE 2

ConvertTo-SoftUser -Identity "CN=John Doe,OU=Users,DC=example,DC=com" -Task 456

Converts the user "John Doe" to a "Soft User" by downgrading permissions, moving the user to the "Soft User" OU, and logging the action with task ID 456.

PARAMETERS

-Identity

The identity of the Active Directory user to be converted (e.g., DistinguishedName, UserPrincipalName, or SamAccountName).

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

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

-Task

The task ID associated with the action being logged.

Type: Int32
Parameter Sets: (All)
Aliases: 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