PoshCode Archive  Artifact Content

Artifact f1a1815fb97a444dd19878cf20e397c0a64c2394f13daf9c0e63e3f1a339a8d8:

  • File Show-Databases-on-server.ps1 — part of check-in [662940e8e8] at 2018-06-10 13:57:04 on branch trunk — ############################################################################################# (user: Rob Sewell size: 1114)

# encoding: utf-8
# api: powershell
# title: Show Databases on server
# description: #############################################################################################
# version: 0.1
# type: function
# author: Rob Sewell
# license: CC0
# function: Show-DatabasesOnServer
# x-poshcode-id: 5556
# x-archived: 2015-05-04T22:26:05
# x-published: 2015-10-31T02:46:00
#
# #
# NAME: Show-DatabasesOnServer.ps1
# AUTHOR: Rob Sewell http://sqldbawithabeard.com
# DATE:22/07/2013
# #
# COMMENTS: Load function for finding a databases on Server
# 覧覧覧覧覧覧覧覧覧覧覧覧
#
 #############################################################################################
#
# NAME: Show-DatabasesOnServer.ps1
# AUTHOR: Rob Sewell http://sqldbawithabeard.com
# DATE:22/07/2013
#
# COMMENTS: Load function for finding a databases on Server
# 覧覧覧覧覧覧覧覧覧覧覧覧


Function Show-DatabasesOnServer ([string]$Server)
{
$srv = New-Object ('Microsoft.SqlServer.Management.Smo.Server') $server

Write-Host " The Databases on $Server Are As Follows"
$srv.databases| Select Name
}