function CreateIPMIUser($ipmiAddress, $ipmiAdminLogin, $ipmiAdminPassword, $ipmiNewUserLogin, $ipmiNewUserPassword, $ipmiNewUserPrivilege)
{
	Write-Host ($MSG_IPMI_USER_CREATING -f $ipmiNewUserLogin);

	$argumentList = ($IPMI_TOOL_CREATE_USER_ARGUMENTS  -f $ipmiAddress, $ipmiAdminLogin, $ipmiAdminPassword, $ipmiNewUserLogin, $ipmiNewUserPassword, $ipmiNewUserPrivilege);
    $process = start-process -FilePath $IPMI_TOOL_FULL_PATH -ArgumentList $argumentList -WindowStyle Hidden -Wait -PassThru
	
	if($process.ExitCode -eq 0)
	{
	    Write-Host ($MSG_IPMI_USER_CREATED -f $ipmiNewUserLogin) -ForegroundColor Yellow;
	}
	else
	{
		throw ($MSG_IPMI_USER_CREATE_ERROR -f $ipmiNewUserLogin);
	}
}

function DeleteIPMIUser($ipmiAddress, $ipmiAdminLogin, $ipmiAdminPassword)
{
	Write-Host $MSG_IPMI_USER_DELETING;

	$argumentList = ($IPMI_TOOL_DELETE_USER_ARGUMENTS  -f $ipmiAddress, $ipmiAdminLogin, $ipmiAdminPassword);
    $process = start-process -FilePath $IPMI_TOOL_FULL_PATH -ArgumentList $argumentList -WindowStyle Hidden -Wait -PassThru
	
	if($process.ExitCode -eq 0)
	{
	    Write-Host $MSG_IPMI_USER_DELETED -ForegroundColor Yellow;
	}
	else
	{
		throw $MSG_IPMI_USER_DELETE_ERROR;
	}
}

function AddIPMIIPAddress($IP, $ipmiAddress, $ipmiAdminLogin, $ipmiAdminPassword)
{
	Write-Host ($MSG_IPMI_IP_ADDING -f $IP, $ipmiAddress);

	$argumentList = ($IPMI_TOOL_ADD_IP_ARGUMENTS  -f $IP,$ipmiAddress, $ipmiAdminLogin, $ipmiAdminPassword);
    $process = start-process -FilePath $IPMI_TOOL_FULL_PATH -ArgumentList $argumentList -WindowStyle Hidden  -Wait -PassThru
	
	if($process.ExitCode -eq 0)
	{
	    Write-Host ($MSG_IPMI_IP_ADDED -f $IP, $ipmiAddress) -ForegroundColor Yellow;
	}
	else
	{
		throw $MSG_IPMI_IP_ADD_ERROR;
	}
}

function Restart-Server($ipmiAddress, $ipmiAdminLogin, $ipmiAdminPassword)
{
	Write-Host ($MSG_IPMI_SERVER_RESTARTING -f $ipmiAddress);

	$argumentList = ($IPMI_TOOL_SERVER_RESTART_ARGUMENTS  -f $ipmiAddress, $ipmiAdminLogin, $ipmiAdminPassword);
    $process = Start-Process -FilePath $IPMI_TOOL_FULL_PATH -ArgumentList $argumentList -WindowStyle Hidden -Wait -PassThru
	
	if($process.ExitCode -eq 0)
	{
	    Write-Host ($MSG_IPMI_SERVER_RESTARTED -f $ipmiAddress) -ForegroundColor Yellow;
	}
	else
	{
		throw ($MSG_IPMI_SERVER_RESTART_ERROR -f $ipmiAddress);
	}
}

function Start-Server($ipmiAddress, $ipmiAdminLogin, $ipmiAdminPassword)
{
	Write-Host ($MSG_IPMI_SERVER_STARTING -f $ipmiAddress);

	$argumentList = ($IPMI_TOOL_SERVER_START_ARGUMENTS  -f $ipmiAddress, $ipmiAdminLogin, $ipmiAdminPassword);
    $process = Start-Process -FilePath $IPMI_TOOL_FULL_PATH -ArgumentList $argumentList -WindowStyle Hidden -Wait -PassThru
	
	if($process.ExitCode -eq 0)
	{
	    Write-Host ($MSG_IPMI_SERVER_STARTED -f $ipmiAddress) -ForegroundColor Yellow;
	}
	else
	{
		throw ($MSG_IPMI_SERVER_START_ERROR -f $ipmiAddress);
	}
}

function Stop-Server($ipmiAddress, $ipmiAdminLogin, $ipmiAdminPassword)
{
	Write-Host ($MSG_IPMI_SERVER_STOPPING -f $ipmiAddress);

	$argumentList = ($IPMI_TOOL_SERVER_STOP_ARGUMENTS  -f $ipmiAddress, $ipmiAdminLogin, $ipmiAdminPassword);
    $process = Start-Process -FilePath $IPMI_TOOL_FULL_PATH -ArgumentList $argumentList -WindowStyle Hidden -Wait -PassThru
	
	if($process.ExitCode -eq 0)
	{
	    Write-Host ($MSG_IPMI_SERVER_STOPPED -f $ipmiAddress) -ForegroundColor Yellow;
	}
	else
	{
		throw ($MSG_IPMI_SERVER_STOP_ERROR -f $ipmiAddress);
	}
}