powershellscripts.com

PowerShell Logo


82 results found for the Databases Category in about 0.015 seconds
Add a Record to a Database Using Windows PowerShell

http://gallery.technet.microsoft.com/93ef6706-42c9-4b88-98f9-4c1e3044615e

Add-SqlTable
Creates a SQL Server table from a DataTable using SMO.
http://gallery.technet.microsoft.com/c193ed1a-9152-4bda-b5c0-acd044e68b2c

ADOMD.NET Analysis Services Data Adapter
ADOMD.NET Analysis Services Data Adapter
http://gallery.technet.microsoft.com/7a91dc12-af2f-4af3-b2af-7410d137ec74

ADOMD.NET Analysis Services Data Reader
ADOMD.NET Analysis Services Data Reader
http://gallery.technet.microsoft.com/8dbf70c3-8707-4713-a0dd-3a5b2544aff1

ADOMD.NET Analysis Services Dimension Ordinal
ADOMD.NET Analysis Services Dimension Ordinal
http://gallery.technet.microsoft.com/c1747e40-6086-4544-ad06-cad98d8797eb

ADOMD.NET Analysis Services Error Handling
ADOMD.NET Analysis Services Error Handling
http://gallery.technet.microsoft.com/194a923b-9da6-4757-ac15-713ca5bde056

ADOMD.NET Analysis Services Execute
ADOMD.NET Analysis Services Execute
http://gallery.technet.microsoft.com/7765e3fb-5862-4f03-98ef-d167a41cc44d

ADOMD.NET Analysis Services Fetching Properties
ADOMD.NET Analysis Services Fetching Properties
http://gallery.technet.microsoft.com/e8f4bef4-1d5b-4afe-ae47-f9b4be19fd82

ADOMD.NET Analysis Services Iterate OLAP Information
ADOMD.NET Analysis Services Iterate OLAP Information
http://gallery.technet.microsoft.com/c5b34d62-6b9f-47d8-a671-2425cf0647c9

ADOMD.NET Analysis Services Nested Rowset
ADOMD.NET Analysis Services Nested Rowset
http://gallery.technet.microsoft.com/6ddbb424-6c28-4755-89a2-b1682fe0d4d2

ADOMD.NET Get Analysis Services Members
ADOMD.NET Get Analysis Services Members
http://gallery.technet.microsoft.com/2fde0711-ebaa-4676-bcc0-de2c295696b9

ADOMD.NET Iterate Analysis Services Actions
ADOMD.NET Iterate Analysis Services Actions
http://gallery.technet.microsoft.com/0095bdac-b2a5-4e1d-9f74-b59f8aa2c3aa

ADOMD.NET Iterate Analysis Services Metadata
ADOMD.NET Iterate Analysis Services Metadata
http://gallery.technet.microsoft.com/31ab3de7-d19a-4b22-9f58-fb9c1302dcf7

ADOMD.NET Share Analysis Services Session
ADOMD.NET Share Analysis Services Session
http://gallery.technet.microsoft.com/f759f955-f571-4d6f-b71b-b25811c82f55

AMO Analysis Services Create KPI
AMO Analysis Services Create KPI
http://gallery.technet.microsoft.com/1eae8b2d-1194-4edd-a2dc-902b00333b30

AMO Analysis Services Dependency Calculator
AMO Analysis Services Dependency Calculator
http://gallery.technet.microsoft.com/8386af59-cf5b-486a-bc5d-65f6be51ae5f

AMO Analysis Services Dependency Calculator Variation Two
AMO Analysis Services Dependency Calculator Variation Two
http://gallery.technet.microsoft.com/51c33370-4bd9-4a78-8ef4-c4d20459594e

AMO Analysis Services Dependent Delete
AMO Analysis Services Dependent Delete
http://gallery.technet.microsoft.com/6ebc781e-9216-435e-84c2-ee41a0e3eb6f

AMO Analysis Services Disconnected Mode
AMO Analysis Services Disconnected Mode
http://gallery.technet.microsoft.com/66da32e8-9163-4744-8bd5-909cf90b6163

AMO Analysis Services Error Handling
AMO Analysis Services Error Handling
http://gallery.technet.microsoft.com/2ef71d07-7703-4092-87ef-a643a1c6d012

AMO Analysis Services Impact Analysis
AMO Analysis Services Impact Analysis
http://gallery.technet.microsoft.com/055253c7-e1c0-40bf-a4df-d3f4fd5fe7a9

AMO Analysis Services Object Load
AMO Analysis Services Object Load
http://gallery.technet.microsoft.com/20a69cef-5280-46ae-836f-b489ab607c6e

AMO Analysis Services Scripter
AMO Analysis Services Scripter
http://gallery.technet.microsoft.com/af48d5fe-43a8-4e05-956e-ff833e51010c

