Create Azure Active Directory joined catalogs
This article describes how to create Azure Active Directory (AD) joined catalogs using Citrix DaaS.
For information on requirements, limitations, and considerations, see Azure Active Directory joined.
Before you create the machine catalog, you need the following:
- New resource location
- Navigate to the Citrix Cloud admin UI > upper left hamburger menu > Resource Locations.
- Click + Resource Location.
- Enter a name for the new resource location and click Save.
- Create a hosting connection. See Create and manage connections section for details. When deploying machines on Azure, see Connection to Azure Resource Manager.
You can create Azure AD joined catalogs by using Studio or PowerShell.
Use Studio
The following information is a supplement to the guidance in Create machine catalogs. To create Azure AD joined catalogs, follow the general guidance in that article, minding the details specific to Azure AD joined catalogs.
In the catalog creation wizard:
- On the Image page:
- Select 2106 or later as the functional level.
- Select Use a machine profile and select the appropriate machine from the list.
-
On the Machine Identities page:
-
Select Azure Active Directory joined. The created machines are owned by an organization and are signed into with an Azure AD account that belongs to that organization. They exist only in the cloud.
Note:
- The Azure Active Directory joined identity type requires version 2106 or later as the minimum functional level for the catalog.
- The machines are joined to the Azure AD domain associated with the tenant to which the hosting connection is bound.
-
Click Select service account and select an available service account from the list. If a suitable service account is not available for the Azure AD tenant that the machine identities will join to, you can create a service account. For information on service account, see Azure AD service accounts.
Note:
The service account that you selected might be in an unhealthy status due to various reasons. You can go to Administrators > Service Accounts to view details and fix the issues according to the recommendations. Alternatively, you can proceed with the machine catalog operation and fix the issues later. If you do not fix the issue, stale Azure AD joined or Microsoft Intune enrolled devices are generated that can block Azure AD join of the machines.
-
- Users must be granted explicit access in Azure to log into the machines using their AAD credentials. See Azure Active Directory joined section for more details.
Modify the service account association
To change the associated service account or add an association to an existing MCS machine catalog, use the Edit Machine Catalog page.
- To add a service account, click Select service account on the Service Account page.
- To change the service account association, click the edit icon on the Service Account page.
Use PowerShell
The following are PowerShell steps equivalent to operations in Studio.
The difference between on-premises AD joined catalogs and Azure AD joined ones lies in the creation of the identity pool and the provisioning scheme.
You must associate an Azure AD service account with the identity pool, and then create the machine catalog. You can either create a new identity pool or update an existing identity pool to associate it with a service account.
For example: To create a new identity pool and associate it with a service account, run the following:
New-AcctIdentityPool -IdentityType AzureAD -IdentityPoolName MyPool -NamingScheme Acc#### -NamingSchemeType Numeric -ServiceAccountUid $serviceAccountUid
<!--NeedCopy-->
For example: To update an existing identity pool to associate it with a service account, run the following:
$identityPoolUid = (Get-ProvScheme -ProvisioningSchemeName "MyProvScheme").IdentityPoolUid
Set-AcctIdentityPool -IdentityPoolUid $identityPoolUid -ServiceAccountUid $serviceAccountUid
<!--NeedCopy-->
Note:
The
$serviceAccountUid
must be a valid UID of an on-premises service account.
To create a provisioning scheme for Azure AD joined catalogs, the MachineProfile parameter is required in New-ProvScheme:
New-ProvScheme -CustomProperties "<CustomProperties xmlns=`"http://schemas.citrix.com/2014/xd/machinecreation`" xmlns:xsi=`"http://www.w3.org/2001/XMLSchema-instance`"><Property xsi:type=`"StringProperty`" Name=`"UseManagedDisks`" Value=`"true`" /><Property xsi:type=`"StringProperty`" Name=`"StorageType`" Value=`"StandardSSD_LRS`" /><Property xsi:type=`"StringProperty`" Name=`"LicenseType`" Value=`"Windows_Server`" /></CustomProperties>" -HostingUnitName "AzureResource" -IdentityPoolName "AzureADJoinedCatalog" -InitialBatchSizeHint 1 -MachineProfile "XDHyp:\HostingUnits\AzureResource\image.folder\azuread-rg.resourcegroup\MasterVDA.vm" -MasterImageVM "XDHyp:\HostingUnits\AzureResource\image.folder\azuread-rg.resourcegroup\azuread-small_OsDisk_1_5fb42fadf7ff460bb301ee0d56ea30da.manageddisk" -NetworkMapping @{"0"="XDHyp:\HostingUnits\AzureResource\virtualprivatecloud.folder\East US.region\virtualprivatecloud.folder\azuread-rg.resourcegroup\azuread-vnet.virtualprivatecloud\Test_VNET.network"} -ProvisioningSchemeName "AzureADJoinedCatalog" -RunAsynchronously -Scope @() -SecurityGroup @() -ServiceOffering "XDHyp:\HostingUnits\AzureResource\serviceoffering.folder\Standard_DS1_v2.serviceoffering"
<!--NeedCopy-->
All other commands used to create Azure AD joined catalogs are the same as for traditional on-premises AD joined catalogs.
View the status of the Azure AD join process
In Studio, the status of the Azure AD join process is visible when Azure AD joined machines in a delivery group are in a powered-on state. To view the status, use Search to identify those machines and then for each check Machine Identity on the Details tab in the lower pane. The following information can appear in Machine Identity:
- Azure AD joined
- Not yet joined to Azure AD
Note:
If the machines fail to be in Azure AD joined state, they do not register with the Delivery Controller. Their registration status appears as Initialization.
Also, using Studio, you can learn why machines are unavailable. To do that, click a machine on the Search node, check Registration on the Details tab in the lower pane, and then read the tooltip for additional information.
Delivery Group
See Create delivery groups section for details.
Enable Rendezvous
Once the delivery group has been created, you can enable Rendezvous. See Rendezvous V2 for details.
Troubleshoot
If machines fail to be Azure AD joined, do the following:
-
Check if the system assigned managed identity is enabled for the machines. MCS-provisioned machines must have this enabled automatically. The Azure AD join process fails without system assigned managed identity. If the system assigned managed identity is not enabled for MCS-provisioned machines, possible reason is:
-
IdentityType
of the identity pool associated with the provisioning scheme is not set toAzureAD
. You can verify this by runningGet-AcctIdentityPool
.
-
-
For catalogs that use master images with VDA version 2206 or earlier, check the provisioning status of AADLoginForWindows extension for the machines. If the AADLoginForWindows extension does not exist, possible reasons are:
-
IdentityType
of the identity pool associated with the provisioning scheme is not set toAzureAD
. You can verify this by runningGet-AcctIdentityPool
. -
The AADLoginForWindows extension installation is blocked by Azure policy.
-
-
To troubleshoot AADLoginForWindows extension provisioning failures, you can check logs under
C:\WindowsAzure\Logs\Plugins\Microsoft.Azure.ActiveDirectory.AADLoginForWindows
on the MCS-provisioned machine.Note:
MCS does not rely on the
AADLoginForWindows
extension to join a VM to Azure AD when using a master image with VDA version 2209 or later. In this case, theAADLoginForWindows
extension will not be installed on the MCS-provisioned machine. Therefore,AADLoginForWindows
extension provisioning logs can’t be collected. -
Check the Azure AD join status and debug logs by running
dsregcmd /status
command on the MCS-provisioned machine. - Check Windows event logs under Application and Services Logs > Microsoft > Windows > User Device Registration.
-
Check if Azure AD device management is correctly configured by running
Get-Item -LiteralPath XDHyp:\Connections\${HostingConnectionName}
.Ensure that the value of:
-
AzureAdDeviceManagement
property inCustomProperties
is true -
Citrix_MCS_AzureAdDeviceManagement_PermissionGranted
property in metadata is true
If
Citrix_MCS_AzureAdDeviceManagement_PermissionGranted
is false, it indicates that theServicePrincipal
of the application used by the hosting connection is not granted with sufficient permissions to perform Azure AD device management. To resolve this, assign theServicePrincipal
with the Cloud Device Administrator role. -
Azure Active Directory dynamic security group
Dynamic group rules place the VMs in the catalog to a dynamic security group based on the naming scheme of the machine catalog.
If the naming scheme of the machine catalog is Test### (where, # means number), Citrix creates the dynamic membership rule ^Test[0-9]{3}$ in the dynamic security group. Now, if the name of the VM created by Citrix is anything from Test001 to Test999, then the VM is included in the dynamic security group.
Note:
If the name of the VM created by you manually is anything from Test001 to Test999, then also the VM is included in the dynamic security group. This is one of the limitations of the dynamic security group.
The dynamic security group feature is useful when you want to manage the VMs by Azure Active Directory (Azure AD). This is also useful when you want to apply Conditional Access policies or distribute apps from Intune by filtering the VMs with Azure AD dynamic security group.
You can use PowerShell commands to:
- Create a machine catalog with Azure AD dynamic security group
- Enable security group feature for an Azure AD catalog
- Delete a machine catalog with Azure AD joined device security group
Important:
- To create a machine catalog with Azure AD dynamic security group, add machines to the catalog, and delete the machine catalog, you must have Azure AD access token. For information on getting the Azure AD access token, see https://docs.microsoft.com/en-us/graph/graph-explorer/graph-explorer-features#consent-to-permissions/.
- To request an access token in Azure AD, Citrix requests the Group.ReadWrite.All permission for Microsoft Graph API. An Azure AD user who has tenant-wide admin consent permission can grant Group.ReadWrite.All permission for Microsoft Graph API. For information on how to grant tenant-wide admin consent to an application in Azure Active Directory (Azure AD), see the Microsoft document https://docs.microsoft.com/en-us/azure/active-directory/manage-apps/grant-admin-consent/.
Create a machine catalog with Azure AD dynamic security group
- In the machine catalog setup user interface of the web-based console, on the Machine Identities page, select Azure Active Directory joined.
- Log in to Azure AD.
- Get the access token to MS Graph API. Use this access token as a value of
$AzureADAccessToken
parameter when you run the PowerShell commands. -
Run the following command to verify if the dynamic security group name exists in the tenant.
Get-AcctAzureADSecurityGroup –AccessToken $AzureADAccessToken –Name "SecurityGroupName" <!--NeedCopy-->
-
Create a machine catalog using the Tenant ID, access token, and dynamic security group. Run the following command to create an IdentityPool with
IdentityType=AzureAD
and create a dynamic security group in Azure.New-AcctIdentityPool -AllowUnicode -IdentityPoolName "SecurityGroupCatalog" -NamingScheme "SG-VM-###" -NamingSchemeType "Numeric" -Scope @() -ZoneUid "81291221-d2f2-49d2-ab12-bae5bbd0df05" -WorkgroupMachine -IdentityType "AzureAD" -DeviceManagementType "None" -AzureADTenantId 620387bb-9167-4bdd-8435-e3dccc58369e -AzureADSecurityGroupName "SecurityGroupName" -AzureADAccessToken $AzureADAccessToken <!--NeedCopy-->
Enable security group feature for an Azure AD catalog
You can enable the dynamic security feature for an Azure AD catalog that was created without the dynamic security group feature enabled. To do this:
- Manually create a new dynamic security group. You can also reuse an existing dynamic security group.
-
Log in to Azure AD, and get the access token to MS Graph API. Use this access token as a value of
$AzureADAccessToken
parameter when you run the PowerShell commands.Note:
For information on the permissions required by the Azure AD user, see https://docs.microsoft.com/en-us/azure/active-directory/manage-apps/grant-admin-consent#prerequisites/.
-
Run the following command to connect the identity pool to the created Azure AD dynamic security group.
Set-AcctIdentityPool -IdentityPoolName "SecurityGroupCatalog" -AzureADTenantId 620387bb-9167-4bdd-8435-e3dccc58369e -AzureADSecurityGroupNam "ExistingSecurityGroupName" -AzureADAccessToken $AzureADAccessToken <!--NeedCopy-->
If you update the naming scheme, Citrix updates the naming scheme to a new membership rule. If you delete the catalog, membership rule gets deleted, and not the security group.
Delete a machine catalog with Azure AD joined device security group
When you delete a machine catalog, the Azure AD joined device security group is also deleted.
To delete the Azure AD dynamic security group, do the following:
- Log in to Azure AD.
- Get the access token to MS Graph API. Use this access token as value of
$AzureADAccessToken
parameter when you run the PowerShell commands. -
Run the following command:
Remove-AcctIdentityPool -IdentityPoolName "SecurityGroupCatalog" -AzureADAccessToken $AzureADAccessToken <!--NeedCopy-->
Create an Azure AD dynamic security group under an existing Azure AD assigned security group
You can create an Azure AD dynamic security group under an existing Azure AD assigned security group. You can do the following:
- Get security group information.
- Get all Azure AD assigned security groups that are synced from on-premises AD server or the assigned security groups to which Azure AD roles can be assigned.
- Get all Azure AD dynamic security groups.
- Add Azure AD dynamic security group as a member of Azure AD assigned group.
- Remove the membership between Azure AD dynamic security group and Azure AD assigned security group when Azure AD dynamic security group is deleted along with the machine catalog.
You can also see explicit error messages when any of the operations fail.
Requirement:
You must have the access token to the MS Graph API when you run the PowerShell commands.
To get the access token:
- Open Microsoft graph explorer and log in to Azure AD.
- Make sure you have consent to Group.ReadWrite.All and GroupMember.ReadWrite.All permissions.
- Get access token from Microsoft graph explorer. Use this access token when you run the PowerShell commands.
To get security group information by group id:
- Get the access token.
- Find group object id from Azure portal.
-
Run the following PowerShell command in the PowerShell console:
Get-AcctAzureADSecurityGroup -AccessToken <token> -GroupId <GroupUid> <!--NeedCopy-->
To get security groups by group display name:
- Get the access token.
-
Run the following PowerShell command in the PowerShell console:
Get-AcctAzureADSecurityGroup -AccessToken <token> -Name <TargetGroupDisplayName> <!--NeedCopy-->
To get security groups whose display name contains a substring:
- Get the access token.
-
Run the following PowerShell command in the PowerShell console:
Get-AcctAzureADSecurityGroup -AccessToken <token> -SearchString <displayNameSubString> <!--NeedCopy-->
To get all Azure AD assigned security groups that are synced from on-premises AD server or the assigned security groups to which Azure AD roles can be assigned:
- Get the access token.
-
Run the following PowerShell command in the PowerShell console:
Get-AcctAzureADSecurityGroup -AccessToken <token> -Assigned true <!--NeedCopy-->
To get all Azure AD dynamic security groups:
- Get the access token.
-
Run the following PowerShell command in the PowerShell console:
Get-AcctAzureADSecurityGroup -AccessToken <token> -Dynamic true <!--NeedCopy-->
To get Azure AD assigned security groups with maximum record count:
- Get the access token.
-
Run the following PowerShell command in the PowerShell console:
Get-AcctAzureADSecurityGroup -AccessToken <token> -Assigned true -MaxRecordCount 10 <!--NeedCopy-->
To add Azure AD dynamic security group as a member of Azure AD assigned security group:
- Get the access token.
-
Run the following PowerShell command in the PowerShell console:
Add-AcctAzureADSecurityGroupMember -AccessToken <token> -GroupId <ASG-Id> -RefGroupId <DSG-Id> <!--NeedCopy-->
To get Azure AD assigned security group members:
- Get the access token.
-
Run the following PowerShell command in the PowerShell console:
Get-AcctAzureADSecurityGroupMember -AccessToken <token> -GroupId <ASG-Id> <!--NeedCopy-->
Note:
Get-AcctAzureADSecurityGroupMember
provides you only the direct members of the security group type under Azure AD assigned security group.
To remove the membership between Azure AD dynamic security group and Azure AD assigned security group when Azure AD dynamic security group is deleted along with machine catalog:
- Get the access token.
-
Run the following PowerShell command in the PowerShell console:
Remove-AcctIdentityPool -IdentityPoolName "SecurityGroupCatalog" -AzureADAccessToken $AzureADAccessToken <!--NeedCopy-->
Modify Azure AD dynamic security group name
You can modify the Azure AD dynamic security group name associated with a machine catalog. This modification makes the security group information stored in Azure AD identity pool object to be consistent with the information stored in Azure portal.
Note:
The Azure AD dynamic security groups do not include security groups synced from on-premises AD and other group types like Office 365 group.
You can modify the Azure AD dynamic security group name using Studio and PowerShell commands.
To modify the Azure AD dynamic security group name using PowerShell:
- Open the PowerShell window.
- Run
asnp citrix*
to load the Citrix-specific PowerShell modules. - Run the command
Set-AcctIdentityPool -AzureAdSeurityGroupName [DSG-Name]
.
You get appropriate error messages if the Azure AD dynamic security group name cannot be modified.
More information
In this article
- Use Studio
- Use PowerShell
- View the status of the Azure AD join process
- Delivery Group
- Enable Rendezvous
- Troubleshoot
- Azure Active Directory dynamic security group
- Create an Azure AD dynamic security group under an existing Azure AD assigned security group
- Modify Azure AD dynamic security group name
- More information