Skip to content

Get-ADUserPrimaryComputer

SYNOPSIS

Retrieves the primary computer associated with an Active Directory user.

SYNTAX

Get-ADUserPrimaryComputer [-Identity] <String[]> [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

The `Get-ADUserPrimaryComputer` function retrieves the primary computer associated with a specified Active Directory user. It queries both Active Directory and an external HEAT database to determine the computer most frequently associated with the user.

EXAMPLES

EXAMPLE 1

Get-ADUserPrimaryComputer -Identity "jdoe"

Retrieves the primary computer associated with the user "jdoe."

EXAMPLE 2

Get-ADUserPrimaryComputer -Identity @("jdoe", "asmith")

Retrieves the primary computers associated with the users "jdoe" and "asmith."

PARAMETERS

-Identity

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

Type: String[]
Parameter Sets: (All)
Aliases:

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

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

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

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