getUser

Gets information about an Azure Active Directory user.

NOTE: If you’re authenticating using a Service Principal then it must have permissions to Read directory data within the Windows Azure Active Directory API.

Example Usage

using Pulumi;
using AzureAD = Pulumi.AzureAD;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(AzureAD.GetUser.InvokeAsync(new AzureAD.GetUserArgs
        {
            UserPrincipalName = "user@hashicorp.com",
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-azuread/sdk/v4/go/azuread"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		opt0 := "user@hashicorp.com"
		_, err := azuread.LookupUser(ctx, &azuread.LookupUserArgs{
			UserPrincipalName: &opt0,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_azuread as azuread

example = azuread.get_user(user_principal_name="user@hashicorp.com")
import * as pulumi from "@pulumi/pulumi";
import * as azuread from "@pulumi/azuread";

const example = pulumi.output(azuread.getUser({
    userPrincipalName: "user@hashicorp.com",
}, { async: true }));

Using getUser

function getUser(args: GetUserArgs, opts?: InvokeOptions): Promise<GetUserResult>
def get_user(mail_nickname: Optional[str] = None,
             object_id: Optional[str] = None,
             user_principal_name: Optional[str] = None,
             opts: Optional[InvokeOptions] = None) -> GetUserResult
func LookupUser(ctx *Context, args *LookupUserArgs, opts ...InvokeOption) (*LookupUserResult, error)

Note: This function is named LookupUser in the Go SDK.

public static class GetUser {
    public static Task<GetUserResult> InvokeAsync(GetUserArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

MailNickname string
The email alias of the Azure AD User.
ObjectId string
Specifies the Object ID of the User within Azure Active Directory.
UserPrincipalName string
The User Principal Name of the Azure AD User.
MailNickname string
The email alias of the Azure AD User.
ObjectId string
Specifies the Object ID of the User within Azure Active Directory.
UserPrincipalName string
The User Principal Name of the Azure AD User.
mailNickname string
The email alias of the Azure AD User.
objectId string
Specifies the Object ID of the User within Azure Active Directory.
userPrincipalName string
The User Principal Name of the Azure AD User.
mail_nickname str
The email alias of the Azure AD User.
object_id str
Specifies the Object ID of the User within Azure Active Directory.
user_principal_name str
The User Principal Name of the Azure AD User.

getUser Result

The following output properties are available:

AccountEnabled bool
True if the account is enabled; otherwise False.
City string
The city in which the user is located.
CompanyName string
The company name which the user is associated. This property can be useful for describing the company that an external user comes from.
Country string
The country/region in which the user is located; for example, “US” or “UK”.
Department string
The name for the department in which the user works.
DisplayName string
The Display Name of the Azure AD User.
GivenName string
The given name (first name) of the user.
Id string
The provider-assigned unique ID for this managed resource.
ImmutableId string
The value used to associate an on-premise Active Directory user account with their Azure AD user object.
JobTitle string
The user’s job title.
Mail string
The primary email address of the Azure AD User.
MailNickname string
The email alias of the Azure AD User.
Mobile string
The primary cellular telephone number for the user.
ObjectId string
OnpremisesSamAccountName string
The on-premise SAM account name of the Azure AD User.
OnpremisesUserPrincipalName string
The on-premise user principal name of the Azure AD User.
PhysicalDeliveryOfficeName string
The office location in the user’s place of business.
PostalCode string
The postal code for the user’s postal address. The postal code is specific to the user’s country/region. In the United States of America, this attribute contains the ZIP code.
State string
The state or province in the user’s address.
StreetAddress string
The street address of the user’s place of business.
Surname string
The user’s surname (family name or last name).
UsageLocation string
The usage location of the Azure AD User.
UserPrincipalName string
The User Principal Name of the Azure AD User.
AccountEnabled bool
True if the account is enabled; otherwise False.
City string
The city in which the user is located.
CompanyName string
The company name which the user is associated. This property can be useful for describing the company that an external user comes from.
Country string
The country/region in which the user is located; for example, “US” or “UK”.
Department string
The name for the department in which the user works.
DisplayName string
The Display Name of the Azure AD User.
GivenName string
The given name (first name) of the user.
Id string
The provider-assigned unique ID for this managed resource.
ImmutableId string
The value used to associate an on-premise Active Directory user account with their Azure AD user object.
JobTitle string
The user’s job title.
Mail string
The primary email address of the Azure AD User.
MailNickname string
The email alias of the Azure AD User.
Mobile string
The primary cellular telephone number for the user.
ObjectId string
OnpremisesSamAccountName string
The on-premise SAM account name of the Azure AD User.
OnpremisesUserPrincipalName string
The on-premise user principal name of the Azure AD User.
PhysicalDeliveryOfficeName string
The office location in the user’s place of business.
PostalCode string
The postal code for the user’s postal address. The postal code is specific to the user’s country/region. In the United States of America, this attribute contains the ZIP code.
State string
The state or province in the user’s address.
StreetAddress string
The street address of the user’s place of business.
Surname string
The user’s surname (family name or last name).
UsageLocation string
The usage location of the Azure AD User.
UserPrincipalName string
The User Principal Name of the Azure AD User.
accountEnabled boolean
True if the account is enabled; otherwise False.
city string
The city in which the user is located.
companyName string
The company name which the user is associated. This property can be useful for describing the company that an external user comes from.
country string
The country/region in which the user is located; for example, “US” or “UK”.
department string
The name for the department in which the user works.
displayName string
The Display Name of the Azure AD User.
givenName string
The given name (first name) of the user.
id string
The provider-assigned unique ID for this managed resource.
immutableId string
The value used to associate an on-premise Active Directory user account with their Azure AD user object.
jobTitle string
The user’s job title.
mail string
The primary email address of the Azure AD User.
mailNickname string
The email alias of the Azure AD User.
mobile string
The primary cellular telephone number for the user.
objectId string
onpremisesSamAccountName string
The on-premise SAM account name of the Azure AD User.
onpremisesUserPrincipalName string
The on-premise user principal name of the Azure AD User.
physicalDeliveryOfficeName string
The office location in the user’s place of business.
postalCode string
The postal code for the user’s postal address. The postal code is specific to the user’s country/region. In the United States of America, this attribute contains the ZIP code.
state string
The state or province in the user’s address.
streetAddress string
The street address of the user’s place of business.
surname string
The user’s surname (family name or last name).
usageLocation string
The usage location of the Azure AD User.
userPrincipalName string
The User Principal Name of the Azure AD User.
account_enabled bool
True if the account is enabled; otherwise False.
city str
The city in which the user is located.
company_name str
The company name which the user is associated. This property can be useful for describing the company that an external user comes from.
country str
The country/region in which the user is located; for example, “US” or “UK”.
department str
The name for the department in which the user works.
display_name str
The Display Name of the Azure AD User.
given_name str
The given name (first name) of the user.
id str
The provider-assigned unique ID for this managed resource.
immutable_id str
The value used to associate an on-premise Active Directory user account with their Azure AD user object.
job_title str
The user’s job title.
mail str
The primary email address of the Azure AD User.
mail_nickname str
The email alias of the Azure AD User.
mobile str
The primary cellular telephone number for the user.
object_id str
onpremises_sam_account_name str
The on-premise SAM account name of the Azure AD User.
onpremises_user_principal_name str
The on-premise user principal name of the Azure AD User.
physical_delivery_office_name str
The office location in the user’s place of business.
postal_code str
The postal code for the user’s postal address. The postal code is specific to the user’s country/region. In the United States of America, this attribute contains the ZIP code.
state str
The state or province in the user’s address.
street_address str
The street address of the user’s place of business.
surname str
The user’s surname (family name or last name).
usage_location str
The usage location of the Azure AD User.
user_principal_name str
The User Principal Name of the Azure AD User.

Package Details

Repository
https://github.com/pulumi/pulumi-azuread
License
Apache-2.0
Notes
This Pulumi package is based on the azuread Terraform Provider.