AzureGraph (version 1.0.1)

az_user: User in Azure Active Directory

Description

Base class representing an AAD user account.

Usage

az_user

Arguments

Format

An R6 object of class az_user, inheriting from az_object.

Fields

  • token: The token used to authenticate with the Graph host.

  • tenant: The Azure Active Directory tenant for this user.

  • type: always "user" for a user object.

  • properties: The user properties.

Methods

  • new(...): Initialize a new user object. Do not call this directly; see 'Initialization' below.

  • delete(confirm=TRUE): Delete a user account. By default, ask for confirmation first.

  • update(...): Update the user information in Azure Active Directory.

  • do_operation(...): Carry out an arbitrary operation on the user account.

  • sync_fields(): Synchronise the R object with the app data in Azure Active Directory.

  • list_group_memberships(): Return the IDs of all groups this user is a member of.

  • list_object_memberships(): Return the IDs of all groups, administrative units and directory roles this user is a member of.

  • list_direct_memberships(id_only=TRUE): List the groups this user is a direct member of. Set id_only=TRUE to return only a vector of group IDs (the default), or id_only=FALSE to return a list of group objects.

  • list_owned_objects(type=c("user", "group", "application", "servicePrincipal")): List directory objects (groups/apps/service principals) owned by this user. Specify the type argument to filter the result for specific object type(s).

  • list_created_objects(type=c("user", "group", "application", "servicePrincipal")): List directory objects (groups/apps/service principals) created by this user. Specify the type argument to filter the result for specific object type(s).

  • list_owned_devices(): List the devices owned by this user.

  • list_registered_devices(): List the devices registered by this user.

  • `reset_password(password=NULL, force_password_change=TRUE): Resets a user password. By default the new password will be randomly generated, and must be changed at next login.

Initialization

Creating new objects of this class should be done via the create_user and get_user methods of the ms_graph and az_app classes. Calling the new() method for this class only constructs the R object; it does not call the Microsoft Graph API to create the actual user account.

See Also

ms_graph, az_app, az_group, az_device, az_object

Microsoft Graph overview, REST API reference

Examples

Run this code
# NOT RUN {
gr <- get_graph_login()

# my user account
gr$get_user()

# another user account
usr <- gr$get_user("myname@aadtenant.com")

grps <- usr$list_direct_memberships()
head(grps)

# owned objects
usr$list_owned_objects()

# owned apps and service principals
usr$list_owned_objects(type=c("application", "servicePrincipal"))

# }

Run the code above in your browser using DataLab