Showing posts with label User Profile Disk. Show all posts
Showing posts with label User Profile Disk. Show all posts

Friday, 30 July 2021

Compacting user profile disks (UPD) on a RDS Broker / host setup

 UPD by default can grow up to 20GB,  this will happen automatically over time as the users add more data and generates more trash data.

This will never clean down though and can lead to the system looking larger then it actually is.

This is a good script to run to clean down the white space within the UPD


#FILE
$VHDXPaths = @(
    '\\SERVER\FSLogix',
    '\\SERVER\ProfileDisks'
)

$VHDXExclusions = @(
    'UVHD-template.vhdx'
)

Foreach ($Path in $VHDXPaths){
    $AllUPDs = Get-ChildItem $Path -Recurse -Filter *.vhdx | Where-Object {$VHDXExclusions -NotContains $_.name} | Select-Object -ExpandProperty fullname

    foreach ($UPD in $AllUPDs){
        NEW-ITEM -Name compact.txt -ItemType file -force | OUT-NULL
        ADD-CONTENT -Path compact.txt "select vdisk file= $UPD"
        ADD-CONTENT -Path compact.txt "compact vdisk"
        DISKPART /S compact.TXT
    }
}

#EOF


PowerShell/Compact-UPDs.ps1 at master · andy2002a/PowerShell · GitHub

Friday, 5 March 2021

Windows Remote Desktop host seeing alot of .BACKUP-## folders in C:\Users

 Not 100% show on why this happens but it appears to be related to User Profile disks and users not logging off correctly and some issues with he UPD storage.

First step would be to put limits in place on the sessions times so that users get logged out even then they forget too.  Staff training also would be a bonus on how to do it correctly.

Once you have that set you are still going to see a few and they are going to need to be cleaned down.  a good script I have found is located here

PowerShell/Remove-LocalUPDProfiles.ps1 at master · andy2002a/PowerShell · GitHub

And it uses the Delprof2 application from here

Download Delprof2, SetACL (Studio) • Helge Klein

This cleans down the profiles and check if the user is in the system before it does.  I normally run it at night using a schedule.

Also if you are storing your UPD on a share I would recommend disabling share caching on the share its self.  This can have a performance impact but its more stable when logging off.

Wednesday, 2 December 2020

Windows server 2019 Remote Desktop Host with Search installed

 The way Windows 2019 / Windows 10 works with search has changed.  the short of it is that now parts are stored in the user profile which can have issues with User Profile Disks.

If you are seeing the follow event in the event log

Event Log: Application

Event Level: Error

Event Source: Search-ProfileNotify

Event ID: 2

Event Data: Unable to remove Windows Search Service indexed data for user '<User Name>’ in response to user profile deletion.  Error code 0x80004002

This can be the start of issues with Search for all users.  The fix is to make a task that triggers on this event to restart the search service.

Program: powershell.exe
Arguments: restart-service WSearch

This was taken from jkindon.com site so that I have it at hand if it comes back up again, but they go in to more details of the thing.

Windows Search in Server 2019 and Multi-Session Windows 10 – James Kindon (jkindon.com)