调用官方文档API vb脚本修改用户密码问题
发表于 : 2016年9月9日, 16:21
通过调用官方文档vb脚本修改用户密码,系统提示修改成功,查看数据库发现,密码已修改,但是怎么就登录不上去呢?一直提示:验证失败,错误的登陆名或密码。有朋友能帮忙解决下吗?
******************************** 官方脚本 ******************************************************
Function ModifyHmailPassWordAccount(domainName,userName,password,adminName,adminPassword)
Dim obApp
Set obApp = CreateObject("hMailServer.Application")
' Authenticate. Without doing this, we won't have permission
' to change any server settings or add any objects to the
' installation.
Call obApp.Authenticate(adminName, adminPassword)
' Locate the domain we want to add the account to
Dim obDomain
Set obDomain = obApp.Domains.ItemByName(domainName)
Dim obAccount
Set obAccount = obDomain.Accounts.ItemByAddress(userName)
' Set the password to "secret"
obAccount.Password = password
obAccount.Save
End Function
**********************************************************************************************************************
******************************** 官方脚本 ******************************************************
Function ModifyHmailPassWordAccount(domainName,userName,password,adminName,adminPassword)
Dim obApp
Set obApp = CreateObject("hMailServer.Application")
' Authenticate. Without doing this, we won't have permission
' to change any server settings or add any objects to the
' installation.
Call obApp.Authenticate(adminName, adminPassword)
' Locate the domain we want to add the account to
Dim obDomain
Set obDomain = obApp.Domains.ItemByName(domainName)
Dim obAccount
Set obAccount = obDomain.Accounts.ItemByAddress(userName)
' Set the password to "secret"
obAccount.Password = password
obAccount.Save
End Function
**********************************************************************************************************************