Export (0) Print
Expand All

Setting a User's Account to Expire

Updated: February 28, 2009

Applies To: Windows Server 2008 R2

This topic explains how to use the Active Directory module for Windows PowerShell to set a user’s account to expire.

The following example demonstrates how to set the user account JaneDow to expire on the date 11/27/2008:

Set-ADUser JaneDow -AccountExpirationDate 11/27/2008

You can use the following parameters when you set many of the common values that are associated with a user object in Active Directory Domain Services (AD DS):

  • -AccountExpirationDate

  • -AccountNotDelegated

  • -AccountPassword

  • -AllowReversiblePasswordEncryption

  • -CannotChangePassword

  • -ChangePasswordAtLogon

  • -Enabled

  • -PasswordNeverExpires

  • -PasswordNotRequired

  • -SmartcardLogonRequired

  • -TrustedForDelegation


  • -DisplayName

  • -GivenName

  • -Initials

  • -OtherName

  • -Surname

  • -Description


  • -City

  • -Country

  • -POBox

  • -PostalCode

  • -State

  • -StreetAddress


  • -Company

  • -Department

  • -Division

  • -EmployeeID

  • -EmployeeNumber

  • -Manager

  • -Office

  • -Organization

  • -Title


  • -Fax

  • -HomePhone

  • -MobilePhone

  • -OfficePhone


  • -EmailAddress

  • -HomeDirectory

  • -HomeDrive

  • -HomePage

  • -ProfilePath

  • -ScriptPath


  • -Certificates

  • -LogonWorkstations

  • -PermittedLogonTimes

  • -UserPrincipalName

  • -ServicePrincipalNames

For a full explanation of the parameters that you can pass to Set-ADUser, at the Active Directory module command prompt, type Get-Help Set-ADUser –detailed, and then press ENTER.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft