Solved

LookupAccountName & remote computer

Posted on 2011-03-13
3
590 Views
Last Modified: 2013-12-04
Hi,

Iam using LookupAccountName to get sid of remote machine. But i get GetLastError 5. access ERROR_ACCESS_DENIED. Iam testing this on home network without domains.

Iam also have tried this variants:
LookupAccountName(L"machine_name", L"machine_name\\login",...);
LookupAccountName(null, L"machine_name\\login",...);
LookupAccountName(null, L"machine_name",...);
0
Comment
Question by:lavitz
  • 2
3 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 35122357
'In order fot that to work, you need to be logged on with an username/password combination that also exists on the remote computer - in other words, if you are signed on as "JohnDoe" with the password "TopSecret", the other machine also needs to have an account "JohnDoe" with the PW "TopSecret". BTW, the machine name needs to be prepended with two backslashes, i.e.

LookupAccountName(L"\\\\machine_name", L"machine_name\\JohnDoe",...);
0
 

Author Comment

by:lavitz
ID: 35132072
How function LookupAccountName knows that iam logged on remote computer?
And how to log on on remote computer?
0
 
LVL 86

Expert Comment

by:jkr
ID: 35142637
You don't need to, the NTLM subsystem will take care of that - yet the aforementioned precondition applies.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

775 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question