关于ActiveDriectory编程问题

thinp 2005-03-17 03:38:26
ActiveDriectory编程中,我添加了一个用户,得到了IADsUser接口pUser,如何将其设置第一次登陆必须修改密码??
开发环境:winXP, VC6
环境:Windows2000 advance Server,装了Active Driectory

我用了
CComBSTR sbstrProp;
CComVariant svar;
sbstrProp = "pwdLastSet";
svar = 0;
hr = padsUser->Put(sbstrProp, svar);
会返回0x8000500f错误!!
...全文
110 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
goodheartppl 2005-03-29
  • 打赏
  • 举报
回复
Win32_UserAccount

The Win32_UserAccount WMI class contains information about a user account on a Windows operating system.

Note Because both the Name and Domain are key properties, enumerating Win32_UserAccount on a large network can affect performance negatively. Calling GetObject or querying for a specific instance has less impact.


The following syntax is simplified from Managed Object Format (MOF) code and includes all inherited properties.


class Win32_UserAccount : Win32_Account
{
uint32 AccountType;
string Caption;
string Description;
boolean Disabled;
string Domain;
string FullName;
datetime InstallDate;
boolean LocalAccount;
boolean Lockout;
string Name;
boolean PasswordChangeable;
boolean PasswordExpires;
boolean PasswordRequired;
string SID;
uint8 SIDType;
string Status;
};
Methods
thinp 2005-03-25
  • 打赏
  • 举报
回复
这个问题我解决了,是属性名不对,PwdLastSet这设置对WinNT是无效的,而是passwordexpried(写法有点像这样,具体记不清楚)就可以设了
蒋晟 2005-03-22
  • 打赏
  • 举报
回复
http://msdn.microsoft.com/library/en-us/wmisdk/wmi/win32_useraccount.asp
http://msdn.microsoft.com/library/en-us/dnclinic/html/scripting01132004.asp
http://msdn.microsoft.com/msdnmag/issues/0500/wmiprov/
firmbird 2005-03-18
  • 打赏
  • 举报
回复
0x8000500FL E_ADS_SCHEMA_VIOLATION The attempted action violates the directory service schema rules
firmbird 2005-03-18
  • 打赏
  • 举报
回复
If this value is set to 0 and the User-Account-Control attribute does not contain the UF_DONT_EXPIRE_PASSWD flag, then the user must set the password at the next logon.
我看MSDN上的示例也是这样的,是不是因为跟其他属性冲突的缘故。
thinp 2005-03-18
  • 打赏
  • 举报
回复
这我知道,这项属性在ADSI接口中是只读的,那么哪个属性可以调置第一次登陆必须修改密码呢

3,245

社区成员

发帖
与我相关
我的任务
社区描述
ATL,Active Template Library活动(动态)模板库,是一种微软程序库,支持利用C++语言编写ASP代码以及其它ActiveX程序。
社区管理员
  • ATL/ActiveX/COM社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