dbatools is a free PowerShell module with over 180 SQL Server administration, best practice and migration commands included.


Get-DbaPrivilege

Gets the users with local privileges ‘Lock Pages in Memory’, ‘Instant File Initialization’, ‘Logon as Batch’ on one or more computers. Requires Local Admin rights on destination computer(s).

Screenshots

Examples

To get the local privileges on computer sqlserver2014a.

Get-DbaPrivilege -ComputerName sqlserver2014a

To get the local privileges on computers sql1, sql2 and sql3.

‘sql1′,’sql2′,’sql3’ | Get-DbaPrivilege

To get the local privileges on computers sql1 and sql2, and shows them in a grid view.

Get-DbaPrivilege -ComputerName sql1,sql2 | Out-Gridview

Author

This command was created by Klaas Vandenberghe. You can find Klaas on Twitter and his blog.

Get-Help

From PowerShell, execute Get-Help Get-DbaPrivilege -Detailed for more information on this function.

Source Code

Want to see the source code? View Get-DbaPrivilege.ps1 on GitHub
 

Related commands