c++ - Getting primary domain SID without admin privileges -


i'm trying obtain computer's primary domain sid on windows using c++. have manged using lsaqueryinformationpolicy policyprimarydomaininformationparameter. i've opened lsa policy operation given:

auto lsastatus = lsaopenpolicy(server, &objectattributes, generic_read | policy_view_local_information, &policyhandle); 

unfortunatelly, using lsaopenpolicy requiers administrator privileges run , project i'm working on, cannot, since of users not have it. question - there way of obtaining current computer's primary domain sid without invoking admin rights? if there is, how should go doing using visual c++/mfc?

i have found solution problem. turns out made wrong assumption based on incorrect api description on msdn. can read here, lsaopenpolicy seems require administrator privileges , article access masks did not nor did lead me anywhere find information needed privileges. stack overflow user tripshock , comment on similar topic here found out using policy_view_local_information access flag not invoke admin rights. tested in program , virtual machine , turns out true.


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -