One problem I recently faced was, that I tried to use the xSQLServer DSC module to add the local administrator group (Administrators) as a SQL server security login. This should provide access to all local server administrators access to the SQL server application. My first attempt was to use the syntax like server01\Administrators, the DSC configuration looks like this…

xSQLServerLogin LocalAdministrators
{
DependsOn = '[xSqlServerSetup]SQLInstall'
Name = 'server01\Administrators'
LoginType = 'WindowsGroup'
SQLServer = $Node.NodeName
SQLInstanceName = $Node.InstanceName
}

This ended in an ugly error like “Create failed for Login ‘server01\Administrators’”. I checked the DSC resource how it works and tried to reproduce the error in ISE. So I ended up with this error locally.

2

Trying to add use the SQL Server Management Studio threw the same error.

1

Some investigations on the internet didn’t bring any result like here, there were even false answers, telling that it would not work.

The simple trick is not to provide ‘server01\Administrators’, instead use…

‘Builtin\Administrators’

xSQLServerLogin LocalAdministrators
{
DependsOn = '[xSqlServerSetup]SQLInstall'
Name = 'Builtin\Administrators'
LoginType = 'WindowsGroup'
SQLServer = $Node.NodeName
SQLInstanceName = $Node.InstanceName
}

…and voilà the local Administrators group will be added to the SQL Server security login.

image

Hope this helps!

Leave a Comment