I can use the following command to find out if a Windows Terminal Server is in Install Mode.
change user /query
How can I detect this programmatically through the Windows API?
I can use the following command to find out if a Windows Terminal Server is in Install Mode.
change user /query
How can I detect this programmatically through the Windows API?
I'm guessing you want the TerminalServerMode property in the Win32_TerminalServiceSetting WMI class
This Technet article has a scripting example you could probably adapt to test the property.
To do this in native winapi (without using WMI) you could look at the undocumented functions in winsta.dll or check the registry.
It looks like there is no supported way to do it.
Kernel32.dll exports the required function, but the documentation discourages its use. Also, the documentation doesn't list an alternative.
BOOL TermsrvAppInstallMode(void);
http://msdn.microsoft.com/en-us/library/bb432494(v=VS.85).aspx