This issue you're facing is that the inventory function you wrote was designed to use $_ directly, and you are assuming that the $_ Variable will only be a string. The command works initially because you are extracting a list of names from a file, which is giving you a list of names which are of type [String], and passing this collection/list of strings into the pipeline for inventory to use.
But when using Get-QADComputer, you are getting objects of type [Selected.Quest.ActiveRoles.ArsPowerShellSnapIn.Data.ArsComputerObject] which is so much more then just a list of names. The objects have a name property, which i assume you truly are after, along with other information. You need to pull just the name portion out and pass that along into the pipeline
So you have two options:
Change the inventory function to account for the difference in input types from the pipeline (simple strings which contain the just names, or objects that have a name property and use just the name portion)
Change the way in which you are calling the script
Here is the command, I think you want
Get-QADComputer -LdapFilter "(operatingsystem=*server*)" | Select -ExpandProperty Name | inventory | Export-Csv c:\scripts\lastreboot\inventory2.csv
Note the Select -ExpandProperty Name, which takes the ADObject and will pass only the name along into the pipeline which your inventory function is expecting