How to force sql server to use mixed mode authentication in Powershell

$instanceName = get-itemproperty ‘HKLM:SoftwaremicrosoftMicrosoft SQL ServerInstance NamesSQL’ -name MSSQLSERVER

if ($?) {
$i = $instanceName.MSSQLSERVER

set-itemproperty “HKLM:SoftwaremicrosoftMicrosoft SQL Server$iMSSQLServer” -name LoginMode -value 2 -type dword
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s