A long time ago Michael Niehaus wrote this brilliant module for PowerShell to manipulate the MDT database. Works great for bulk import of computers, creating assigning roles and so forth. You can read more and download the module from his blog here http://blogs.technet.com/b/mniehaus/archive/2009/05/15/manipulating-the-microsoft-deployment-toolkit-database-using-powershell.aspx
The reason behind this blogpost is that there is an issue with the module, or with a view in the database used by the module. This gives the effect that when searching for computers you cannot use the description field to find them.
So if we take a look at my database I have two entries both with a description.
But when I have imported the module and connected to the database and use Get-MDTComputer -Description “LT-PETER” I get an error.
So me and Mikael Nyström (http:///www.deploymentbunny.com) did some digging and found that there is a mismatch between the query and the view being used.
There are two ways of fixing this. You can either do it manually or use the script I have included here.
The manual way. Open up SQL Management studio and browse to your database. Open up the view called dbo.ComputerSettings. Choose design and check the box in ci marked Description. Save and you’re done.
The script way, download the script here and run it using powershell the only thing you need to enter are the name to your sqlserver including instance name and the name of your mdt database.
The script can be run with parameters on one line or just run the script and it will ask for server and database name.
Now when you run the command it can find the computer!