microsoft / SQLServerPSModule

This repo is the home of SQL Server PowerShell Module development.
MIT License
51 stars 1 forks source link

Add-SqlLogin: DenyWindowsLogin: unknown property. #79

Closed sejagada closed 4 months ago

sejagada commented 5 months ago

Unable to create login using Add-SqlLogin cmdlet, getting unknow property exception.

PS C:\Users\sejagada> $Error[0].Exception.ToString() Microsoft.SqlServer.Management.Smo.UnknownPropertyException: DenyWindowsLogin: unknown property. at Microsoft.SqlServer.Management.Smo.SqlPropertyMetadataProvider.PropertyNameToIDLookupWithException(String propertyName, PropertyAccessPurpose pap) at Microsoft.SqlServer.Management.Smo.PropertyCollection.LookupID(String propertyName, PropertyAccessPurpose pap) at Microsoft.SqlServer.Management.Smo.PropertyCollection.SetValueWithConsistencyCheck(String propertyName, Object value, Boolean allowNull) at Microsoft.SqlServer.Management.Smo.PropertyCollection.SetValueWithConsistencyCheck(String propertyName, Object value) at Microsoft.SqlServer.Management.Smo.Login.set_DenyWindowsLogin(Boolean value) at Microsoft.SqlServer.Management.PowerShell.Security.AddSqlLogin.CreateObject(Server server) at Microsoft.SqlServer.Management.PowerShell.Shared.SmoCreateWithServerInstanceNoNameCmdlet2.ProcessTarget(SmoRecordContext target) at Microsoft.SqlServer.Management.PowerShell.SqlCmdlet1.ProcessRecord() at Microsoft.SqlServer.Management.PowerShell.SmoCmdlet.ProcessRecord()

Add-SqlLogin
Matteo-T commented 5 months ago

It looks like the for Azure, the cmdlet is not checking whether SMO supports the DenyWindowsLogin on the Login object...

I'll take a look at it and fix it.

Matteo-T commented 5 months ago

This is going to be fixedin v22.3

Matteo-T commented 4 months ago

Fixed in v22.3.0