Announcing the General Availability of IDERA SQL Compliance Manager 7.0
Categories
- Free tools
- SQL Admin Toolset
- SQL Compliance Manager
- SQL Defrag Manager
- SQL Diagnostic Manager for MySQL
- SQL Diagnostic Manager for SQL Server
- SQL Diagnostic Manager Pro
- SQL Doctor
- SQL Enterprise Job Manager
- SQL Inventory Manager
- SQL Query Tuner for SQL Server
- SQL Safe Backup
- SQL Secure
- SQL Workload Analysis for SQL Server
- Uptime Infrastructure Monitor Formerly Uptime
Controlling Numeric Range for Variables
In a previous tip we illustrated how in PowerShell 3.0, you can now use validators to restrict the data that can be assigned to a variable. Here is another example. It assigns the data type "Int32" to a variable, so it only accepts numeric values. In...
Mobile Dashboard Plugin Linux
Hi  I’ve recently tried to install the mobile dashboard plugin 1.2 on my rhel 6.3 monitor station running uptime 7.1, and noticed its only compatible with windows, I came across another thread on the forum dated Jan 2013 regarding the same issue, do you have...
Killing All Remote PowerShell Sessions
In a previous tip we explained how you can enumerate who is connected to your machine via PowerShell Remoting, and how you can terminate individual remote shells. If you want to simply kill all remote PowerShell sessions running on your machine, you can restart the...
Killing Remote PowerShell Sessions
To kill a remote PowerShell session that runs on your machine, you could kill the wsmprovhost.exe task associated with it, but identifying the correct process and killing it is not a robust and recommended way. A better way uses this approach: $URI =...
Finding Remote Sessions Connected to Your Machine
Ever wanted to find out who is running a (hidden) remote PowerShell on your machine? Here's a simple one-liner: Get-WSManInstance -ConnectionURI ('http://{0}:5985/wsman' -f $env:computername) `-ResourceURI shell -Enumerate It will return anyone connecting...
Define Variable Checkers
When you assign a mandatory data type to a variable, then this will improve script robustness: whenever a value is (accidentally) assigned to that variable that does not match the expected type, an error is raised. In PowerShell 3.0, this concept can be further...
Make Parameters Mandatory and Optional at the Same Time
An often overlooked feature in PowerShell is the ability to make a function parameter both optional and mandatory - at the same time. Let's for example assume you want a function that has two parameters: ComputerName and Credential. Both should be optional, but if the...
Enabling Visual Styles
When you use Windows Forms dialogs and windows, you may have noticed that they show differently, depending on whether you launched your script from within the ISE editor or from the powershell.exe console. This is because the ISE editor enables visual styles by...
Finding PowerShell Module Requirements
PowerShell modules extend functionality by adding more cmdlets and/or providers. Modules support copy-and-paste deployment ("XCopy-deployment", if you like), so theoretically, you can copy any module from one computer to another and use it there (use...
Using ValidatePattern attribute
PowerShell can validate parameters using regular expressions. This example accepts only computer names that start with "PC" followed by three digits: function Get-PCInfo { param ( [ValidatePattern( '^PC\d{3}$' )] [String] $ComputerName )...
Creating Script Blocks from Strings
Sometimes you may want to create a script block dynamically from a string. This could be necessary to include local variable content, for example. To turn a string into a script block, you cannot cast the string. Instead, use this approach: $folder =...
Analyzing Script Blocks
Script blocks are simply pieces of PowerShell code. You probably use them all the time in scripts and functions. A script block is defined by braces and could be as simple as this: $a = { Get-ChildItem C:\ } Now, the variable $a holds code that can be handed over to...
Creating Simple Custom Dialog
PowerShell can display custom dialogs easily. So if you're not satisfied with the dialog buttons available in a standard MsgBox dialog, simply create your own. Here's the raw code for a very simplistic two-button dialog that appears centered on screen above...
Getting Screen Information
Ever needed to know the current screen resolution or related screen information? Here's an easy way of getting that information: Add-Type -AssemblyName System.Windows.Forms [System.Windows.Forms.Screen]::AllScreens [System.Windows.Forms.Screen]::PrimaryScreen Note...
Disassembling C# Code
Adam Driscoll, another PowerShell MVP, has published a function called Get-MemberBody to PoshCode: http://poshcode.org/4127. In conjunction with the free tool "ILSpy", you now can easily disassemble and look at source codes for .NET functions. After you...
Understanding Profile Scripts
Whenever you want PowerShell to configure or execute code automatically on launch, the code needs to go into one of four profile scripts. They really work pretty much like autoexec.bat for Windows in old days, and execute whenever PowerShell starts. You can find the...
Opening a file with the default program on Windows and Mac
I've been using the windows API call ShellExec for years to pass in the file name of a file I want to launch programatically with the default application on Windows; but I am now creating an application for use on Windows and Mac with FireMonkey for the upcoming...
Test Local User Account Credentials
Here is a snippet that verifies a local user account. Simply submit a username and a password. You get back either $true or $false: $username = 'Administrator' $password = 'P@ssw0rd' $computer = $env:COMPUTERNAME Add-Type -AssemblyName...
Enabling High Performance Power Plan via Command Line
Hopefully, everyone knows by now that the default power plan in Windows 2008+ is “balanced” which can result in your CPUs being throttled down to 67% or even 50% power. This would be equivalent to running at full power with 2/3 or 1/2 as many CPUs. Make no mistake...
Using "Using:" On Remote PowerShell Sessions (Part 2)
In a previous tip we talked about using PowerShell Remoting to execute code on a remote machine, and how to use "using:" to carry over local variables to the remotely executed script. However, this only works in PowerShell 3.0. If you must still use...