title: How to get maxpwdAge attribute value in ActiveDirectory using C++?
body: <p>i am working with AD Server,i want to get the <strong>maxpwdAge attribute</strong> value...</p>
  
  <p>i already try ADSi for that,but it gives an issue.</p>
  
  <pre><code>VARIANT var;
  bsNamingContext=L"maxpwdAge";
  
  hr = ADsGetObject(pszADsPath, IID_IADsUser, (void**) &amp;pUser);
  if(SUCCEEDED(hr))
  {
  VariantInit(&amp;var);
  hr = pUser-&gt;Get(bsNamingContext, &amp;var);  
  }
  </code></pre>
  
  <p>but,it gives -2147463155 (8000500d) error...</p>
  
  <p>but i am using  <code>bsNamingContext=L"cn";</code>
  it gives the CN values correctly...</p>
  
  <p>anyone can resolve it?</p>