AMO Analysis Services Session Share
AMO Analysis Services Session Share
http://gallery.technet.microsoft.com/895b6b15-b1bb-490e-9c65-ef1c140e08fc

Async SQL Backup
Run multiple backup jobs at the same time. This script IS cluster aware.
http://gallery.technet.microsoft.com/0629d36f-efad-4001-9be9-85490a582977

Backup all databases, where the name matches a regex pattern
Backup all databases, where the name matches a regex pattern.
http://gallery.technet.microsoft.com/1f785dcc-8dcd-48f3-a595-d873c297089c

Backup Ssas Databases with SessionTrace Output

http://gallery.technet.microsoft.com/Backup-Ssas-Databases-with-da62b084

Check event log of a (remote) machine for SQL Server messages
Queries all Event Log entries of a (remote) machine and filters the list for SQL Server related entires since a definedstart date.
http://gallery.technet.microsoft.com/Check-event-log-of-a-645ec773

Check SQL Server related services on several machines
With this PowerShell script you can easily check all SQL Server related services for all servers of a given list.
http://gallery.technet.microsoft.com/Check-SQL-Server-related-b6390307

Check-SQLServerUserInRole
The purpose of this script is to test if a user is in a particular role for a SQL server instance. Please see script for usage examples.
http://gallery.technet.microsoft.com/07febab1-a142-41d2-b6f1-be723dae71c6

Clean-Up SSRS Report History Snapshots
This Powershell scripts deletes all SSRS report history snapshots older then a predefined date existing in the given root folder and recursive in the subfolders. For this, it uses the (supported) web service (SOAP API) of SSRS.
http://gallery.technet.microsoft.com/Clean-Up-SSRS-Report-de4ca081

Cleaning SQL Server backup files
One of the most important tasks for a database administrator is to backup all the databases for security reasons. As a Database administrator we need to make sure that in case of a disaster we will be able to recover our data from any point of time, that’s one of the reasons why
http://gallery.technet.microsoft.com/Cleaning-SQL-Server-backup-3da38020

Configuring SQL Server 2012 for AlwaysOn
This script demonstrates how to perform some simple AlwaysOn configuration for your SQL Server instances, namely: enabling AlwaysOn on your server instances and creating database mirroring endpoints to facilitate data movement.
http://gallery.technet.microsoft.com/Configuring-a-Server-for-0b95eb8e

Copy a table between two SQL Server instances with Windows PowerShell
This Windows PowerShell script copies a table between two SQL Server instances. It uses the .NET SqlBulkCopy class with a streaming IDataReader to achieve the optimal performance. It also supports truncation of the destination table before the copy.
http://gallery.technet.microsoft.com/9db45c7b-b717-4823-8336-664d225f3ba8

Create Inventory of SQL Server in Network as Html
This PoSh script tries to enumerate SQL Server instances in your network using SMO and creates an inventory as a Html document.It's similar to MS MAP,but only as a simple plain script and dedicated for SQL Server instances.With this info you could plan a SQL Server consolidation.
http://gallery.technet.microsoft.com/Create-Inventory-of-SQL-19d61963

Creating An Availability Group With SQL Server PowerShell
This script demonstrates how to create an availability group using cmdlets introduced in SQL Server 2012, along with a few related tasks.
http://gallery.technet.microsoft.com/Creating-An-Availability-2c973b94

Data File Cleanup
Delete files that are not part of a database but stored in a data directory
http://gallery.technet.microsoft.com/35502179-3353-4060-a7a6-e3f05c3753e7

Export of all SSRS reports datasources and resources
This PowerShell script exports all (or filtered) reports, data sources and images directly from the ReportServerdatabase to a specified folder. For the file name the complete report path is used; for file name invalid characters arereplaced with a -.
http://gallery.technet.microsoft.com/Export-of-all-SSRS-reports-57910227

Export of large BLOB data with Ado.Net
Export of small BLOB data using the GetBytes of Ado.Net SqlDataReader without any conversions.
http://gallery.technet.microsoft.com/ff84f6d1-20c0-461e-9857-e100dead3cf9

Export of small BLOB data with Ado.Net
Export of small BLOB data using the GetSqlBinary of Ado.Net SqlDataReader without any conversions. It has a good performance for BLOB data less then ~ 1 GB. Existing files will be overwritten.
http://gallery.technet.microsoft.com/bef7ed62-7a87-4730-8d90-4822f9d2566b

Export SQL Server Error Messages from Event Viewer As HTML
Script retireves all error messages from event viewer about sql server instances and export as an html file so we could read it easily or we could publish to IIS Server.
http://gallery.technet.microsoft.com/bcdb30d6-b6ee-490f-ab8b-2e124c9159f4

