NOTE: This content has been updated and expanded in a whitepaper: 7 Reasons Your SQL Server Service Won't Start, by Pinal Dave ---------- If you are...
database-tools
How to find Commands that have the Specified Parameter
Get-Command is your primary tool when you need to find a command to accomplish something. You can search for verbs and/or nouns like this: # find...
Get CPU Cores and Processor Information
WMI can find out details about your CPUs in just one line: PS> Get-WmiObject -Class Win32_Processor | Select-Object -Property Name, Number* Name...
Installing Windows Features
On servers, PowerShell can install Windows features with the cmdlet Install-WindowsFeature. When you save the result emitted by...
Create Dynamic Script Blocks
Script blocks are pieces of executable PowerShell code. You typically create them by enclosing code in braces. To dynamically create script blocks...
T-SQL Tuesday #67: Introduction to Idera SQL XEvent Profiler
This month’s #tsql2sday is hosted by the delightful Jes Borland over at Less Than Dot, on the topic of XEvents. When I saw this come up on...
Manage NTFS Permission Inheritance
By default, folders and files inherit permissions from their parents. To stop inheritance and make sure only the explicitly assigned permissions are...
Removing Explicit NTFS Permissions
In previous examples, we showed you how you can add new NTFS permissions to an existing folder. If you want to reset permissions and make sure all...
Getting Explicit NTFS Permissions
To find out which NTFS access permissions have been assigned directly to a file or folder, check for the property "isInherited". This will...
Managing NTFS Permissions
In a previous tip we showed how you can add NTFS permission rules to a folder. To find out what kind of permissions are assignable, take a look at...
Create Folder with NTFS Permissions
Often, you may need to create a new folder and also set NTFS permissions for the folder. Here is a simple example that creates a new folder and...
Identifying the cause of tempdb autogrowth using SQL Diagnostic Manager
Autogrowth in your tempdb database may not seem like such a bad thing, but it can cause quite a headache if it’s uncontrolled. Unplanned...
Splitting Long Lines
To improve readability, you can break PowerShell lines into separate lines. Get-Service | Where-Object { $_.Status -eq 'Running' }...
Object Filtering in DBArtisan and Rapid SQL – DBA and Developer Skill Sprint
In this Skill Sprint video from the DBA and Developer Skill Sprint series we look at object filtering in DBArtisan and Rapid SQL; Learn more about...
Prompting for Function Parameters
With a simple trick, you can add a dialog window that helps users to provide the function parameters for your function. Simply use...
Using PowerShell’s Help Window for General Output
To display text information, you can of course launch notepad.exe, and use the editor to display the text. Displaying text in an editor is not such...
Playing Sound in the Background
If your script takes some time to complete, you may want to play a system sound file. Here is a sample illustrating how this can be done: # find...
DDL Invalid – Missing event types in Compliance Manager
If you are auditing a SQL server that is running extended event traces, you may be seeing events come through in SQL Compliance Manager of category...
Finding Executable
Many file extensions are associated with executables. You can then use Invoke-Item to open a document with this executable. Finding out just which...
Data Breaches: A Shift from Pure Prevention to Monitoring and Collaboration
It’s every Database Administrator’s nightmare to see your company’s name in the headlines in connection with a high profile data breach. Breaches...
ISQL Editor in DBArtisan and Rapid SQL – DBA and Developer Skill Sprints
In this skill sprint we cover ISQL editor features in DBArtisan and Rapid SQL. Learn about the options available in the ISQL window for different...
Splitting Text at Uppercase Letters
To split a text at each uppercase letter, without having to provide a list of uppercase characters, try this example: $text =...
Finding Uppercase Characters
If you'd like to find uppercase characters, you could use regular expressions. However, you would then provide a list of uppercase characters to...
Using Green Checkmarks in Console Output
In a previous tip you have seen that the PowerShell console supports all characters available in a TrueType font. You just need to convert the...