Solved

LookupAccountName & remote computer

Posted on 2011-03-13
3
587 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now