SQL Server PowerShell Tips

Solve your SQL Server PowerShell issues with these valuable tips, tutorials, how-to's, scripts, and more for SQL Server DBAs.

SubCategoryTitleAuthor
AdministrationComplete Common SQL Server Database Administration Tasks In Parallel with PowerShell V3 WorkFlowJeffrey Yao
AdministrationOne Line PowerShell Solutions To Common SQL Server DBA TasksJeffrey Yao
Analysis ServicesPowerShell for SQL Server Analysis Services MultidimensionalAaron Nelson
Analysis ServicesUsing PowerShell for SQL Server Analysis Services tasks - Part 1Daniel Calbimonte
AuditingGet Total Line Counts for all SQL Server Source Objects Using PowerShellJeffrey Yao
BackupsBackup SQL Server Databases in Parallel with PowerShellPablo Echeverria
BackupsBackup SQL Server Databases with a Windows PowerShell ScriptEdwin Sarmiento
BackupsCheck the Last SQL Server Backup Date using Windows PowerShellEdwin Sarmiento
BackupsPowerShell changes for database backups in SQL Server 2012Shawn Melton
BackupsRetrieve Default SQL Server Backup Folder using PowerShellEdwin Sarmiento
BackupsSQL Server Backup Testing and VerificationAlejandro Cobar
BackupsUsing PowerShell for SQL Server Database BackupsShawn Melton
BackupsUsing PowerShell for SQL Server Transaction Log BackupsShawn Melton
CalculationsPowerShell and Object-Level Math FunctionsTim Smith
ComparisonInvoke Nz Powershell script similar to Nz VBA functionChad Boyd
ComparisonUsing PowerShell to Check or Compare ValuesTim Smith
ConfigurationEnable PowerShell on Windows Server 2008 R2 Core EditionManvendra Singh
ConfigurationEnable Powershell Remoting on SQL Server InstancesManvendra Singh
ConfigurationHow to Modify the Global DNS Configuration on Servers Using PowerShellDaniel Farina
ConfigurationReading Text Files With PowerShell For Configurations Part ITim Smith
ConfigurationSetting the PowerShell Execution PolicyJugal Shah
ConnectionsPowerShell and ADO.NET Connection String Settings for SQL ServerTim Smith
ConnectivitySQL Server Database Connectivity Testing Using PowerShellJohn Grover
DataConsider New Ideas for SQL Server Data AnalysisTim Smith
DataGetting the Count of Non-Null Values in a SQL Server Table with PowerShellTim Smith
DataPowerShell Invoke-SQLCmd outputs DataTables you can INSERT into SQL ServerAaron Nelson
DataPre-validating Data in Delimited Files with PowerShell Prior to Importing to SQL ServerTim Smith
Data MiningVideo on Text Mining SQL Server Data Using PowerShellTim Smith
DatabaseCreate SQL Server Database with PowerShellJoe Gavin
Database ConfigurationsGenerating SQL Scripts using Windows PowerShellEdwin Sarmiento
Database ConfigurationsRetrieve a List of SQL Server Databases and their Properties using PowerShellEdwin Sarmiento
Date RangeLimit Time Ranges In PowerShell for CalculationsTim Smith
DBCC CHECKDBCheck SQL Server Database Consistency and Backups Without Impacting PerformanceRichard Vantrease
DeletePowerShell Script to Delete All Data in a SQL Server DatabaseJeffrey Yao
DeploymentDeploy Database Objects to Multiple SQL Server Instances Using PowerShellAlejandro Cobar
DeploymentUse PowerShell to Determine the number DML operations in SQL Server ScriptsTim Smith
DevelopmentDevelop and Debug PowerShell Scripts with MyInvocationTim Smith
DevelopmentIterating through SQL Servers and database objects with PowerShellDiana Moldovan
DevelopmentUsing Nested Switch Statements In PowerShellTim Smith
DynamicUsing PowerShell With Configuration Tables in SQL ServerTim Smith
Error HandlingError handling with try-catch-finally in PowerShell for SQL ServerDiana Moldovan
Error HandlingIntroduction into handling errors in PowerShell for SQL Server tasksDiana Moldovan
Error HandlingOptions For Reporting Errors In Catch Statements Using PowerShellTim Smith
Error HandlingTry Catch Finally with PowerShellChad Boyd
Error HandlingUsing PowerShell to access event logs for SQL ServerManvendra Singh
ExportCreate File with Content Using PowerShellTim Smith
FeaturesNew Features and Best Practices of SQL Server PowerShellAaron Nelson
File System6 Useful PowerShell Scripts to Help SQL Server DBAs and DevelopersTim Smith
File SystemGetting Started with PowerShell File Properties and MethodsTim Smith
File SystemParsing all the files in a directory using PowerShellK. Brian Kelley
File SystemPowerShell Module to Read Directory Contents and Store in a SQL Server TableNisarg Upadhyay
File SystemPowerShell script to find files that are consuming the most disk spaceJugal Shah
File SystemPowerShell Scripts for Obtaining File MetadataTim Smith
File SystemRename and Move a File with PowerShell in a SQL Server Agent Job Tim Smith
File SystemSQL Server Video to Rename and Move a File using PowerShellTim Smith
File SystemUsing a PowerShell Script to delete old files for SQL ServerJugal Shah
File SystemUsing PowerShell to Encode FilesTim Smith
File SystemUsing PowerShell to Work with Directories and FilesJohn Miner
File SystemVideo of 6 Useful PowerShell Scripts to Help SQL Server DBAs and Developers Tim Smith
Foreign KeysDrop and Re-Create All Foreign Key Constraints in a SQL Server database using PowerShellJohan Bijnens
Free SpaceFind Drives with Low Disk Space for all SQL Server Instances using PowerShellPablo Echeverria
Free SpaceMonitor SQL Server Disk Space Using PowerShellRichard Vantrease
FunctionsVerify File Exists Using PowerShellTim Smith
Import and ExportExtract and convert all Excel worksheets into CSV files using PowerShellTim Smith
Import and ExportExtracting API Data Using PowerShell and Loading into SQL ServerTim Smith
Import and ExportSQL Server Video Automating Flat File Imports using PowerShell Tim Smith
Import and ExportSQL Server Video to Extract All Excel Worksheets into individual CSV filesTim Smith
Import and ExportSQL Server Video Validate File Properties Prior to Importing DataTim Smith
Integration ServicesExecute SSIS Package from Catalog with PowerShell - Part 2Koen Verbeeck
Integration ServicesExecute SSIS Package from PowerShell - Part 1Koen Verbeeck
Integration ServicesExecute SSIS Package in Cloud and Package Deployment Model with PowerShell - Part 3Koen Verbeeck
LoginsAdd, Remove, and Get SQL Logins, New SQL PowerShell 2016 cmdletsAaron Nelson
MonitoringFind current running SQL Server queries with a PowerShell scriptEli Leiba
MonitoringMonitor a SQL Server Cluster using PowerShellBen Snaidero
OracleBulk Copy Data from Oracle to SQL ServerJeffrey Yao
OverviewIntroducing PowerShell V2 Remoting for SQL ServerDiana Moldovan
OverviewIntroduction to Windows PowerShell for the SQL Server DBA Part 1Edwin Sarmiento
OverviewIntroduction to Windows PowerShell for the SQL Server DBA Part 2Edwin Sarmiento
OverviewPowerShell changes and new cmdlets for SQL Server 2016Rajendra Gupta
OverviewPowerShell Support in SQL Server 2008 with the Invoke Sqlcmd CmdletRay Barley
OverviewUsing PowerShell with SQL Server Management Objects (SMO)Edwin Sarmiento
PerformanceImprove PowerShell SMO Performance for SQL ServerDiana Moldovan
PermissionsUpdate SQL Server Agent Job owner and Database owner with PowerShellTim Smith
ProcessesHandling Windows Processes using Windows PowerShell for SQL ServerManvendra Singh
RestorePowerShell to automate multiple database SQL Server restores to refresh environmentsJeffrey Yao
RestoreRestore-SqlDb Automate a SQL Server Database Restore improved with PowershellChad Boyd
Scheduling4 Convenient Ways To Run PowerShell ScriptsTim Smith
SchedulingScheduling a SQL Server PowerShell script using the Task SchedulerDiana Moldovan
ScriptsExecuting scripts on multiple servers by SQL Server version and edition using PowerShellTim Smith
ScriptsGenerate T-SQL Scripts for all SQL Server Databases and all Objects using PowerShellAngel Gomez
ScriptsHow to Query Arrays, Hash Tables and Strings with PowerShellTim Smith
ScriptsPowerShell and Hash Table ExamplesTim Smith
ScriptsPowerShell Script to Parse HTML Code with SQL Server Build NumbersAlejandro Cobar
ScriptsUsing PowerShell to export Active Directory informationDouglas Correa
SecurityConnect to SQL Server via Windows PowerShell with SQL Server authenticationEdwin Sarmiento
ServersFind SQL Server Instances Across Your Network Using Windows PowerShellEdwin Sarmiento
ServersUsing PowerShell to Pull SQL Server Services Configuration InformationShawn Melton
ServicesControlling Windows and SQL Server Services using Windows PowerShellManvendra Singh
SQL Server AgentChecking SQL Server Agent jobs using Windows PowerShellEdwin Sarmiento
SQL Server AgentDisable or Enable SQL Server Agent Jobs using PowerShellEdwin Sarmiento
SQL Server AgentModifying SQL Server Agent Settings Using PowerShellJohan Bijnens
SQL Server AgentSQL Server 2016 PowerShell cmdlets for SQL AgentRajendra Gupta
SQL Server AgentSQL Server Agent Error Logging for Powershell Job StepsDiana Moldovan
StorageDrive inventory for clustered SQL Server instances using PowerShellJohan Bijnens
Stored ProceduresCall SQL Server Stored Procedures with PowerShell using Parameter ObjectsTim Smith
Stored ProceduresExecute SQL Server Stored Procedures from PowerShellTim Smith
StringsHow to find a specific text string in a SQL Server Stored Procedure, Function, View or TriggerJeffrey Yao
StringsParsing Strings From Delimiters In PowerShellTim Smith
StringsPowerShell and T-SQL Regular Expression Examples for SQL ServerTim Smith
StringsPowerShell Regular Expression (RegEx) Video Examples for SQL Server Tim Smith
StringsRemoving HTML tags from text data using PowerShellDiana Moldovan
TablesNew PowerShell cmdlets to read and write SQL Server tablesRajendra Gupta
Text FilesProcessing text files with PowerShellJohn Miner
Transaction LogsCheck SQL Server Virtual Log Files Using PowerShellEdwin Sarmiento
Transaction LogsDetermine Minimum Possible Size to Shrink the SQL Server Transaction Log FileEdwin Sarmiento
Transaction LogsUsing PowerShell To Record SQL Server Virtual Log File (VLF) GrowthTim Smith
TroubleshootingDebugging PowerShell ScriptsTim Smith
TutorialsPowerShell Commands for SQL Server Getting StartedAlejandro Cobar
TutorialsPowerShell for the DBA - Basic FunctionsAlejandro Cobar
TutorialsPowerShell for the DBA - CMDLETs and Advanced FunctionsAlejandro Cobar
TutorialsPowerShell for the DBA - If Else and Switch statementsAlejandro Cobar
TutorialsPowerShell for the DBA FOR and WHILE LoopsAlejandro Cobar
TutorialsPowerShell for the SQL Server DBA - Variable FundamentalsAlejandro Cobar
TutorialsPowerShell for the SQL Server DBA Environment SetupAlejandro Cobar
VariablesPowerShell Parameters Part II - ValidateSet and ValidatePatternTim Smith
VariablesValidating PowerShell Parameters - Part ITim Smith
ViewDetect and rename invalid VIEWs in a SQL Server database using PowerShellJohan Bijnens
No Records Found
CategoryGroupCategory (articles)
Analysis ServicesAnalysis Services Administration (31)
Analysis ServicesAnalysis Services Development (95)
Analysis ServicesAnalysis Services Dimensions (16)
Analysis ServicesAnalysis Services Measure Groups (7)
Analysis ServicesAnalysis Services Performance (14)
Analysis ServicesAnalysis Services Security (7)
Analysis ServicesAnalysis Services Tools (1)
Analysis ServicesAnalysis Services Tutorials (6)
Analysis ServicesCortana (5)
Analysis ServicesPerformance Point (4)
Business IntelligenceBig Data (23)
Business IntelligenceData Warehousing (4)
CloudAmazon AWS (45)
CloudApache Spark (3)
CloudAzure (187)
CloudAzure Backup and Restore (25)
CloudAzure Cosmos DB (11)
CloudAzure Data Factory (68)
CloudAzure Databricks (23)
CloudAzure Integration Services (14)
CloudAzure Synapse Analytics (33)
Data QualityData Quality Services (7)
Data QualityMaster Data Services (41)
Database AdministrationAvailability Groups (73)
Database AdministrationBackup (78)
Database AdministrationCentral Management Servers (9)
Database AdministrationClustering (73)
Database AdministrationComparison Data and Objects (14)
Database AdministrationCompression (21)
Database AdministrationContained Databases (4)
Database AdministrationContainers (12)
Database AdministrationDatabase Administration (188)
Database AdministrationDatabase Configurations (17)
Database AdministrationDatabase Console Commands DBCCs (25)
Database AdministrationDatabase Mail (18)
Database AdministrationDatabase Mirroring (33)
Database AdministrationDBA Best Practices (39)
Database AdministrationDedicated Administrator Connection (4)
Database AdministrationDeprecated Features (5)
Database AdministrationDevOps (34)
Database AdministrationDisaster Recovery (23)
Database AdministrationError Logs (10)
Database AdministrationExpress Edition (16)
Database AdministrationExtended Events (22)
Database AdministrationFILESTREAM (9)
Database AdministrationFragmentation and Index Maintenance (27)
Database AdministrationHardware (13)
Database AdministrationHigh Availability (3)
Database AdministrationIndexing (82)
Database AdministrationInstall and Uninstall (32)
Database AdministrationLicensing (4)
Database AdministrationLinked Servers (18)
Database AdministrationLocking and Blocking (38)
Database AdministrationLog Shipping (18)
Database AdministrationMaintenance (34)
Database AdministrationMonitoring (115)
Database AdministrationOther Database Platforms (67)
Database AdministrationPartitioning (14)
Database AdministrationPerformance Data Warehouse (4)
Database AdministrationPerformance Tuning (121)
Database AdministrationPolicy Based Management (29)
Database AdministrationPowerShell (127)
Database AdministrationProfiler and Trace (20)
Database AdministrationQuery Store (7)
Database AdministrationRecovery Models (4)
Database AdministrationReplication (75)
Database AdministrationResource Governor (5)
Database AdministrationRestore (40)
Database AdministrationSQL Server 2016 (100)
Database AdministrationSQL Server 2017 (44)
Database AdministrationSQL Server 2019 (19)
Database AdministrationSQL Server 2022 (3)
Database AdministrationSQL Server Configurations (75)
Database AdministrationSQL Server on Linux (76)
Database AdministrationStreamInsight (2)
Database AdministrationSystem Databases (31)
Database AdministrationUpgrades and Migrations (54)
Database AdministrationVirtualization (25)
Database AdministrationWindows Internal Database (1)
Database DevelopmentApplication Development (36)
Database DevelopmentChange Data Capture (14)
Database DevelopmentCommon Runtime Language (12)
Database DevelopmentCommon Table Expressions (3)
Database DevelopmentConstraints (20)
Database DevelopmentData Cleansing for Validation (2)
Database DevelopmentData Science (3)
Database DevelopmentData Types (17)
Database DevelopmentDatabase Design (68)
Database DevelopmentDates (47)
Database DevelopmentDebugging (4)
Database DevelopmentDynamic Management Views and Functions (33)
Database DevelopmentDynamic SQL (7)
Database DevelopmentEntity Framework (13)
Database DevelopmentError Handling (8)
Database DevelopmentFull Text Search (20)
Database DevelopmentFunctions System (65)
Database DevelopmentFunctions User Defined UDF (40)
Database DevelopmentIdentities (17)
Database DevelopmentImport and Export (74)
Database DevelopmentIn Memory OLTP (32)
Database DevelopmentJOIN Tables (21)
Database DevelopmentLanguage Integrated Query LINQ (7)
Database DevelopmentMicrosoft Access Integration (8)
Database DevelopmentMicrosoft Excel Integration (39)
Database DevelopmentMicrosoft Flow (1)
Database DevelopmentPaging (5)
Database DevelopmentPython (36)
Database DevelopmentQuery Optimization (14)
Database DevelopmentQuery Plans (20)
Database DevelopmentR Language (11)
Database DevelopmentScripts (35)
Database DevelopmentService Broker (11)
Database DevelopmentSpatial Data Storage (9)
Database DevelopmentSQL Injection (5)
Database DevelopmentSQL Server Management Objects SMO (3)
Database DevelopmentStored Procedures (27)
Database DevelopmentSynonyms (4)
Database DevelopmentTable Valued Parameters (4)
Database DevelopmentTemp Tables (9)
Database DevelopmentTemporal Tables (13)
Database DevelopmentTesting (31)
Database DevelopmentTransactions (8)
Database DevelopmentTriggers (44)
Database DevelopmentTSQL (296)
Database DevelopmentUser Defined Type UDT (3)
Database DevelopmentViews (13)
Database DevelopmentXML (14)
Integration ServicesData Transformation Services (5)
Integration ServicesIntegration Services Administration (10)
Integration ServicesIntegration Services Analysis Services Tasks (5)
Integration ServicesIntegration Services Best Practices (10)
Integration ServicesIntegration Services Configuration Options (21)
Integration ServicesIntegration Services Connection Managers (5)
Integration ServicesIntegration Services Control Flow Transformations (14)
Integration ServicesIntegration Services Data Flow Transformations (19)
Integration ServicesIntegration Services Development (106)
Integration ServicesIntegration Services Email (3)
Integration ServicesIntegration Services Error Handling (8)
Integration ServicesIntegration Services Excel (14)
Integration ServicesIntegration Services Execute Package Options (8)
Integration ServicesIntegration Services Import and Export Wizard (2)
Integration ServicesIntegration Services NULL Management (4)
Integration ServicesIntegration Services Oracle (4)
Integration ServicesIntegration Services Performance (12)
Integration ServicesIntegration Services Security (7)
Integration ServicesIntegration Services Upgrade (4)
Power PlatformPower Apps (17)
Power PlatformPower BI (128)
Power PlatformPower BI Charts (44)
Power PlatformPower BI Formatting (12)
Professional DevelopmentProfessional Development Books (3)
Professional DevelopmentProfessional Development Branding (13)
Professional DevelopmentProfessional Development Career (17)
Professional DevelopmentProfessional Development Career Planning (16)
Professional DevelopmentProfessional Development Career Transition (4)
Professional DevelopmentProfessional Development Certifications (47)
Professional DevelopmentProfessional Development Community (16)
Professional DevelopmentProfessional Development Conferences (2)
Professional DevelopmentProfessional Development Interview Questions BI (15)
Professional DevelopmentProfessional Development Interview Questions DBA (22)
Professional DevelopmentProfessional Development Interview Questions Developer (6)
Professional DevelopmentProfessional Development Interviewing (38)
Professional DevelopmentProfessional Development Job Search (17)
Professional DevelopmentProfessional Development Management (9)
Professional DevelopmentProfessional Development Recruiters (6)
Professional DevelopmentProfessional Development Resume (13)
Professional DevelopmentProfessional Development Skills Development (18)
Reporting ServicesReporting Services Administration (19)
Reporting ServicesReporting Services Analysis Services (4)
Reporting ServicesReporting Services Best Practices (6)
Reporting ServicesReporting Services Charts (25)
Reporting ServicesReporting Services Configuration (10)
Reporting ServicesReporting Services Custom Report (2)
Reporting ServicesReporting Services Dashboard (1)
Reporting ServicesReporting Services Data Sources (10)
Reporting ServicesReporting Services Development (37)
Reporting ServicesReporting Services Drill Through (4)
Reporting ServicesReporting Services Dynamic Reports (11)
Reporting ServicesReporting Services Filtering (3)
Reporting ServicesReporting Services Formatting (26)
Reporting ServicesReporting Services Functions (5)
Reporting ServicesReporting Services Images (2)
Reporting ServicesReporting Services Installation (9)
Reporting ServicesReporting Services KPI (5)
Reporting ServicesReporting Services Maps (4)
Reporting ServicesReporting Services Migration (5)
Reporting ServicesReporting Services Monitoring (5)
Reporting ServicesReporting Services Network Load Balancing (4)
Reporting ServicesReporting Services Overview (5)
Reporting ServicesReporting Services Parameters (15)
Reporting ServicesReporting Services Performance (6)
Reporting ServicesReporting Services Report Builder (9)
Reporting ServicesReporting Services Report Models (1)
Reporting ServicesReporting Services Security (8)
Reporting ServicesReporting Services SharePoint (1)
Reporting ServicesReporting Services Subreports (4)
Reporting ServicesReporting Services Tutorials (1)
SecurityAuditing and Compliance (45)
SecurityEncryption (28)
SecuritySecurity (194)
SecuritySurface Area Configuration Manager (4)
SharePointSharePoint (130)
SharePointSharePoint Administration (46)
SharePointSharePoint Configuration (27)
SharePointSharepoint Design (46)
SharePointSharePoint Document Management (20)
ToolsAzure Data Studio (10)
ToolsSQL Operations Studio (11)
ToolsSQL Server Agent (92)
ToolsSQL Server Management Studio (74)
ToolsSQL Server Management Studio Configuration (22)
ToolsSQL Server Management Studio Shortcuts (9)
ToolsTools (31)