Skip to content

Get-UserDriveMapping

SYNOPSIS

Retrieve drive mappings for a specified user.

SYNTAX

Get-UserDriveMapping [-Identity] <String> [<CommonParameters>]

DESCRIPTION

This function retrieves drive mappings for a specified user by querying Active Directory, SQL databases, DFS links, and logon scripts. It consolidates information about home drives, AD group-based mappings, logon script mappings, and manually mapped drives. The results include drive letters, root paths, connection types, and DFS targets.

EXAMPLES

EXAMPLE 1

Get-UserDriveMapping -Identity "johndoe"

Retrieves all drive mappings for the user "johndoe".

EXAMPLE 2

Get-UserDriveMapping -Identity "jane.smith"

Retrieves all drive mappings for the user "jane.smith", including home drives, AD group mappings, and logon script mappings.

PARAMETERS

-Identity

The identity of the user to retrieve drive mappings for. Accepts DistinguishedName, UserPrincipalName, sAMAccountName, or Mailbox.

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

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