Posts

Showing posts from August, 2024

Creating Snapshot with Disk Access and Exporting to Azure Blob Storage

Image
 1. Context: 1. The disk is in place for which the snapshot is to be taken. 2. The subnet for the snapshot and the storage account's private endpoint is already in place.      3. Since we are attaching the Disk Access resource (Private Endpoint) to the snapshot, it prevents the import and export of the disk to other virtual networks. Therefore, to import or export a snapshot to a storage account, both the snapshot and the storage account must have a private endpoint and be within the same virtual network. 4. The VM running the PowerShell script is in the same virtual network as the snapshot and the storage account. This ensures that the storage account can resolve to the private IP address. 5. The Az modules are installed on the PowerShell. 2. Considerations: 1. If you plan to export your snapshot to an Azure Blob Storage account, the snapshot type must be Full and not Incremental. This is because Incremental snapshots in Azure contain only the changes made since the last snapshot,

Optimize Your FSLogix Environment: PowerShell Script for Deleting Inactive Profiles

Image
1. Context: 1. There are 2 user profiles: user 1 and user 2.  2. User 1 has recently logged in or is currently logged in. According to the script, User 1's VHDX file should be excluded. 3. User 2 has not logged in for the last 2 days. According to the script, the VHDX file and the associated directory should be deleted. 2. Prerequisites: 1. Ensure that the user ID you are using to run the script has access to the storage account. In this demo, the user ID admin@cloudazure.co.in is being used and has the following access: 2. The storage path must be accessible from the virtual machine (VM) where the script is being executed. 3. Modifications to be applied to the script: $Date = (Get-Date).AddDays(-1)  Change 1 to 30 days or any number of days based on your requirement. $VHDs = Get-ChildItem -Recurse -Path "\\strdem07.file.core.windows.net\fileshare" | Where-Object { $_.Name -like "*.vhdx" }  Change the path to your required path 4. Script: # Import ActiveDirector

Single Sign On (SSO) for Azure Virtual Desktop using Microsoft Entra ID

Image
1. Prerequisites:  1. Before installing the Microsoft Entra ID Connect tool, ensure that the member server is domain joined. 2. The virtual network of the member server should be peered with the virtual network of the domain controller, and the DNS server settings should point to the IP addresses of the domain controller or else during the domain join you may come across the below error: 3. Before downloading and installing the Entra ID Connect tool, ensure that the domain-joined member server has TLS 1.2 enabled. Otherwise, you may encounter the following error when running the tool: 4. Entra ID connect version should be 1.1.819.0 or later. 5.  Before running the Entra ID tool, make sure you have two user IDs ready: one with Enterprise Admin access in Active Directory and the other with either the Hybrid Identity Administrator or Global Administrator role in Azure. 6. For SSO to work, the Session Hosts must be running  Windows 10/11 Enterprise single or multi-session with the latest u