我需要一些关于导出到 CSV 文件的 PowerShell 脚本的帮助:计算机主机名、操作系统名称(Windows 10 企业版、Windows 10 专业版等)。
到目前为止,我设法使用以下方法完成了上述所有操作:
Get-ADComputer -Filter * -Properties * |
Select -Property Name,DNSHostName,Operatingsystem,BitLockerRecoveryInfo,Enabled,LastLogonDate |
Export-CSV "C:\\AllComputers.csv" -NoTypeInformation -Encoding UTF8
但是当尝试添加“Get-BitLockerRecovery”参数时,powershell 会返回:
Get-ADComputer -Filter { name -like "*" } `
Select -Property Name,DNSHostName,Operatingsystem,BitLockerRecoveryInfo,Enabled,LastLogonDate |
Get-BitLockerRecovery |
Export-CSV "C:\\Bit.csv" -NoTypeInformation -Encoding UTF8
Get-BitLockerRecovery: The term 'Get-BitLockerRecovery' 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.
At line:4 char:1
+ Get-BitLockerRecovery |
+ ~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-BitLockerRecovery:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
有人可以向我解释为什么吗?或者帮助我将必要的命令添加到我的脚本中?