On a Windows PC joined to a 'traditional' Active Directory domain, querying Win32_ComputerSystem
or Win32_NTDomain
returns the domain name.
It seems that if it's Azure anything [joined], those classes return nothing.
Our software won't run unless it is domain joined (and to a specific domain) to prevent rogue users from accessing data.
How can one determine if a laptop is actually a corporate laptop and not a rogue home user if an Azure AD [joined/registered] computer doesn't store that information in CIM? Surely it does, but I have not found anything useful beyond this, which isn't practical:
dsregcmd /status
Sounds like a Jurassic question, but there you go.