要想用powershell管理域,首先先加載activedirectory模塊
PS C:\> import-module activedirectory
下面就可以利用get-adcomputer開干了
PS C:\Windows\system32> Get-ADComputer -SearchBase "ou=lstech,dc=lstech,dc=com" -filter * -property * | Select-Object name,operatingsystem >C:\computer.csv