How to fetch username or userEmail from userprofile details of FSLogix

Hirdesh Baghel 20 Reputation points
2024-10-03T04:04:32.4766667+00:00

Hi

I am trying to fetch several details from FSLogix userprofile like disk size usage , last accessed date. I need to get user details as well like Username or UserEmail.

Below is the PS Snippet that I am using.

 $Profiles = Get-ChildItem -Recurse -Path $FileSharePath -Filter "*.VHDX" -ErrorAction Stop |
    ForEach-Object {
        [PSCustomObject]@{
            UserGPN           = ($_.Name -split '_')[1].Split('.')[0]
            FileShareName     = ($_.FullName -split '\\')[3]
            FileName          = $_.Name
            TotalSizeInGB     = $DriveSizeGB
            ConsumedSizeInGB  = [math]::Round($_.Length / 1GB, 2)
            FilePath          = $_.FullName 
            CreationTimeUtc   = $_.CreationTimeUtc.ToString()
            LastAccessTimeUtc = $_.LastAccessTimeUtc.ToString()
            LastWriteTimeUtc  = $_.LastWriteTimeUtc.ToString()
        }
    }

How can I get that ? Kindly help!

Thanks

Hirdesh

Azure Virtual Desktop
Azure Virtual Desktop
A Microsoft desktop and app virtualization service that runs on Azure. Previously known as Windows Virtual Desktop.
1,536 questions
FSLogix
FSLogix
A set of solutions that enhance, enable, and simplify non-persistent Windows computing environments and may also be used to create more portable computing sessions when using physical devices.
492 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.