Saturday, 10 September 2016

Disk block size with Powershell

Recently I was working on documenting SQL Servers using the SQL Powerdoc which is from codeplex. One of the interesting thing which I saw was in the output was about allocation of storage size for SQL Servers.

As a best practice storage allocation size should be 64 KB. Please refer this Microsoft article for more information about this, click here

So now the next question is how do I check my disk block size?

Let’s do the PowerShell way, here is the script which you can use to check the block size

Get-WmiObject -Class Win32_volume -Filter "FileSystem='NTFS'" | Select-Object Name, Lable, BlockSize | Format-Table -AutoSize

sample output


Now the question is how do I do it for all the SQL servers in my network?

PowerShell makes things more simple. First get the server list for which you’re going to get the block size and save it in a text file. Now open PowerShell and run the below script

#Inside the below quotes provide the complete path with the server list file name#
$ServerList = Get-Content 'C:\ServerList.txt' 
Get-WmiObject -Class Win32_volume -Filter "FileSystem='NTFS'" -ComputerName $ServerList | Select-Object PSComputerName, Name, Lable, BlockSize | Format-Table -AutoSize

sample output


Cheers,
Naveen

Thursday, 8 September 2016

PowerShell on Linux and Open Source!

BIG news from Microsoft "PowerShell is now available in Linux and OS X". Microsoft has also announced that PowerShell will be an open source shell command line. So going forward with PowerShell you can automate things in different platform with same code. That's interesting !! click here to know more about this

Useful PowerShell resources
https://msdn.microsoft.com/powershell
https://blogs.msdn.microsoft.com/powershell/

Cheers,
Naveen

Monday, 5 September 2016

Getting started with SQL Server 2016

It's been a long time since I wrote a blog. There are lots of big things happening around with the technology.

SQL Server 2016 is out officially few months back and it has got lots of new features. I did get a chance to explore some of them and it was dam cool. In future blogs I will cover each topics as I learn.

Click here to download your FREE SQL 2016

Here is the list of some new features introduced in SQL 2016. For complete list click here

-Enhanced in-memory OLTP performance
-Query Store
-Temporal Tables
-Always Encrypted
-Row Level Security
-Dynamic Data Masking
-Support of JSON
-Integration with R Programming

Cheers,
Naveen