ÿþ<html> <head> <title>Get-SqlDatabase</title> </head> <body> <h1>Get-SqlDatabase</h1> <div>Gets an SMO Database object.</div> <h2> Syntax </h2> <code>Get-SqlDatabase [-sqlserver] &lt;Object&gt; [[-dbname] &lt;String&gt;] [[-force]] [&lt;CommonParameters&gt;]</code> <h2> Detailed Description </h2> <div> The Get-SqlDatabase function gets an SMO Database object for the specified SQL Database or collection of Database objects. </div> <h2> Related Commands </h2> <div> * <a href='Get-SqlDatabase.htm'>Get-SqlDatabase</a><br/> </div> <h2> Parameters </h2> <table border='1'> <tr> <th>Name</th> <th>Description</th> <th>Required?</th> <th>Pipeline Input</th> <th>Default Value</th> </tr> <tr valign='top'> <td>sqlserver&nbsp;</td> <td>&nbsp;</td> <td>true&nbsp;</td> <td>false&nbsp;</td> <td>&nbsp;</td> </tr> <tr valign='top'> <td>dbname&nbsp;</td> <td>&nbsp;</td> <td>false&nbsp;</td> <td>false&nbsp;</td> <td>&nbsp;</td> </tr> <tr valign='top'> <td>force&nbsp;</td> <td>&nbsp;</td> <td>false&nbsp;</td> <td>false&nbsp;</td> <td>&nbsp;</td> </tr> </table> <h2> Input Type </h2> <div>None You cannot pipe objects to Get-SqlDatabase</div> <h2> Return Values </h2> <div>Microsoft.SqlServer.Management.Smo.Database Get-SqlDatabase returns a Microsoft.SqlServer.Management.Smo.Database object.</div> <h2> Examples </h2> <h3> EXAMPLE 1</h3> <pre>Get-SqlDatabase "Z002\sql2K8"</pre> <div>This command gets a collection of SMO Database objects for SQL Server Z002\SQL2K8.</div> <h3> EXAMPLE 2</h3> <pre>Get-SqlDatabase $(Get-SqlServer "Z002\sql2K8" "sa" "Passw0rd") "pubs"</pre> <div>This command gets a SMO Database object for SQL database pubs on the SQL Server Z002\SQL2K8 using SQL authentication.</div> </body> </html>