We help IT Professionals succeed at work.

Clear expirationtime AD object (computer,user)  attribute

celmajj
celmajj used Ask the Experts™
on
Hi EXperts,

I have set an expirationtime attributes in AD Object (computer, user). But I can't remove it. Do you know how to clear or remove this attribute

expirationtime AD attribute
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
AlexA lack of information provides a lack of a decent solution.

Commented:
open powershell

Clear-ADAccountExpiration -Identity Username/computername

Try that, run it with your domain admin account.

Regards
Alex

Author

Commented:
Hi Alex,

This cmdlet clear this attribute

account-expire-attribute.JPG
AlexA lack of information provides a lack of a decent solution.

Commented:
So I'm guessing when you try to clear it manually it won't let you?

Or are you wanting a script to clear it for everyone?
Pete LongTechnical Consultant

Commented:
That is odd it's letting me add and remove values, are you looking at the object with ADSIedit (as an administrator?)

time
Pete LongTechnical Consultant

Commented:
My guess is its not used/depreciated, as running;

Get-ADUser -Identity "username" | Select *

Does not return a value even if it's been set?

</p>

Updated - I lied it does

PS C:\Users\administrator.PNL> Get-AdUser -Identity tommy.tester -Properties * | select Name,ExpirationTime

Name         ExpirationTime
----         --------------
Tommy Tester 27/12/0019 13:04:06


But notice the year, it expired 2000 years ago, does yours say the same?

Author

Commented:
Hi Alex,

when I try to clear it manually it won't let me and I am using domain admin account

Author

Commented:
I do not try with set-aduser -identity username -clear expirationtime
because I don't know if it will really clear it.

Any idea?

Thks
Top Expert 2016
Commented:
in ADSI Editor set it to 0 (zero) or remove it in ADUC https://www.screencast.com/t/H2fy0yJoR

Author

Commented:
Thks to all for your help