Posts

Showing posts from March, 2021

Gen4 family is not available in this region. Microsoft SQL Server, Error: 45122

Image
This post describes how to fix the error 'Gen4 family is not available in this region. Microsoft SQL Server, Error: 45122' Cause This error can occur when creating a new database in Azure using SQL Server Management Studio. If you select the Configure SLO page, you will see GP_Gen4_1 as the Current Service Level Objective.  This setting is greyed out if you are not signed in to Microsoft Azure: Resolution When you are signed in, these Azure options can be changed.  I changed the Edition to Basic, which also changed the Current Service Level Objective to Basic: This enabled me to successfully create the database, however this may vary depending on your region.

Lock Active Directory User Account - PowerShell

Image
In this post, I describe how you can lock an Active Directory User Account using PowerShell. As far as I can tell, it's not possible to lock an Active Directory User Account in the Active Directory management tools UI (Active Directory Users and Computers).  However, sometimes it's necessary to lock an account, for example, if you are testing a tool which unlocks an account, such as XIA Automation . Locking an Active Directory User Account To lock an Active Directory User Account in PowerShell, we can write a simple script. Firstly, we get the account lockout threshold from group policy: $AccountLockoutThreshold = ((( [ xml ] ( Get-GPOReport -Name "Default Domain Policy" -ReportType Xml )) . GPO . Computer . ExtensionData . Extension . Account |             Where-Object name -eq LockoutBadCount ) . SettingNumber) You could also just hard code this if you know the value: $AccountLockoutThreshold = 5 Next, we need to specify the user account we want to lock,