Follow sqlserver-dba.com

Subscribe to RSS feed  Follow @jackvamvas - Twitter

*Use the Comments section for questions

SQLServer-DBA.com Links

Dba_db2_button

dba-ninja.com

SQL Server DBA Jobs

Powershell Script Library for DBA

25 July,2012 by Tom Collins

These are powerful Windows Powershell  scripts available for DBAs to help you build a strong foundation in Powershell  and managing  Database Servers

I use Powershell programming language  in managing SQL Server and other DBMS systems

I’ll keep adding more Powershell scripts to this post. 

Last Updated  6th May 2022

How to get members of BUILTIN\ADMINISTRATORS with Powershell

How to check SSL encryption is enabled on SQL Server with Powershell

How to get last logon of user on Domain Controllers using Powershell

 Get free disk space for mount points using Powershell

 How to get disk capacity from remote server using Powershell Get-PSDrive

 Find Recycle Bin location and clear down with Powershell

How to secure Powershell

 How to extract Active Directory users with Get-ADGroup and Get-ADGroupMember

How to find Active Directory groups with Get-ADGroup search filter

How to get all Domain Controllers in Active Directory Forest with Powershell

How to find Active Directory users with Get-ADUser search filter

How to successfully separate email in Powershell

How to add SSMS to the PATH variable with Powershell

 How to master Mount-Diskimage in Powershell

 How to check if Puppet is reboots a windows server with Powershell

How to get ODBC drivers using Powershell

How to list computer shares with Powershell and WMI

How to fix Exception caused by space in text for Powershell form

How to make a Powershell textbox read only

How to force a powershell copy-item file copy

How to get powershell System.Data.DataTable row count

 How to use the SQL Assessment API through Powershell

How to specify encoding when creating Powershell text file using Out-file

How to get the Active Directory groups membership for user with Powershell

How to list Windows users with Powershell

How to view all Powershell commands on a server

Powershell script - Get the total table count of all databases in multiple SQL Server Instances

How to get SQL Server database object count using Powershell Measure-Object

Powershell script for unattended install of SQL Server standard patches

Powershell script to find SQL Server Instances on a Server

Powershell script function for disk free

How to enable MSDTC XA transactions with Powershell

Powershell Script - Backup SQL databases to a remote drive

How create a drive to a network share with Powershell New-PSDrive

How to get DOMAIN login name with Powershell Get-ADGroupMember

Disaster Recovery Powershell Script to check for failed Windows services

How to add a row in Powershell System.Data.Datatable

Post disaster recovery SQL Server database checkout script

How to Check Powershell version

Powershell find command and copy a file

Windows folder permissions with Powershell Get-ACL

Powershell monitor log file for string with select-string and regex

Powershell script to check disk space on remote servers

Powershell append to file by joining two files

Powershell script to report SQL Error Log

How to get FQDN of multiple servers with Powershell 

SQL Server restart times using Powershell

Powershell script - Get the SQL Server Instance status with Get-Service

Get Last Windows boot up time with Powershell

Powershell script – Function to return server disk capacity

Powershell script: Powershell equivalent of Linux top

Powershell Script – How to get windows logs events with Get-WinEvent for a date range

Powershell Add-Content – How to add another query result to an existing html report

Powershell Script – How to export Excel worksheet columns into a html file

Powershell script to report SQL Database Status

Shredding XML with Powershell and SQL Server

List all NT group logins with Powershell New

Read a script file into Powershell CommandText with get-content New

How to List Task Scheduler Eventlog with messages using Powershell New

How to Export Active Directory Group Members with Powershell Get-ADGroupMember New

Use Powershell Get-Hotfix to get all hotfixes on Windows server New

How to get a list of software installed on a server using Powershell   New

Number of physical processors with Powershell – number of cores 

SQL Database Size report using Powershell 

Powershell write to Word document 

SQL Server - Powershell - Get FQDN – Hostname and IP address 

SQL Server - Working with Windows Services Examples and Powershell

SQL Server – Export Excel data to SQL Server with Powershell 

SQL Server - Search and Delete files from a text based list with Powershell 

SQL Server - Powershell Get-ChildItem with examples 

SQL Server – Find SQL Server tcp port with Powershell 

SQL Server – Daily Health Check Script with Powershell 

SQL Server - List Files in Size Order with Powershell 

SQL Server – Windows Environment Variables and Powershell  

SQL Server - SQL Server Restart with Powershell 

SQL Server – Check SQL Server 2008 Native Client is installed with Powershell get-wmiobject 

Use Powershell import-csv to enumerate list items from a CSVarray   

SQL Server backup review with Powershell

Free disk space on drives using Powershell

Powershell – adding multiple worksheets to Excel spreadsheet

Powershell – setting the Execution Policy

Powershell,PSEexec and lock pages in memory – made easy

Powershell for SQL SMO

SQL Server Version with Powershell

Powershell - run script on all sql servers

Powershell sql server security audit

Powershell to HTML

Powershell , Excel charts and data presentation

SQL Server – Powershell Excel to HTML

SQL Server – Send email using Powershell

List SQL Server Instances using Powershell and Get-ItemProperty

List failed SQL server Jobs with Powershell

Send email from Powershell with attachment

Powershell default start directory

SQL Server – Powershell Active Directory search

Powershell Get-EventLog and Event Log messages

Export-CSV Powershell

Compare two files with Powershell

How to check Operating System type with Powershell

Compare-Object Powershell to validate a folder copy

Get database details with VIEW ANY DEFINITION and Powershell

How to Convert Microsoft Word Format to HTML using Powershell

Powershell script to compare two file sizes

Powershell List all Patches Updates on a Server

How to use Powershell string functions

List SQL Server Instances with Powershell remote registry search

SQL Server – Powershell Get-Location

Powershell and Batch files

Powershell_BAK_files

Powershell_ErrorLogs

Powershell - List Failed SQL Server Jobs

Contact me for any Powershell scripts

Copyright c 2020– Jack Vamvas. All rights reserved. No

part of these scripts may be reproduced, translated, posted or shared in any

form, by any means.

The information provided in this post is provided "as is" with no implied

warranties or guarantees.


Author: Tom Collins (http://www.sqlserver-dba.com)


Share:

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment on Powershell Script Library for DBA


sqlserver-dba.com | SQL Server Performance Tuning | SQL Server DBA:Everything | FAQ | Contact|Copyright & Disclaimer