none
WTSSetUserConfing GetLastError 1317 "user does not exist" RRS feed

  • Question

  • I have an MFC project   that makes a connection to Active Directory on a Microsoft Server 2008 R2 64bit. I administrate the users of a company there and every midnight at 00:00 writes the Entrys and changes of Useraccounts on AD (Active Directory) as planed Tasks. The Task are in a Oracle Database and a have full access on them.

     For that i open a connection as domain administator with password On  Server DXXX40

    and i am trying with a remote path\\mycompanydotcom\home\007 to set Users directory.

    The remote Path is a share on Server  DXXX18 . It ist a Windows 2003 server : I tryed a "net use" and "DIR" and they have access to shared path with The Adminisrtator password. Now i do not know why the WTSSetUserConfig can not set the user directory. That worked before we changed the administrator password. But it could be also an coinsident.

    My Code looks like this:

    WNetAddConnection2 ( lpNetResource, lpPassword,   lpUsername, dwFlags)

    The connection is open without an error. Now i call the:

     WTSSetUserConfig(strServer.GetBuffer(0), m_strName.GetBuffer(0),WTSUserConfigTerminalServerHomeDirDrive,

    "//...com/store/home/users/007", sizeof(DWORD));

    This funktion gives error. The GetLastError() function gives error: 1317 "user does not exist". But User 007 is in Active Directory. Is that a bug? on AD or WTS?

    Does someone know a way to make it work?

    Thank you 



    • Edited by J Pap Thursday, April 10, 2014 9:27 PM
    Thursday, April 10, 2014 11:10 AM