How to fetch username or userEmail from userprofile details of FSLogix
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
HiI 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!ThanksHirdesh Read More