Active Directory ortamındaki bilgisayar isimlerini listeleme

Powershell ortamında aşağıdaki komut kullanılarak domain’de bulunan tüm bilgisayarların isimleri bir metin dosyasına yazdırılabilir:

$computers = Get-ADComputer -Filter * | Format-table name
write($computers) | Out-File -FilePath .\computers.txt

NOT: get-adcomputer komutunu kullandığınızda “The term ‘Get-ADUser’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again” hatası alırsanız Active Directory modülü PowerShell ortamında bulunmuyor demektir. Bu durumda öncelikle import-module activedirectory komutunu çalıştırmanız gerekir.

Bir yanıt yazın

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir