Complete the code to import the Active Directory module.
Import-Module [1]The correct module name to import Active Directory cmdlets is ActiveDirectory.
Complete the code to install the RSAT Active Directory module feature on Windows.
Add-WindowsFeature [1]The feature name to install the AD PowerShell module is RSAT-AD-PowerShell.
Fix the error in the command to check if the Active Directory module is installed.
Get-WindowsFeature | Where-Object { $_.Name -eq 'RSAT-AD-PowerShell' [1] $_.Installed }The Where-Object cmdlet uses a script block with a condition. The logical operator -and is correct to combine conditions.
Fill both blanks to create a command that installs the AD module and then imports it.
Add-WindowsFeature [1]; Import-Module [2]
First, install the feature RSAT-AD-PowerShell. Then import the module ActiveDirectory to use AD cmdlets.
Fill all three blanks to create a script that installs the AD module, imports it, and verifies installation.
$feature = Get-WindowsFeature [1]; if ($feature.[2]) { Import-Module [3]; Write-Output 'AD module ready' } else { Write-Output 'Module not installed' }
The script gets the feature named RSAT-AD-PowerShell. It checks the Installed property. If true, it imports the ActiveDirectory module and confirms readiness.