external help file: Microsoft.Online.Administration.Automation.PSModule.dll-Help.xml online version: schema: 2.0.0 ms.assetid: 93C48D95-DB26-4F76-8078-CF845E9BCC8D ms.reviewer: rodejo ms.custom: iamfeature=PowerShell
Gets contacts from Azure Active Directory.
Get-MsolContact [-HasErrorsOnly <Boolean>] [-SearchString <String>] [-MaxResults <Int32>] [-TenantId <Guid>]
[<CommonParameters>]
Get-MsolContact -ObjectId <Guid> [-TenantId <Guid>] [<CommonParameters>]
Get-MsolContact [-HasErrorsOnly <Boolean>] [-SearchString <String>] [-All] [-TenantId <Guid>]
[<CommonParameters>]
The Get-MsolContact cmdlet gets a contact object or list of contacts. Specify the ObjectId parameter to get a single contact.
PS C:\> Get-MsolContact -ObjectId adc41dc7-4130-4215-adfb-2403bc9f844e
This command retrieves a contact.
PS C:\> Get-MsolContact -SearchString "Patti"
This command retrieves a list of contacts with a display name or email address starting with Patti.
Indicates that this cmdlet returns all results that it finds. Do not specify this parameter and the MaxResults parameter.
Type: SwitchParameter
Parameter Sets: All__0
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Indicates that this cmdlet returns contacts that have validation errors.
Type: Boolean
Parameter Sets: ListContacts__0, All__0
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the maximum number of results that this cmdlet returns. The default value is 500.
Type: Int32
Parameter Sets: ListContacts__0
Aliases:
Required: False
Position: Named
Default value: 500
Accept pipeline input: False
Accept wildcard characters: False
Specifies the unique object ID of the contact to get.
Type: Guid
Parameter Sets: GetContact__0
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specifies a string. This cmdlet returns contacts with a display name or email address that start with this string.
Type: String
Parameter Sets: ListContacts__0, All__0
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
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
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet returns contact objects, which include the following information:
-
City. The contact's city.
-
Country. The contact's country or region.
-
Department. The contact's department.
-
DisplayName. The contact's display name.
-
Fax. The contact's fax number.
-
FirstName. The contact's first name.
-
LastDirSyncTime. Returns the date and time of the last sync (only returned from contacts synced with Active Directory synchronization).
-
LastName. The contact's last name.
-
MobilePhone. The contact's mobile phone number.
-
ObjectId. The unique ID of the contact.
-
Office. The contact's office number.
-
Phone Number. The contact's phone number.
-
Postal Code. The contact's postal code.
-
Proxy Addresses. The proxy addresses associated with this contact.
-
State. The contact's state.
-
StreetAddress. The contact's street address.
-
Title. The contact's title.
-
UserPrincipalName. The user ID of the contact.
-
ValidationStatus. Whether or not the contact has any errors.