import-module sqlserver # may need to import The commandlet is provided in the “SQLServer” module so you may need to import this module in order to use it. Invoke-sqlcmd -ServerInstance "MyServer01\TestSQL01" -Query "SELECT Get-SQLInstance Example ![]() This post is about the Get-SQLInstance commandlet so I add this here just for reference. Here at DB Tales we tend to use the Invoke-SQLCmd commandlet as you can easily use one of your existing scripts to return specialized data. The administrator often needs to inventory the server environment and that includes identifying the SQL servers as well as all of the instances.Īnother useful commandlet for SQL Server is the Get-SQLDatabase that includes more detailed data on the databases hosted. ![]() We can use a commandlet called get-sqlinstance to quickly query an existing SQL instance on a remote server for more information.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |