Public/Disable-IdracUser.ps1
Function Disable-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 Disabled" -SSHSession $session $msg = $result.Host.ToUpper() + " - " + $result.Output Write-Verbose -Message $msg } End{ $session | Remove-SSHSession | Out-Null } } |