How to play the logon or startup sound in Windows 8.1 or Windows 8

Every release of Windows since as far back as I can remember (Windows 3.1) has played a welcome sound at startup. In Windows NT-based systems, there is a startup sound as well as separate logon sound. A sound can also play when Windows logs off or when it shuts down. You can assign all these sounds from Control Panel -> Sound. But in Windows 8, sounds for these events have been eliminated almost entirely. Let's see how to revive them.