Skip to main content

Configure Active Directory using PowerShell

· One min read
New-Item -Path "c:\" -Name "PowerLab" -ItemType "directory"
'P@$$w0rd12' | ConvertTo-SecureString -Force -AsPlainText | Export-Clixml -Path C:\PowerLab\SafeModeAdministratorPassword.xml

$safeModePw = Import-Clixml -Path C:\PowerLab\SafeModeAdministratorPassword.xml

Install-windowsfeature -Name AD-Domain-Services

$forestParams = @{
DomainName = 'techuplab.local'
DomainMode = 'WinThreshold'
ForestMode = 'WinThreshold'
Confirm = $false
SafeModeAdministratorPassword = $safeModePw
WarningAction = 'Ignore'
}

$null = Install-ADDSForest @forestParams

Azure Managed Identities

· 3 min read

Managed identities can be used to manage Azure resources without using hardcoded credentials - removing the need to enter credentials from a VM (or other resources such as Azure Functions) that are accessing resources the managed identity has been given access to. There are two types of managed identities - User Assigned and System Assigned. User assigned can be used by multiple resources and system assigned is tied to one specific VM (resource). User assigned is created as a Managed Identity that can be assigned to multiple VMs.