IADsTSUserEx::put_TerminalServicesHomeDrive method (tsuserex.h)
The root drive for the user. In a network environment, this property is a string that contains a drive specification (a drive letter followed by a colon) to which the UNC path specified as the root directory is mapped.
This property is read/write.
Syntax
HRESULT put_TerminalServicesHomeDrive(
BSTR pNewVal
);
Parameters
pNewVal
Return value
None
Remarks
To set a root directory in a network environment, you must first set this property and then set the TerminalServicesHomeDirectory property.
Examples
The following example shows a script that binds to the SAM database without credentials.
Set DSO = GetObject("WinNT:")
Set usr = DSO.OpenDSObject("WinNT://Server1/Test,user")
WScript.echo usr.TerminalServicesHomeDrive
Wscript.echo usr.TerminalServicesHomeDirectory
usr.TerminalServicesHomeDrive = "Z:"
usr.TerminalServicesHomeDirectory = "\\servername\share\path"
usr.SetInfo
WScript.echo usr.TerminalServicesHomeDrive
WScript.echo usr.TerminalServicesHomeDirectory
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista |
Minimum supported server | Windows Server 2008 |
Target Platform | Windows |
Header | tsuserex.h (include Tsuserex.h, Tsuserex_i.c) |
DLL | Tsuserex.dll |