TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sijith
NA
1
0
Listing users in active directory from local machine
Oct 8 2009 8:44 AM
Hi. Here i want to list all active users in active directory by sitting in local machine. Is it possible to do. Please help in programming side. My code is here ActiveDir::ActiveDir(QWidget *parent, Qt::WFlags flags) : QMainWindow(parent, flags) { ui.setupUi(this); HRESULT hr; IADsContainer *pCont = NULL; CoInitialize(NULL); hr = ADsGetObject(L"WinNT://avrstudio.com", IID_IADsContainer, (void**) &pCont ); // WinNT://
if ( !SUCCEEDED(hr) ) { printf("ADsGetObject Failed"); return; } else printf("cvdsvdv"); _variant_t var; IEnumVARIANTPtr pEnum; ADsBuildEnumerator (pCont,&pEnum); int cnt=0; ULONG ulFetched = 0L; _variant_t vChild; hr= ADsEnumerateNext(pEnum, 1, &vChild, &ulFetched) ; printf("@@@ %d ulFetched",ulFetched); while((SUCCEEDED(ADsEnumerateNext(pEnum, 1, &vChild, &ulFetched)) /*&& (ulFetched>0)*/)) { IADsUser* pADs; hr = V_DISPATCH(&vChild)->QueryInterface(IID_IADsUser, (void**)&pADs); /* Here i am getting error.... Getting vChild as empty. what i have to do.. Not getting any idea.. Please guide me */ if ( !SUCCEEDED(hr) )/* This getting failed, hr returning false*/ { printf("\n V_DISPATCH Failed"); } if(hr!=S_OK) break; BSTR bstrName; pADs->get_Name(&bstrName); SysFreeString(bstrName); printf("%s\n",bstrName); pADs->Release(); pADs = NULL; } // Cleanup. if ( pCont ) { pCont->Release(); } CoUninitialize(); } Please help
Reply
Answers (
1
)
problem in redirecting the .aspx pages using VC++
Unable to Get Default value for Text Box to Display