No announcement yet.

Password Expiration warning for other domain

  • Filter
  • Time
  • Show
Clear All
new posts

  • Password Expiration warning for other domain

    I have been looking around for scripts or code to look at the accounts in AD and send out a warning when their passwords are about to expire. The reason for this, is the user's machines are on a different domain so they do not receive the password warning for their old accounts on the old domain. Most scripts I have found send the email to the address that is associated with the AD account but since our exchange servers have been migrated from the old domain to the new domain, we cannot send to those address anymore. Any suggestions on how to go about doing this? ty

  • #2
    Re: Password Expiration warning for other domain

    have your script just email you a single file. And then you can send it on to the relevant users.

    Or, output the usernames to a file, then use another script to read the usernames, obtain the email addresses from the new directory, and email them at that address.
    Please do show your appreciation to those who assist you by leaving Rep Point


    • #3
      Re: Password Expiration warning for other domain

      Maybe by using a user Logon script? => Listing 7. "Answer to the exercise"

      Adjust the script a little,
      - Create just a single popup box for the notification.
      - Only popup when a password was set and it will expire within 14 days.

      Test the script if it runs cross domain. Not sure if "ADSystemInfo.DomainDNSName" returns the directory name of the userdomain.
      Otherwise you probably have to use,
      With WScript.CreateObject("WScript.Network")
      strUserDomain = .UserDomain
      strUserName = .UserName
      End With
      Set objRootDSE = GetObject("LDAP://" & strUserDomain & "/RootDSE")
      Set objDomain = GetObject ("LDAP://" & objRootDSE.Get("DefaultNamingContext"))


      This posting is provided "AS IS" with no warranties, and confers no rights.


      ** Remember to give credit where credit's due **
      and leave Reputation Points for meaningful posts