Public/Enable-IdracUser.ps1

Function Enable-IdracUser{
    [CmdletBinding()]
    Param (
        [Parameter(Mandatory = $true)]
        [string]$iDRACName,

        [Parameter(Mandatory = $true)]
        [ValidateRange(2,16)]
        [int]$Id,

        [System.Management.Automation.PSCredential]$Credential
    )

    begin{
        $session = New-iDRACSession -iDRACName $iDRACName -Credential $Credential
    }

    process{

        $result = Invoke-SshCommand -Command "racadm set idrac.users.$Id.Enable Enabled" -SSHSession $session
        $msg = $result.Host.ToUpper() + " - " + $result.Output
        Write-Verbose -Message $msg
    }

    End{
        $session | Remove-SSHSession | Out-Null
    }
}