Tag Archives: active directory

Get Boot Time For all computers in an OU – Powershell

I wrote the following script enumerates an OU and then looks up the last boot time for each computer.


Note: I’m starting to put any scripts I write on GitHub, this will make it easier for you copy down and easier for me to keep any scripts up to date.

Exporting Active Directory Users Into CSV

It took far too long to find this very very useful command online so I thought I’d repost to help others find it.
The below command exports as follows:
Connection to server: domain.local
Exporting attributes: whenChanged,whenCreated,cn,sAMAccountName,givenName,sn
From DN Root: DC=domain,DC=local
Into File: domain.local-users.csv
csvde -s domain.local -l "whenChanged,whenCreated,cn,sAMAccountName,givenName,sn" -d "DC=domain,DC=local" -f domain.local-users.csv