Vbscript 密码提示提示-组合vb和hta

Vbscript 密码提示提示-组合vb和hta,vbscript,scripting,hta,group-policy,Vbscript,Scripting,Hta,Group Policy,我正在尝试如何结合这两个脚本。我想将密码剩余天数的vbs脚本中的值传递到hta文件。如果用户密码少于7天,我不会介意一个更好的网页界面,而不是一个消息框 有什么想法吗 还有这个 '========================================== ' Check for password expiring notification '========================================== ' First, get the domain polic

我正在尝试如何结合这两个脚本。我想将密码剩余天数的vbs脚本中的值传递到hta文件。如果用户密码少于7天,我不会介意一个更好的网页界面,而不是一个消息框

有什么想法吗

还有这个

'==========================================
' Check for password expiring notification
'==========================================
' First, get the domain policy.
'==========================================
Dim oDomain
Dim oUser
Dim maxPwdAge
Dim numDays
Dim warningDays
warningDays = 7

Set LoginInfo = CreateObject("ADSystemInfo")  
Set objUser = GetObject("LDAP://" & LoginInfo.UserName & "")  
strDomainDN = UCase(LoginInfo.DomainDNSName) 
strUserDN = LoginInfo.UserName
'========================================
' Check if password is non-expiring.
'========================================
Const ADS_UF_DONT_EXPIRE_PASSWD = &h10000
intUserAccountControl = objUser.Get("userAccountControl")
If intUserAccountControl And ADS_UF_DONT_EXPIRE_PASSWD Then
    'WScript.Echo "The password does not expire."
Else

    Set oDomain = GetObject("LDAP://" & strDomainDN)
    Set maxPwdAge = oDomain.Get("maxPwdAge")
    '========================================
    ' Calculate the number of days that are
    ' held in this value.
    '========================================
    numDays = CCur((maxPwdAge.HighPart * 2 ^ 32) + _
                    maxPwdAge.LowPart) / CCur(-864000000000)
    'WScript.Echo "Maximum Password Age: " & numDays

    '========================================
    ' Determine the last time that the user
    ' changed his or her password.
    '========================================
    Set oUser = GetObject("LDAP://" & strUserDN)
    '========================================
    ' Add the number of days to the last time
    ' the password was set.
    '========================================
    whenPasswordExpires = DateAdd("d", numDays, oUser.PasswordLastChanged)
    fromDate = Date
    daysLeft = DateDiff("d",fromDate,whenPasswordExpires)

    'WScript.Echo "Password Last Changed: " & oUser.PasswordLastChanged
    if (daysLeft < warningDays) and (daysLeft > -1) then
        Msgbox "Your network password expires in " & daysLeft & " day(s)" & " at " & whenPasswordExpires & chr(13) & chr(13) & "Once logged in, press CTRL-ALT-DEL and" & chr(13) & "select the 'Change a password' option", 0, "PASSWORD EXPIRATION WARNING!"
    End if
End if
'========================================
' Clean up.
'========================================
Set oUser = Nothing
Set maxPwdAge = Nothing
Set oDomain = Nothing
'==========================================
'检查密码过期通知
'==========================================
'首先,获取域策略。
'==========================================
暗气味
暗箱
Dim最大值
昏暗的日子
暗淡的警告日
警告日=7
设置LoginInfo=CreateObject(“ADSystemInfo”)
设置objUser=GetObject(“LDAP://”和LoginInfo.UserName&“”
strDomainDN=UCase(LoginInfo.DomainDNSName)
strUserDN=LoginInfo.UserName
'========================================
'检查密码是否未过期。
'========================================
Const ADS_UF_not_EXPIRE_PASSWD=&h10000
IntuseAccountControl=objUser.Get(“userAccountControl”)
如果IntuseAccountControl和ADS未过期,则
“WScript.Echo”密码不会过期
其他的
Set-oDomain=GetObject(“LDAP://”和strDomainDN)
设置maxPwdAge=oDomain.Get(“maxPwdAge”)
'========================================
'计算需要的天数
“以这个价值持有。
'========================================
numDays=CCur((maxPwdAge.HighPart*2^32)+_
最大功率(低部分)/CCur(-864000000000)
'WScript.Echo“最长密码期限:”&numDays
'========================================
'确定用户上次访问的时间
'更改了他或她的密码。
'========================================
设置USER=GetObject(“LDAP://”和strUserDN)
'========================================
'将天数添加到最后一次
'密码已设置。
'========================================
当PasswordExpires=DateAdd(“d”,numDays,oUser.PasswordLastChanged)时
fromDate=日期
daysLeft=DateDiff(“d”,起始日期,密码到期时)
“WScript.Echo”上次更改的密码:&user.PasswordLastChanged
如果(daysLeft<警告日)和(daysLeft>-1),则
Msgbox“您的网络密码将在”&daysLeft&“day(s)”&“在”&whenPasswordExpires&chr(13)&chr(13)&“登录后,按CTRL-ALT-DEL和”&chr(13)&“选择“更改密码”选项”,0,“密码过期警告!”
如果结束
如果结束
'========================================
“清理。
'========================================
设置为“无”
设置maxPwdAge=Nothing
设为空

那不是VB.NET code.oops对不起,谢谢你在试吗?你已经试过什么了
daysLeft
提供hta的参数。简单地说,谢谢。昨天我的大脑在衰退。设法得到我所需要的不是VB.NET代码。对不起,谢谢你在尝试吗?你已经试过什么了
daysLeft
提供hta的参数。简单地说,谢谢。昨天我的大脑在衰退。设法得到了我需要的东西