Month: February 2018

Get Active Directory users expiration date

If you need to know when your users passwords will expire in AD, you can execute this commands in Powershell, this will response with all the accounts and dates. Get-ADUser -filter {Enabled -eq $True -and PasswordNeverExpires -eq $False} –Properties “DisplayName”, “msDS-UserPasswordExpiryTimeComputed” | Select-Object -Property “Displayname”,@{Name=”ExpiryDate”;Expression={[datetime]::FromFileTime($_.”msDS-UserPasswordExpiryTimeComputed”)}} Output example: Displayname ExpiryDate ———– ———- John Doe 15/10/2018 18:45:29

Javascript – Play with strings and arrays

Last weekend I was playing with strings in Javascript and I made different exercises with them, so this is a good moment to write a remember post with this simple commands. Exercise 1: Discard first n characters of a string, in this case 3 [crayon-5ba67bf092720892066988/] Exercise 2: Get the string until certain character, in this