Forum Discussion

Marvin Oco's avatar
Marvin Oco
Steel Contributor
Mar 31, 2021

export AD users with password never expire to csv file

any script to export AD users with password never expire to csv file

 

thanks

1 Reply

  • Schnittlauch's avatar
    Schnittlauch
    Steel Contributor

    Hi Marvin Oco,

     

    try this

     

    Search-ADAccount -PasswordNeverExpires -UsersOnly -ResultPageSize 2000 -resultSetSize $null | Select-Object Name, SamAccountName, DistinguishedName | Export-CSV “C:\Temp\PassNeverExpiresUsers.CSV” -NoTypeInformation

    Best regards,
    Schnittlauch

     

    "First, No system is safe. Second, Aim for the impossible. Third no Backup, no Mercy" - Schnittlauch

     

    My answer helped you? Don't forget to leave a like. Also mark the answer as solved when your problem is solved. 🙂

Resources