Posted in
Windows Powershell |
No Comment | 583 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; |
$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.