Press "Enter" to skip to content

Category: Powershell

Just Enough Administration and Granting Access to SQL Server

Andrew Pruski tries out a tool:

We’ve all been there as DBAs…people requesting access to the servers that we look after to be able to view certain things.

I’ve always got, well, twitchy with giving access to servers tbh…but what if we could completely restrict what users could do via powershell?

Enter Just Enough Administration. With JEA we can grant remote access via powershell sessions to servers and limit what users can do.

Click through to see how it works.

Leave a Comment

How to Disable a SQL Agent Job via Powershell

Tom Collins gets a question:

I have a  SQL Server Agent job  in a disabled status. The disabled status is  applied to the SQL Agent Job and the associated schedule.  The problem is I’m logged on as a full administrator onto the Windows Server – and as BUILTIN\Administrator is defined on the SQL Server , but am able to manually override the SQL Agent Job.   

Is there a way to Disable the SQL Agent Job where I’m not able to manually override the job?

Click through for the answer.

Leave a Comment

Removing Indexes by Name from Multiple SQL Servers

Jana Sattainathan doesn’t have time to click-and-repeat:

This is something I had to do today. In this blog post, I am going to show you how you can disable or remove indexes matching certain name criteria or other condition(s) across multiple servers and databases in various tables. Usually, this is a very painful process if done by hand but with the fantastic work done by the dbatools team, it becomes quite easy.

Read on for the Powershell script.

Comments closed

A WPF-Based Countdown Timer

Jeffrey Hicks keeps track of time:

Last year I released a PowerShell module called PSClock. The module contains a command to create a transparent WPF form displaying a clock. Shortly after, someone posted a request for a countdown timer. Not an unreasonable request and one I finally got around to implementing. However, I already had a module with a number of timer and countdown-related commands called PSTimers I had been thinking of a WPF-based timer, so this solved two problems.

Read on to see how it works.

Comments closed

Thoughts on Publishing a Powershell Module

Shane O’Neill reflects on pushing a Powershell module into the Gallery:

I’ve worked with PowerShell for years but have never published a module before. I’ve helped write changes to a few, e.g. dbatoolsdbachecks, and a few internal ones.

But the actual creating and publishing one needs adding to my experience list.

There was a lot of gnashing of the teeth, wailing of the cries, and reading of the documentation.

Read on for a few tips from Shane. You’ll probably still need to read the documentation…but maybe not as much?

Comments closed

Finding Outdated Powershell Modules

Jeff Hill has a script for us:

In the world of PowerShell, some things move super fast while others may stay the same for years. If the module you are using does what you want with no issues, you may not think to see if a newer version is available. The PSReadline module is a good example. The version I was on worked great and it did what I wanted. I had no idea there was so much more that had been done.

Click through for a script which checks the Powershell Gallery for updates, though it does not force install those updates.

Comments closed

dbops Powershell Module

Kevin Chant looks at a useful Powershell module:

Before covering the dbops PowerShell module I want to quickly cover DbUp.

DbUp is a .NET library that you can use to do migration-based deployments. It is open-source and is licensed under the MIT license, which you can read about in the DbUp license file.

According to the official list of supported databases, it allows you to do migration-based deployments to various databases. Such as SQL Server and MySQL. As you will discover later in this post it also works with a newer Azure service as well.

DbUp has been on my to-learn list for a little while, though I haven’t had a chance to dig into it yet.

Comments closed