Fun with SQL Server Profiler TraceFiles
Reading, Filtering, Saving to XML, Merge multiples profiler traces, Import to SQL Table..anyway Fun with SQL Server Profiler Trace Files
http://gallery.technet.microsoft.com/afeb2728-97c8-4fe8-81cf-0cdaf60434ca

Function Write-SQLCreateTable
Function will script out a T-SQL "Use... Create table...Go" for a given series, or All tables for your destination database.
http://gallery.technet.microsoft.com/529f8872-8475-459a-b35b-9c38c6be0f56

Function Write-TSQLInsertSelect
Function will script out a T-SQL "Insert Into ... Select ..." for a given series, or All tables for your destination database.
http://gallery.technet.microsoft.com/27effaf7-a680-4181-8e88-7490aafe8ab1

Generates create scripts for all tables.
PowerShell script using SMO to script out all tables and optional all related objects like indexes etc.
http://gallery.technet.microsoft.com/262deee3-e54a-4f9f-8eec-d3d5c42d9e61

Get Database Table Columns Function
This PowerShell V2 script function will allow you to list your SQL Server table columns for the specified database.
http://gallery.technet.microsoft.com/21c90399-d408-428d-92a5-902e037fdd9b

Get dbTableRecordCount Function
Here’s a function script help get the total record counts of the table in a database using PowerShell
http://gallery.technet.microsoft.com/c606e406-af61-4552-b686-2c9dc17ab06e

Get SQL Error Log Path
This function uses SQL SMO to retrieve the path to the SQL Error Log. By default it retrieves the path for the default instance of SQL on the local machine, but it does expose parameters to allow for other machines and other instances.
http://gallery.technet.microsoft.com/4c24a1c7-6a73-4536-885c-5d2475dc6b66

Get SQL Server Version Function
Another way to get your SQL Server version(s)
http://gallery.technet.microsoft.com/5f763a6e-23bf-46be-a837-13e5005acb72

Get-DatabaseSizes

http://gallery.technet.microsoft.com/da2de04e-4f3d-4a84-8e2a-7950b562cb84

Get-SQLFileSize
This function will allow you to query any server hosting SQL and return the file sizes for the each Database file(MDF) and Transaction Log file(LDF). This does not return back the file locations for each database.
http://gallery.technet.microsoft.com/511a7b5a-245d-4cad-9cc6-377bf03503e0

HTML DB Documentor & Script Generator
This script generates HTML documentation or Scripts for all the accessible DBs in a SQL instance.
http://gallery.technet.microsoft.com/f29cd777-88bb-4793-96ea-6b5ad568dcb0

Invoke-Sqlcmd2
Modeled after SQL Server 2008 Invoke-Sqlcmd, but fixes bug in QueryTimeout.
http://gallery.technet.microsoft.com/7985b7ef-ed89-4dfd-b02a-433cc4e30894

List all objects of a SSAS database with time stamps
List all objects of a SSAS database with last processing and update time stamp.
http://gallery.technet.microsoft.com/a8afb83c-31b0-4612-b6d0-29b2bb3a5d30

List backups information for all servers and databases
This script allow you to return all backup information to each database in all servers.
http://gallery.technet.microsoft.com/c4b497d0-aa8e-4e5f-9a36-9e74baaaf834

List Member of Sql Server AD Group Logins

http://gallery.technet.microsoft.com/List-Member-of-Sql-Server-58ff31c6

List Sql Server Related Processes (Remote)
This PoSh script queries process data with WMI provider from (remote) machines from a given list of machines for SQL Server related processes to give a quick overview of the utilization. It returns detail for memory and CPU usage in absolute and relative values.
http://gallery.technet.microsoft.com/List-Sql-Server-Related-8765e49b

List state information's of Merge Replication Agents.
Powershell script to lists state information's of SQL Server Merge Replication Agents.
http://gallery.technet.microsoft.com/1853e1bc-8132-4d31-a68b-ceef65fdf034

Lists Databases on a SQL Server Computer

http://gallery.technet.microsoft.com/bcd19b6e-fb6f-4dc1-a097-d589f343e22f

Monitoring AlwaysOn Availability Group Health
This script demonstrates how to evaluate the health of an AlwaysOn Availability Group hosted on a SQL Server 2012 instance.
http://gallery.technet.microsoft.com/AlwaysOn-Availability-23bc88b5

Out-DataTable
Creates a DataTable for an object, based on script by Marc van Orsouw
http://gallery.technet.microsoft.com/4208a159-a52e-4b99-83d4-8048468d29dd

