There are some actions that we know that will have to be repeated from time to time, but the surprise comes when it’s time to do so and the process that used to work does not work anymore.
This is a short post to document a slight change that I had to do to achieve the same final result as the first time.
Long story short A client needed to run a setup to install an application.
Starting on dbatools version 1.0.31 we introduced better coverage for commands that make use of PowerShell Remoting.
Which commands? Commands like Get-DbaComputerCertificate, Get-DbaPrivilege, Get-DbaClientAlias, just to mention a few of them, make use of the internal function Invoke-Command2 which uses New-PSSession when we run it against a remote computer.
“Why have you changed it?” Let me give you a little bit of background… At my company, I found that some dbatools commands were not working.
I don’t know about your experience when it comes to SQL Server Agent jobs but often I receive requests to grant permission so that clients can handle their jobs in an autonomous way.
Any problem with that? It depends 😄 If you’re not familiarized with the difficulty this can bring, let me share with you a different way to accomplish the task without adding the login to the sysadmin instance role.
Dear reader, before continue please open a PowerShell console and run the following command:
Install-Module -Name dbatools If you are doing this on the date of this blog post, you have just installed dbatools v1.0!
After more than 200 commits, the work of more than 20 contributors and 20 days since the last published version, dbatools v1.0 is live!
To all of you that have contributed direct or indirectly to the module a big thank you!
Few days ago I received a request to restore a dozen of tables because someone have deleted more data than it was supposed. I immediately thought about dbatools for the job!
NOTE: I also thought about SSMS “Import/Export Data”. And this is ok when someone says “it’s to run just once, just now”. When you are in the IT for a while you know that is not only once :-). And what if I need to re-run?