Running a broker server that load balances to 4 session hosts. The UPD’s are named based on the AD attribute objectSid e.g “UVHD-S-1-5-21-3199994005-3499998621-1869999552-9999.vhdx”. It is configured so that if a user is inactive for an hour it will log their session off. We’re running into an issue where sometimes UPD’s wont detach from the host, so the next time the user logs in they’re given a temp profile.
My question is, is it possible, to pull a list of disks(get-disk) attached and somehow match them to a list of users on the server(query user /server:$SERVER). If the disk is attached but does not have a matching user logged in, then detached the disk?
I can’t seem to find any way to link get-disk to any identifiable. I have done get-disk | gm to see what properties are available.
Guid, ObjectId, UniqueID and path all return results that can’t be linked to AD. Any input would be appreciated.