Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

Get-MsolContact

Published: March 22, 2013

Updated: January 21, 2014

Applies To: Office 365, Windows Azure, Windows Intune

noteNote
  • This topic provides online help content for cloud services, such as Windows Intune and Office 365, which rely on Windows Azure Active Directory for identity and directory services.

  • The Windows Azure Active Directory Module for Windows PowerShell cmdlets were previously known as the Microsoft Online Services Module for Windows PowerShell cmdlets.

The Get-MsolContact cmdlet can be used to retrieve a contact object, or list of contacts. A single contact will be retrieved if the ObjectId is used.

Get-MsolContact [-HasErrorsOnly] [-MaxResults <int>] [-SearchString <string>] [-TenantId <Guid>] [<CommonParameters>]
Get-MsolContact [-All] [-TenantId <Guid>] [<CommonParameters>]
Get-MsolContact -ObjectId <Guid> [-TenantId <Guid>] [<CommonParameters>]
    -All [<SwitchParameter>]
        If present then all results will be returned.  Cannot be used with 
        MaxResults parameter.
        
        Required?                    false
        Position?                    named
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -HasErrorsOnly [<SwitchParameter>]
        The filter for only contacts with validation errors.
        
        Required?                    false
        Position?                    named
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -MaxResults <int>
        The maximum number of results returned for a search. If not specified, 
        500 results will be returned.
        
        Required?                    false
        Position?                    named
        Default value                500
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -ObjectId <Guid>
        The unique ID of the contact to retrieve.
        
        Required?                    true
        Position?                    named
        Default value                
        Accept pipeline input?       true (ByPropertyName)
        Accept wildcard characters?  false
        
    -SearchString <string>
        The string to search on. Only contacts with a display name or email 
        address starting with this string will be returned.
        
        Required?                    false
        Position?                    named
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -TenantId <Guid>
        The unique ID of the tenant to perform the operation on. If this is 
        not provided, then the value will default to the tenant of the current 
        user. This parameter is only applicable to partner users.
        
        Required?                    false
        Position?                    named
        Default value                
        Accept pipeline input?       true (ByPropertyName)
        Accept wildcard characters?  false
        
    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer and OutVariable. For more information, type,
        "get-help about_commonparameters".

The output is provided by Microsoft.Online.Administration.Contact. This cmdlet returns contact objects, which include the following information:

  • City: The contact's city.

  • Country: The contact's country.

  • 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.

  • 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.

The following command retrieves a contact.

Get-MsolContact -ObjectId <id>

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

Get-MsolContact -SearchString "Melissa"

See Also

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.