Closed sejagada closed 4 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.
This is going to be fixedin v22.3
Fixed in v22.3.0
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.SmoCreateWithServerInstanceNoNameCmdlet
2.ProcessTarget(SmoRecordContext target) at Microsoft.SqlServer.Management.PowerShell.SqlCmdlet
1.ProcessRecord() at Microsoft.SqlServer.Management.PowerShell.SmoCmdlet.ProcessRecord()