1 out of 6 rated this helpful - Rate this topic

Pwd-Last-Set attribute

Applies to: desktop apps only

The date and time that the password for this account was last changed. This value is stored as a large integer that represents the number of 100 nanosecond intervals since January 1, 1601 (UTC). 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.

CNPwd-Last-Set
Ldap-Display-NamepwdLastSet
Size8 bytes
Update PrivilegeThis value is set by the system.
Update FrequencyEach time the password is changed.
Attribute-Id1.2.840.113556.1.4.96
System-Id-Guidbf967a0a-0de6-11d0-a285-00aa003049e2
Syntax Interval

Implementations

Windows 2000 Server

Link-Id-
MAPI-Id-
System-OnlyFalse
Is-Single-ValuedTrue
Is IndexedFalse
In Global CatalogFalse
NT-Security-DescriptorO:BAG:BAD:S:
Range-Lower-
Range-Upper-
Search-Flags0x00000000
System-Flags0x00000010
Classes used in User

Windows Server 2003

Link-Id-
MAPI-Id-
System-OnlyFalse
Is-Single-ValuedTrue
Is IndexedFalse
In Global CatalogFalse
NT-Security-DescriptorO:BAG:BAD:S:
Range-Lower-
Range-Upper-
Search-Flags0x00000000
System-Flags0x00000010
Classes used in User

ADAM

Link-Id-
MAPI-Id-
System-OnlyFalse
Is-Single-ValuedTrue
Is IndexedFalse
In Global CatalogFalse
NT-Security-DescriptorO:BAG:BAD:S:
Range-Lower-
Range-Upper-
Search-Flags0x00000000
System-Flags0x00000010
Classes used in ms-DS-Bindable-Object

Windows Server 2003 R2

Link-Id-
MAPI-Id-
System-OnlyFalse
Is-Single-ValuedTrue
Is IndexedFalse
In Global CatalogFalse
NT-Security-DescriptorO:BAG:BAD:S:
Range-Lower-
Range-Upper-
Search-Flags0x00000000
System-Flags0x00000010
Classes used in User

Windows Server 2008

Link-Id-
MAPI-Id-
System-OnlyFalse
Is-Single-ValuedTrue
Is IndexedFalse
In Global CatalogFalse
NT-Security-DescriptorO:BAG:BAD:S:
Range-Lower-
Range-Upper-
Search-Flags0x00000000
System-Flags0x00000010
Classes used in User

Windows Server 2008 R2

Link-Id-
MAPI-Id-
System-OnlyFalse
Is-Single-ValuedTrue
Is IndexedFalse
In Global CatalogFalse
NT-Security-DescriptorO:BAG:BAD:S:
Range-Lower-
Range-Upper-
Search-Flags0x00000000
System-Flags0x00000010
Classes used in User

Windows Server 8 Beta

Link-Id-
MAPI-Id-
System-OnlyFalse
Is-Single-ValuedTrue
Is IndexedFalse
In Global CatalogFalse
NT-Security-DescriptorO:BAG:BAD:S:
Range-Lower-
Range-Upper-
Search-Flags0x00000000
System-Flags0x00000010
Classes used in User

Remarks

The high part of this large integer corresponds to the dwHighDateTime member of the FILETIME structure and the low part corresponds to the dwLowDateTime member of the FILETIME structure.

See also

User-Account-Control

 

 

Send comments about this topic to Microsoft

Build date: 2/3/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
C# code
[SecurityCritical]
        public void ExpirePasswordNow(DirectoryEntry de, string sUserName)
        {
            try
            {
                string attribute = "pwdLastSet";
                int value = 0;
                de.RefreshCache(new string[] { attribute });
                de.Properties[attribute].Value = value;
                de.CommitChanges();
            }
            catch (COMException exception)
            {
                throw ExceptionHelper.GetExceptionFromCOMException(exception);
            }
            finally
            {
                if (de != null)
                {
                    de.Dispose();
                }
            }
        }
PS/VSB

You need to first change pwdLastSet to "0" before changing it to "-1".

VBS:

strUserDN = "CN=some user,CN=Users,DC=example,DC=org"
Set objUser = GetObject("LDAP://" & strUserDN)
' Set to "change at next logon" (1601-01-01)
objUser.Put "pwdLastSet", 0
objUser.SetInfo
' Set to Now()
objUser.Put "pwdLastSet", -1
objUser.SetInfo
Set objUser = Nothing

PowerShell:

Import-Module ActiveDirectory
$user = Get-ADUser -Filter {sAMAccountName -eq 'someuser'}
$uObj = [ADSI]"LDAP://$user"
$uObj.put("pwdLastSet", 0)
$uObj.SetInfo()
$uObj.put("pwdLastSet", -1)
$uObj.SetInfo()

And in Windows Script?
I don't know how to change it in PowerShell, but I'm looking at how to change it in Windows Script.  I'm still reading an article at http://msdn.microsoft.com/en-us/library/ms974598.aspx at this very moment I write this comment.  The article is very long.  Hope the answer is there.
Can the attribute be update to allow editing?
I need to edit this attribute via powershell script.  How would one update the schema attribute for pwdLastSet to allow it to be set by.  It is currently only allowed to be updated by the system.