Pages

Tuesday, April 27, 2021

Export list of active computers from an OU to a .csv file

Get-ADComputer -filter {Enabled -eq $True} -Properties cn -SearchBase "OU=Production,DC=domain,DC=local" | select cn | ConvertTo-Csv -NoTypeInformation | Select-Object -skip 1 | Out-File <INSERT PATH TO .CSV FILE>