1. Packages
  2. Azure Active Directory (Azure AD)
  3. API Docs
  4. getAdministrativeUnit
Azure Active Directory (Azure AD) v5.47.1 published on Friday, Feb 9, 2024 by Pulumi

azuread.getAdministrativeUnit

Explore with Pulumi AI

azuread logo
Azure Active Directory (Azure AD) v5.47.1 published on Friday, Feb 9, 2024 by Pulumi

    Gets information about an adminisrative unit in Azure Active Directory.

    API Permissions

    The following API permissions are required in order to use this data source.

    When authenticated with a service principal, this data source requires one of the following application roles: AdministrativeUnit.Read.All or Directory.Read.All

    When authenticated with a user principal, this data source does not require any additional roles.

    Example Usage

    By Group Display Name)

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureAD = Pulumi.AzureAD;
    
    return await Deployment.RunAsync(() => 
    {
        var example = AzureAD.GetAdministrativeUnit.Invoke(new()
        {
            DisplayName = "Example-AU",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azuread/sdk/v5/go/azuread"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := azuread.LookupAdministrativeUnit(ctx, &azuread.LookupAdministrativeUnitArgs{
    			DisplayName: pulumi.StringRef("Example-AU"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azuread.AzureadFunctions;
    import com.pulumi.azuread.inputs.GetAdministrativeUnitArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var example = AzureadFunctions.getAdministrativeUnit(GetAdministrativeUnitArgs.builder()
                .displayName("Example-AU")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azuread as azuread
    
    example = azuread.get_administrative_unit(display_name="Example-AU")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azuread from "@pulumi/azuread";
    
    const example = azuread.getAdministrativeUnit({
        displayName: "Example-AU",
    });
    
    variables:
      example:
        fn::invoke:
          Function: azuread:getAdministrativeUnit
          Arguments:
            displayName: Example-AU
    

    Look up by object ID

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureAD = Pulumi.AzureAD;
    
    return await Deployment.RunAsync(() => 
    {
        var example = AzureAD.GetAdministrativeUnit.Invoke(new()
        {
            ObjectId = "00000000-0000-0000-0000-000000000000",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azuread/sdk/v5/go/azuread"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := azuread.LookupAdministrativeUnit(ctx, &azuread.LookupAdministrativeUnitArgs{
    			ObjectId: pulumi.StringRef("00000000-0000-0000-0000-000000000000"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azuread.AzureadFunctions;
    import com.pulumi.azuread.inputs.GetAdministrativeUnitArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var example = AzureadFunctions.getAdministrativeUnit(GetAdministrativeUnitArgs.builder()
                .objectId("00000000-0000-0000-0000-000000000000")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azuread as azuread
    
    example = azuread.get_administrative_unit(object_id="00000000-0000-0000-0000-000000000000")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azuread from "@pulumi/azuread";
    
    const example = azuread.getAdministrativeUnit({
        objectId: "00000000-0000-0000-0000-000000000000",
    });
    
    variables:
      example:
        fn::invoke:
          Function: azuread:getAdministrativeUnit
          Arguments:
            objectId: 00000000-0000-0000-0000-000000000000
    

    Using getAdministrativeUnit

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getAdministrativeUnit(args: GetAdministrativeUnitArgs, opts?: InvokeOptions): Promise<GetAdministrativeUnitResult>
    function getAdministrativeUnitOutput(args: GetAdministrativeUnitOutputArgs, opts?: InvokeOptions): Output<GetAdministrativeUnitResult>
    def get_administrative_unit(display_name: Optional[str] = None,
                                object_id: Optional[str] = None,
                                opts: Optional[InvokeOptions] = None) -> GetAdministrativeUnitResult
    def get_administrative_unit_output(display_name: Optional[pulumi.Input[str]] = None,
                                object_id: Optional[pulumi.Input[str]] = None,
                                opts: Optional[InvokeOptions] = None) -> Output[GetAdministrativeUnitResult]
    func LookupAdministrativeUnit(ctx *Context, args *LookupAdministrativeUnitArgs, opts ...InvokeOption) (*LookupAdministrativeUnitResult, error)
    func LookupAdministrativeUnitOutput(ctx *Context, args *LookupAdministrativeUnitOutputArgs, opts ...InvokeOption) LookupAdministrativeUnitResultOutput

    > Note: This function is named LookupAdministrativeUnit in the Go SDK.

    public static class GetAdministrativeUnit 
    {
        public static Task<GetAdministrativeUnitResult> InvokeAsync(GetAdministrativeUnitArgs args, InvokeOptions? opts = null)
        public static Output<GetAdministrativeUnitResult> Invoke(GetAdministrativeUnitInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAdministrativeUnitResult> getAdministrativeUnit(GetAdministrativeUnitArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: azuread:index/getAdministrativeUnit:getAdministrativeUnit
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DisplayName string
    Specifies the display name of the administrative unit.
    ObjectId string

    Specifies the object ID of the administrative unit.

    One of display_name or object_id must be specified.

    DisplayName string
    Specifies the display name of the administrative unit.
    ObjectId string

    Specifies the object ID of the administrative unit.

    One of display_name or object_id must be specified.

    displayName String
    Specifies the display name of the administrative unit.
    objectId String

    Specifies the object ID of the administrative unit.

    One of display_name or object_id must be specified.

    displayName string
    Specifies the display name of the administrative unit.
    objectId string

    Specifies the object ID of the administrative unit.

    One of display_name or object_id must be specified.

    display_name str
    Specifies the display name of the administrative unit.
    object_id str

    Specifies the object ID of the administrative unit.

    One of display_name or object_id must be specified.

    displayName String
    Specifies the display name of the administrative unit.
    objectId String

    Specifies the object ID of the administrative unit.

    One of display_name or object_id must be specified.

    getAdministrativeUnit Result

    The following output properties are available:

    Description string
    The description of the administrative unit.
    DisplayName string
    The display name of the administrative unit.
    Id string
    The provider-assigned unique ID for this managed resource.
    Members List<string>
    A list of object IDs of members who are present in this administrative unit.
    ObjectId string
    The object ID of the administrative unit.
    Visibility string
    Whether the administrative unit and its members are hidden or publicly viewable in the directory. One of: Hiddenmembership or Public.
    Description string
    The description of the administrative unit.
    DisplayName string
    The display name of the administrative unit.
    Id string
    The provider-assigned unique ID for this managed resource.
    Members []string
    A list of object IDs of members who are present in this administrative unit.
    ObjectId string
    The object ID of the administrative unit.
    Visibility string
    Whether the administrative unit and its members are hidden or publicly viewable in the directory. One of: Hiddenmembership or Public.
    description String
    The description of the administrative unit.
    displayName String
    The display name of the administrative unit.
    id String
    The provider-assigned unique ID for this managed resource.
    members List<String>
    A list of object IDs of members who are present in this administrative unit.
    objectId String
    The object ID of the administrative unit.
    visibility String
    Whether the administrative unit and its members are hidden or publicly viewable in the directory. One of: Hiddenmembership or Public.
    description string
    The description of the administrative unit.
    displayName string
    The display name of the administrative unit.
    id string
    The provider-assigned unique ID for this managed resource.
    members string[]
    A list of object IDs of members who are present in this administrative unit.
    objectId string
    The object ID of the administrative unit.
    visibility string
    Whether the administrative unit and its members are hidden or publicly viewable in the directory. One of: Hiddenmembership or Public.
    description str
    The description of the administrative unit.
    display_name str
    The display name of the administrative unit.
    id str
    The provider-assigned unique ID for this managed resource.
    members Sequence[str]
    A list of object IDs of members who are present in this administrative unit.
    object_id str
    The object ID of the administrative unit.
    visibility str
    Whether the administrative unit and its members are hidden or publicly viewable in the directory. One of: Hiddenmembership or Public.
    description String
    The description of the administrative unit.
    displayName String
    The display name of the administrative unit.
    id String
    The provider-assigned unique ID for this managed resource.
    members List<String>
    A list of object IDs of members who are present in this administrative unit.
    objectId String
    The object ID of the administrative unit.
    visibility String
    Whether the administrative unit and its members are hidden or publicly viewable in the directory. One of: Hiddenmembership or Public.

    Package Details

    Repository
    Azure Active Directory (Azure AD) pulumi/pulumi-azuread
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azuread Terraform Provider.
    azuread logo
    Azure Active Directory (Azure AD) v5.47.1 published on Friday, Feb 9, 2024 by Pulumi