I’ve got a few sites where I’ve got PowerShell scripts scheduled to run on a regular basis. These have all been new things I’ve setup in the last week. Imagine my surprise when I find that the scripts are “still running” despite the fact they have done their job. It turns out that the commands you use to run a PowerShell script automatically can leave the … [Read more...]
Powershell gives “File cannot be loaded because the execution of scripts is disabled on this system”
You will get this on a server as standard error if you are trying to run scripts that you’ve created yourself. To get around the issue, you need to change the execution policy on the server to allow you to run unsigned scripts. Use the command below to do this. Set-ExecutionPolicy Unrestricted … [Read more...]
Useful Powershell commands for Exchange
Here’s a few useful commands I regularly use in Powershell for Exchange management. How can I list all users mailboxes on a given server? Get-Mailbox –servername SERVER1 How can I list a users mailbox size? Get-MailboxStatistics –identity “Wayne Small – SBSfaq.com” | select TotalItemSize How can I list all users mailbox size on a given server? This is a … [Read more...]
PowerShell Tip #3 – Filtering Output
When you issue PowerShell commands you can get quite a bit of information back from it. Last weeks tip showed how to format the output and to do a very basic filter to show specific columns only. Today we’ll be a little more specific. Lets say that I wanted to list all the processes on a computer where the Process Name begins with svc* – this is how I would … [Read more...]
PowerShell Tip #2 – Formatting Output
Whilst PowerShell is really cool, you can also get way too much information in response to commands. I was onsite recently and working on an issue where I needed to compare the output of a few servers with specific parameters. The best way to do that is to document the configuration settings for the few key parameters you want to compare and then check for the … [Read more...]