Clear-ADAccountExpiration

Clear the expiration date for an Active Directory account.

Syntax
      Clear-ADAccountExpiration [-Identity] ADAccount
        [-AuthType {Negotiate | Basic}] [-Credential PSCredential]
           [-Partition string] [-PassThru] [-Server string]
               [-Confirm] [-WhatIf] [CommonParameters]

Key
   -AuthType {Negotiate | Basic}
       The authentication method to use: Negotiate (or 0), Basic (or 1)
       A Secure Sockets Layer (SSL) connection is required for Basic authentication.

   -Credential PSCredential
       A user account that has permission to perform this action.
       The default is the current user unless the cmdlet is run from an AD PowerShell provider drive
       in which case the account associated with the drive is the default.

       "User64" or "Domain01\User64" or a PSCredential object.

   -Identity ADAccount
       Specify an AD domain object by providing one of the following values.
       (The identifier in parentheses is the LDAP display name for the attribute.)

          Distinguished Name 
            Example: DC=Helvetia,DC=corp,DC=SS64,DC=com 
          GUID (objectGUID) 
            Example: 599c4d2e-f72d-4d20-8a78-030d69495f20
          Security Identifier (objectSid) 
            Example: S-1-5-21-5165297888-301467370-576410423-1803
          Security Accounts Manager (SAM) Account Name (sAMAccountName)
            Example: Helvetia

       The cmdlet searches the default naming context or partition to find the object.
       If two or more objects are found, the cmdlet returns a non-terminating error.

       This parameter can also get this object through the pipeline or you can set this
       parameter to an object instance.

   -Partition string
       The distinguished name of an AD partition.
       The distinguished name must be one of the naming contexts on the current
       directory server. The cmdlet searches this partition to find the object defined by
       the -Identity parameter. 
       The following two examples show how to specify a value for this parameter.
          -Partition "CN=Configuration,DC=Europe,DC=Test,DC=SS64,DC=com"
          -Partition "CN=Schema,CN=Configuration,DC=Europe,DC=Test,DC=SS64,DC=com"
          
       In many cases, a default value will be used for the Partition parameter if no value
       is specified.

   -PassThru
       Return the new or modified object.
       By default (i.e. if -PassThru is not specified), this cmdlet does not generate any output.

   -Server string
       The AD Domain Services instance to connect to, this may be a Fully qualified domain name,
       NetBIOS name, Fully qualified directory server name (with or without port number) or AD Snapshot instance.

       Examples: demo.SS64.com  demo  demoDC02.demo.ss64.com  demoDC02.demo.ss64.com:3268

   -Confirm
       Prompt for confirmation before executing the command.

   -WhatIf
       Describe what would happen if you executed the command, without actually executing the command.

   CommonParameters:
       -Verbose, -Debug, -ErrorAction, -ErrorVariable, -WarningAction, -WarningVariable,
       -OutBuffer -OutVariable.

Clear-ADAccountExpiration clears the expiration date for an Active Directory user or computer account. When the expiry date for an account is cleared, the account does not expire. The -Identity parameter specifies the user or computer account to modify.

Examples

Clear the account expiration date for the user with SamAccountName: TommyEllis:

PS C:\> Clear-ADAccountExpiration -Identity TommyEllis

Clear the account expiration date for the user with DistinguishedName: "CN=TommyEllis,DC=AppNC" on the AD LDS instance: "SS64SVR1:60000"

PS C:\> Clear-ADAccountExpiration -Identity "CN=TommyEllis,DC=AppNC" -server "SS64SVR1:60000"

“Your vision will become clear only when you look into your heart. Who looks outside, dreams. Who looks inside, awakens” - Carl Gustav Jung

Related:

Set-adAccountExpiration - Set the expiration date for an AD account.


© Copyright SS64.com 1999-2013
Some rights reserved