Visual studio 2017 is only an IDE and is not relevant for your task.
If you mean the windows defender, take a look at
API / Windows Defender Functions, for example at WDStatus function:
Returns the current status of Windows Defender.
HRESULT WDStatus(
BOOL *pfEnabled
);
The status of Windows Defender as a boolean. TRUE means Windows Defender is in enabled status. FALSE means Windows Defender is in disabled status.