search
Categories
Sponsors
VirtualMetric Hyper-V Monitoring, Hyper-V Reporting
Archive
Blogroll

Badges
MCSE
Community

Cozumpark Bilisim Portali
Getting MSSQL Server Service Account Information with PowerShell
Posted in Windows Powershell | No Comment | 582 views | 07/02/2016 16:56

You can get detailed Service Account information via following code:

1
2
3
4
5
$MSSQLServerManager = New-Object 'Microsoft.SqlServer.Management.SMO.Server'
$HostSQLServiceAccount = $MSSQLServerManager.ServiceAccount;
$HostSQLServiceInstanceId = $MSSQLServerManager.ServiceInstanceId;
$HostSQLServiceName = $MSSQLServerManager.ServiceName;
$HostSQLServiceStartMode = $MSSQLServerManager.ServiceStartMode;

You can get Account, Service Start Mode, Service Name and Instance Id.



Leave a Reply