Users - List By Lab

Get all users for a lab.
Returns a list of all users for a lab.

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/users?api-version=2023-06-07
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/users?api-version=2023-06-07&$filter={$filter}

URI Parameters

Name In Required Type Description
labName
path True

string

The name of the lab that uniquely identifies it within containing lab plan. Used in resource URIs.

resourceGroupName
path True

string

The name of the resource group. The name is case insensitive.

subscriptionId
path True

string

The ID of the target subscription.

api-version
query True

string

The API version to use for this operation.

$filter
query

string

The filter to apply to the operation.

Responses

Name Type Description
200 OK

PagedUsers

The request was successful; response contains all users for the given lab.

Other Status Codes

ErrorResponse

The default error response.

Examples

listUser

Sample Request

GET https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.LabServices/labs/testlab/users?api-version=2023-06-07

Sample Response

{
  "nextLink": null,
  "value": [
    {
      "id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.LabServices/labs/testlab/users/testuser",
      "name": "default",
      "type": "Microsoft.LabServices/User",
      "systemData": {
        "createdBy": "identity123",
        "createdByType": "User",
        "createdAt": "2020-05-01T10:00:00Z",
        "lastModifiedBy": "identity123",
        "lastModifiedByType": "User",
        "lastModifiedAt": "2020-06-01T09:12:28Z"
      },
      "properties": {
        "provisioningState": "Succeeded",
        "displayName": "Test User",
        "email": "testuser@contoso.com",
        "registrationState": "Registered",
        "invitationState": "Sent",
        "totalUsage": "PT10H",
        "additionalUsageQuota": "PT10H"
      }
    }
  ]
}

Definitions

Name Description
createdByType

The type of identity that created the resource.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

InvitationState

The lab user invitation state.

PagedUsers

Paged list of users.

ProvisioningState

Current provisioning state of the user resource.

RegistrationState

The user lab registration state.

ResourceOperationError

Error details of the latest operation failure on this resource

systemData

Metadata pertaining to creation and last modification of the resource.

User

User of a lab that can register for and use virtual machines within the lab.

createdByType

The type of identity that created the resource.

Name Type Description
Application

string

Key

string

ManagedIdentity

string

User

string

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

InvitationState

The lab user invitation state.

Name Type Description
Failed

string

There was an error while sending the invitation.

NotSent

string

The invitation has not been sent.

Sending

string

Currently sending the invitation.

Sent

string

The invitation has been successfully sent.

PagedUsers

Paged list of users.

Name Type Description
nextLink

string

The link to get the next page of image results.

value

User[]

The array page of user results.

ProvisioningState

Current provisioning state of the user resource.

Name Type Description
Creating

string

Resource is in the process of being created.

Deleting

string

Resource is in the process of being deleted.

Failed

string

Previous operation on the resource has failed leaving resource in unhealthy state.

Locked

string

The resource is locked and changes are currently blocked. This could be due to maintenance or a scheduled operation. The state will go back to succeeded once the locking operation has finished.

Succeeded

string

Resource is in healthy state after creation or update operation.

Updating

string

New property values are being applied to the resource.

RegistrationState

The user lab registration state.

Name Type Description
NotRegistered

string

User has registered with the lab.

Registered

string

User has not yet registered with the lab.

ResourceOperationError

Error details of the latest operation failure on this resource

Name Type Description
action

string

The operation action that failed

code

string

The code that corresponds to the type of operation failure

message

string

The operation failure message

timestamp

string

The datetime of when the error occured

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.

User

User of a lab that can register for and use virtual machines within the lab.

Name Type Description
id

string

Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

The name of the resource

properties.additionalUsageQuota

string

The amount of usage quota time the user gets in addition to the lab usage quota.

properties.displayName

string

Display name of the user, for example user's full name.

properties.email

string

Email address of the user.

properties.invitationSent

string

Date and time when the invitation message was sent to the user.

properties.invitationState

InvitationState

State of the invitation message for the user.

properties.provisioningState

ProvisioningState

Current provisioning state of the user resource.

properties.registrationState

RegistrationState

State of the user's registration within the lab.

properties.resourceOperationError

ResourceOperationError

Error details of last operation done on lab plan.

properties.totalUsage

string

How long the user has used their virtual machines in this lab.

systemData

systemData

Metadata pertaining to creation and last modification of the user resource.

type

string

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"