Category: PowerShell

  • Grant full permission to Windows folders and files

    For a Windows application or service, it is often necessary for either the user or service startup account to have full control to its folders and files. In most cases, this is transparent to the user. It is generally being taken care of by various delegation mechanisms behind the scene. However, this can be a […]

  • JiMetrics now gathers SQL Server startup account

    During the last few days, I’ve refactored JiMetrics and added a new function: Used Pester to create more test cases for PowerShell functions I wrote; Enhanced the design and code so JiMetrics also gathers SQL Server instance’s startup account, which can be useful. If you don’t know what JiMetrics is, go to this page to […]

  • Collecting Windows BIOS and Host Serial Number

    After imporving JiMetrics yesterday so it tries to determine if the host is a VM or not, I made another improvement today: collecting host server BIOS related information and serial number. I don’t know about you, in the past when I needed to gather a Windows server’s BIOS or serial number for troubleshooting, I typically […]

  • Determining if a Windows host is a VM in JiMetrics

    I’ve been using my own SQL Server metrics collection package called JiMetrics for a couple of years. It is easy to set up. All you need are just two things: SQL Server instance and an account that has admin access to both the servers and instances you care about. JiMetrics doesn’t do anything that will […]

  • Install sqlps as a PowerShell module

    Most of SQL Server automation scripts using PowerShell use SMO directly. For example, one would do something like: [System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SqlServer.SMO”) $MyServer = new-object (‘Microsoft.SqlServer.Management.Smo.Server’) ‘HOME’ $MyDataBase = new-object (‘Microsoft.SqlServer.Management.Smo.Database’) ($Server, “MyDataBase”) That’s a lot of typing and looks messy and cumbersome. Since SQL Server 2008, Microsoft provides a sqlps shell which exposes a lot of SQL […]