> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# IXtfConsoleManager::AddConsole method

> IXtfConsoleManager::AddConsole method

# IXtfConsoleManager::AddConsole method

Adds a development console to the [IXtfConsoleManager](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-t) instance.

<a id="syntaxSection" />

## Syntax

```cpp theme={null}
public:
HRESULT AddConsole(
         LPCWSTR pszAlias,
         LPCWSTR pszAddress,
         XTF_ADD_CONSOLE_FLAGS dwFlags
)  
```

<a id="parametersSection" />

### Parameters

*pszAlias*\
Type: LPCWSTR

A pointer to the name of the console to add.

*pszAddress*\
Type: LPCWSTR

A pointer to the Tools IP address of the console to add.

*dwFlags*\
Type: XTF\_ADD\_CONSOLE\_FLAGS

A combination of bitwise-OR flags that specify how to add the console to the instance. The following table describes the available flags.

| Value | Macro                                | Description                                                                                    |
| ----- | ------------------------------------ | ---------------------------------------------------------------------------------------------- |
| 0x0   | XTF\_ADD\_CONSOLE\_FLAGS\_NONE       | No flags are specified.                                                                        |
| 0x1   | XTF\_ADD\_CONSOLE\_FLAGS\_SETDEFAULT | After the development console is added, set it as the default development console for this PC. |

<a id="retvalSection" />

### Return value

Type: HRESULT

Returns `S_OK` if successful; otherwise, returns an HRESULT error code.

<a id="remarksSection" />

## Remarks

This method adds the development console specified in `pszAddress`, using the name specified in `pszAlias`, to the [IXtfConsoleManager](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-t) instance. If `XTF_ADD_CONSOLE_FLAGS_SETDEFAULT` is specified in `dwFlags`, the development console is also set as the default development console for this PC. For more information about the default development console, see [IXtfConsoleManager::SetDefaultConsole Method](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/methods/setdefaultconsole-ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-m).

After this method is successfully called, the `IXtfConsoleManager` instance invokes the [OnAddConsole](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManagerCallback/methods/onaddconsole-ixtfconsolemanagercallback-xtfconsolemanager-xbox-microsoft) callback method from the associated [IXtfConsoleManagerCallback](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManagerCallback/ixtfconsolemanagercallback-xtfconsolemanager-xbox-microsoft-t) instance. If `XTF_ADD_CONSOLE_FLAGS_SETDEFAULT` is specified in `dwFlags`, the [OnChangedDefaultConsole](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManagerCallback/methods/onchangeddefaultconsole-ixtfconsolemanagercallback-xtfconsolemanager-xbox) callback method from the associated `IXtfConsoleManagerCallback` instance is also invoked.

For more information about connecting and querying development consoles, see [Connect (xbconnect.exe) (NDA topic)](/tools/tools-console/commandlinetools/xbconnect).

<a id="requirementsSection" />

## Requirements

**Header:** xtfconsolemanager.h

**Library:** xtfconsolemanager.lib

**Supported platforms:** Windows (for XBOX console tools)

<a id="seealsoSection" />

## See also

[IXtfConsoleManager::GetConsole Method](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/methods/getconsole-ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-m)\
[IXtfConsoleManager::RemoveConsole Method](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/methods/removeconsole-ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-m)\
[IXtfConsoleManager Interface](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-t)\
[XtfConsoleManager](/reference/tools/xtf/xtfconsolemanager/xtfconsolemanager-xbox-microsoft-n)


## Related topics

- [IXtfConsoleManagerCallback::OnAddConsole Method](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManagerCallback/methods/onaddconsole-ixtfconsolemanagercallback-xtfconsolemanager-xbox-microsoft.md)
- [IXtfConsoleManagerCallback::OnChangedDefaultConsole Method](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManagerCallback/methods/onchangeddefaultconsole-ixtfconsolemanagercallback-xtfconsolemanager-xbox.md)
- [IXtfConsoleManager::EnumerateConsoles method](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/methods/enumerateconsoles-ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-m.md)
- [IXtfConsoleManager::GetConsole Method](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/methods/getconsole-ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-m.md)
- [IXtfConsoleManager::RemoveConsole Method](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/methods/removeconsole-ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-m.md)
