Compartir a través de


Método IADsTSUserEx::get_TerminalServicesProfilePath (tsuserex.h)

Ruta de acceso de perfil móvil o obligatoria que se usará cuando el usuario inicia sesión en el servidor host de sesión de Escritorio remoto (host de sesión de Escritorio remoto).

Esta propiedad es de lectura y escritura.

Sintaxis

HRESULT get_TerminalServicesProfilePath(
  BSTR *pVal
);

Parámetros

pVal

Valor devuelto

None

Observaciones

La ruta de acceso del perfil tiene el siguiente formato de ruta de acceso de red:

\\Nombredeservidor\ProfilesFolderName\Nombre de usuario

Nota Una ruta de acceso de perfil de Servicios de Escritorio remoto solo se usa para iniciar sesión en un servidor host de sesión de Escritorio remoto.
 

Ejemplos

En el ejemplo siguiente se muestra un programa que se enlaza a la base de datos de Active Directory sin credenciales.

 IADsContainer *pContainer = NULL;
 IDispatch *pNewObject = NULL;
 IADsTSUserEx *pTSUser = NULL;
 IADsUser *pUser = NULL;
 HRESULT hr = ERROR_SUCCESS;

 CoInitialize(NULL);
 //
 // Bind to the known container.
 //
 hr = ADsGetObject(
    L"LDAP://DOMAIN/CN=Users,DC=Server1,DC=Domain,DC=com",
    IID_IADsContainer,
    (void**)&pContainer);

 if( !SUCCEEDED(hr)) {
  wprintf(L"ADsGetObject ret failed with 0x%x\n", hr);
  return FALSE;
 }
 //
 // Create the new Active Directory Service Interfaces User object.
 //
 hr = pContainer->Create(L"user",
                         L"cn=test3",
                         &pNewObject);
 pContainer->Release();

 if( !SUCCEEDED(hr)) {
  wprintf(L"Create ret failed with 0x%x\n", hr);
  return FALSE;
 }
 //
 // Get the IADsTSUser interface from the user object.
 //
 hr = pNewObject->QueryInterface(IID_IADsTSUserEx, (void**)&pTSUser);

 if( !SUCCEEDED(hr)) { 
  wprintf(L"QueryInterface for IADsTSUserEx failed with ret 0x%x\n",
          hr);
  return FALSE;
 }
 //
 // Get the IADsTSUser interface from the user object.
 //
 hr = pNewObject->QueryInterface(IID_IADsUser, (void**)&pUser);

 if( !SUCCEEDED(hr)) {
  wprintf(L"QueryInterface for IAsUser failed with 0x%x\n", hr);
  return FALSE;
 }
 pNewObject->Release();

 //
 // Set TerminalServicesProfilePath
 //
 pTSUser->put_TerminalServicesProfilePath(L"c:\\windows");
 pTSUser->Release();

 //
 // Commit the object data to the directory.
 //
 pUser->SetInfo();
 pUser->Release();
 CoUninitialize();

Puede usar los siguientes ejemplos de script para enlazar con el espacio de nombres de un proveedor. Dos ejemplos enlazan con credenciales proporcionadas; dos enlaces sin credenciales.

En el primer ejemplo se muestra un script que enlaza a la base de datos administrador de cuentas de seguridad (SAM) con las credenciales proporcionadas.

En el segundo ejemplo se muestra un script que enlaza a la base de datos de Active Directory con las credenciales proporcionadas.

Set DSO = GetObject("WinNT:")
Set usr = DSO.OpenDSObject(
    "WinNT://Server1/Test,user",
    Domain\User,
    Password,
    ADS_SECURE_AUTHENTICATION)
Wscript.echo usr.TerminalServicesProfilePath
usr.TerminalServicesProfilePath = "profile path"
usr.SetInfo
WScript.echo usr.TerminalServicesProfilePath

Set DSO = GetObject("LDAP:")
Set usr = DSO.OpenDSObject(
    "LDAP://DOMAIN/CN=Test,CN=Users,DC=Server1,DC=Domain,DC=com",
    Domain\User,
    Password,
    ADS_SECURE_AUTHENTICATION)
Wscript.echo usr.TerminalServicesProfilePath
usr.TerminalServicesProfilePath = "profile path"
usr.SetInfo
WScript.echo usr.TerminalServicesProfilePath

Requisitos

   
Cliente mínimo compatible Windows Vista
Servidor mínimo compatible Windows Server 2008
Plataforma de destino Windows
Encabezado tsuserex.h (include Tsuserex.h, Tsuserex_i.c)
Archivo DLL Tsuserex.dll

Consulte también

IADsTSUserEx