Windows Performance Toolkit, part of Windows 10 SDK (Build 15086, last version that works on Windows 7).
WPRUI.exe, select First Level, under Resource select CPU usage, DiskIO, FileIO and under Performance Scenario select Shutdown. Number of iteration can be set to 1
and click to
After reboot, open the ETL with WPA.exe. In WPA.exe, click on Profiles->Apply->"Browse Catalog" and select
Now you see this overview how long shutdown takes:
In this sample it takes 8s to shutdown. 2s are needed to close the user session (were 1.2s were spend to kill onedrive.exe) and shutting down the windows kernel/services takes 5s.
Look at your data to see where Windows spends most of the time. If you see disk activity during shutdown, analyze the ETL for DiskIO and FileIO.