Perform ExecuteNonQuery Against SQL Database
This is a script that performs an ExecuteNonQuery commands against a SQL database. This script has a modular function that performs the commands necessary to establish, open, close and execute the database connection and commands. To perform queries, simply pass the connection st
http://gallery.technet.microsoft.com/Perform-ExecuteNonQuery-a05eb40a

PS get ODBC connectors list

http://gallery.technet.microsoft.com/PS-get-ODBC-connectors-list-f68a753e

Query Notification for Monitoring Data Changes
Sometimes it is of interest to get notify about data changes, e.g. if a new sales order is entered or some main data was modified. With this Powershell script you can monitor data changes in a single table, like inserts, updates and deletes.
http://gallery.technet.microsoft.com/Query-Notification-for-95207f32

Quick Data Wipe Via Truncate

http://gallery.technet.microsoft.com/Quick-Data-Wipe-Via-4c74fca2

Resize the TempDB database using PowerShell
A basic function that uses WMI to detect the number of processes and the amount of system memory to determine how many TempDB data files to create on a SQL instance.
http://gallery.technet.microsoft.com/0c83a4ed-709d-416e-afcf-d160c18ef0fc

Retrieve Status of SQL Server Jobs

http://gallery.technet.microsoft.com/d629c567-315e-4111-85e0-94bdd341dcc6

Return All Linked Servers Information and Connectivity
This function returns all linked servers information and make a connectivity teste to them
http://gallery.technet.microsoft.com/953f74a7-cc95-417a-a38f-778d41404df0

Return SQL SERVER Logins Information
This function returns information about SQL SERVER LOGINS
http://gallery.technet.microsoft.com/bedb9edf-9ef2-40da-87f8-a50099a67ead

RSScripter Script Updater
This powershell script undertakes finding and replacing certain values in your RSScripter generated script files based on tokens.txt to help improve your migration times.
http://gallery.technet.microsoft.com/RSScripter-Script-Updater-b6e3fc51

Show Data and Log File Space Usage

http://gallery.technet.microsoft.com/99d8e7c7-980a-4da1-bac6-d790240fb2d4

smoIndexScripts.ps1
Connects to the specified SQL Server and lists the specified DB's indexes as a T-SQL CREATE INDEX or ADD CONSTRAINT statement to the powershell console & a .txt file
http://gallery.technet.microsoft.com/044be6f6-ebee-4071-9eb4-37287d1843a7

SQL 2008 database rename
tiny changes makes this work in SQL server 2005
http://gallery.technet.microsoft.com/5620b0ab-9c7e-4512-bd52-ad1c19d2a465

SQL Log Backup
This is a simple log backup which should be used with my Async Backup
http://gallery.technet.microsoft.com/c98ba4f6-2b30-41d4-bcb9-0e17ca6239cf

SQL Query with user defined table formatted output
PowerShell script running a simple SQL Query with user defined table formatted output.
http://gallery.technet.microsoft.com/14a02652-fb60-4738-93f0-439f1628f587

SQL Server Alias Configuration on Remote Machines
With this PowerShell script you can read, edit or delete SQL Server Alias configuration on several remote machines in a batch.
http://gallery.technet.microsoft.com/SQL-Server-Alias-4612b066

SSAS Dimension Process Update

http://gallery.technet.microsoft.com/SSAS-Dimension-Process-e9c1356d

SSAS Discover Current Processes
This Powershell queries the SSAS DMV for current connections, session and commands and prompts the results as a formatted list to give a quick overview of activities. Additional it returns an overview with cummulated values like count of session, total send bytes and so on.
http://gallery.technet.microsoft.com/SAS-Discover-Current-db6ad470

SSRS 2008/R2 Password Update Script for Reports, Datasources and Subscriptions
Powershell tool that can be used to determine credential usage on a SSRS server, or update all the embedded credentials (Reports, Datasources, Subscriptions).
http://gallery.technet.microsoft.com/80d6ae2f-1968-43f0-b2f6-bebe89ecd3be

SSRS Wake-Up Call
After a timespan of idle SSRS falls asleep;the first request will be extremly slow,up to several minutes.This PowerShell script performs a simple HTTP request to the SSRS-RM url,to simulate a normal activity.If you run it frequently you avoid the SSRS worker shutdown.
http://gallery.technet.microsoft.com/SSRS-Wake-Up-Call-b2026b2c

Striped Backup of Sql Server Databases
This PoSh script performs a striped backup for all databases from given list spread over all predefined folders.Additional it creates restore T-SQL scripts for easily restoring it.You could run this script with a SQL Server-Agent job to maintaine yor backups frequently.
http://gallery.technet.microsoft.com/Striped-Backup-of-Sql-0b20f712

Write-DataTable
Writes data only to SQL Server tables.
http://gallery.technet.microsoft.com/2fdeaf8d-b164-411c-9483-99413d6053ae