Get-​Msol​Contact

Gets contacts from Azure Active Directory.

Syntax

Get-MsolContact
   [-All]
   [-HasErrorsOnly <Boolean>]
   [-SearchString <String>]
   [-TenantId <Guid>]
   [<CommonParameters>]
Get-MsolContact
   [-HasErrorsOnly <Boolean>]
   [-MaxResults <Int32>]
   [-SearchString <String>]
   [-TenantId <Guid>]
   [<CommonParameters>]
Get-MsolContact
   -ObjectId <Guid>
   [-TenantId <Guid>]
   [<CommonParameters>]

Description

The Get-MsolContact cmdlet gets a contact object or list of contacts. Specify the ObjectId parameter to get a single contact.

Examples

Example 1: Get a contact

PS C:\> Get-MsolContact -ObjectId adc41dc7-4130-4215-adfb-2403bc9f844e

This command retrieves a contact.

Example 2: Get contacts that match a string

PS C:\> Get-MsolContact -SearchString "Patti"

This command retrieves a list of contacts with a display name or email address starting with Patti.

Required Parameters

-All

Indicates that this cmdlet returns all results that it finds. Do not specify this parameter and the MaxResults parameter.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ObjectId

Specifies the unique object ID of the contact to get.

Type:Guid
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-HasErrorsOnly

Indicates that this cmdlet returns contacts that have validation errors.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-MaxResults

Specifies the maximum number of results that this cmdlet returns. The default value is 500.

Type:Int32
Position:Named
Default value:500
Accept pipeline input:False
Accept wildcard characters:False
-SearchString

Specifies a string. This cmdlet returns contacts with a display name or email address that start with this string.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-TenantId

Specifies the unique ID of the tenant on which to perform the operation. The default value is the tenant of the current user. This parameter applies only to partner users.

Type:Guid
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Outputs

Microsoft.Online.Administration.Contact