Skip to content

Move-HDrive

SYNOPSIS

Moves or migrates the home drive of an Active Directory user.

SYNTAX

Referte (Default)

Move-HDrive -UserDN <String> -RefDN <String> [<CommonParameters>]

Migrate

Move-HDrive -UserDN <String> [-Migrate] [<CommonParameters>]

DESCRIPTION

The `Move-HDrive` function moves or migrates the home drive of a specified Active Directory user. It supports referencing another user's home drive for structure, validates paths, and handles permissions. The function can also exclude specific file types during migration.

EXAMPLES

EXAMPLE 1

Move-HDrive -UserDN "CN=John Doe,OU=Users,DC=example,DC=com" -RefDN "CN=Jane Smith,OU=Users,DC=example,DC=com"

Moves the home drive of "John Doe" using the structure of "Jane Smith."

EXAMPLE 2

Move-HDrive -UserDN "CN=John Doe,OU=Users,DC=example,DC=com" -Migrate

Migrates the home drive of "John Doe" to a new location.

PARAMETERS

-UserDN

The distinguished name (DN) of the Active Directory user whose home drive is being moved or migrated.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-RefDN

The distinguished name (DN) of the reference user whose home drive structure will be used. Mandatory in the 'Referte' parameter set.

Type: String
Parameter Sets: Referte
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Migrate

A switch parameter that, when specified, migrates the home drive to a new location. Mandatory in the 'Migrate' parameter set.

Type: SwitchParameter
Parameter Sets: Migrate
Aliases:

Required: True
Position: Named
Default value: False
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