I need some help regarding a PowerShell script that exports to a CSV file the following: the computer hostname, the operating system name (windows 10 enterprise, windows 10 pro, etc).
So far I managed to do all of the above using :
Get-ADComputer -Filter * -Properties * |
Select -Property Name,DNSHostName,Operatingsystem,BitLockerRecoveryInfo,Enabled,LastLogonDate |
Export-CSV "C:\\AllComputers.csv" -NoTypeInformation -Encoding UTF8
But when trying to add the "Get-BitLockerRecovery" argument, powershell returns:
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
Can someone please explain to me why? Or help me with adding the necessary commands to my script?