# CMS_RunUserAgent

> Creates a ‘CallHomeUser’ Unitcommand is in the SQL database, that will force the InfoCenter of the current user on the computer to launch the agent script.

Source: https://docs.capaone.com/capainstaller/vb-scripting-library/cms-functions/cms-runuseragent/  
Product: CapaInstaller — a separate CapaSystems product; do not apply this page to any other.

#### Description

Creates a ‘CallHomeUser’ Unitcommand is in the SQL database, that will force the InfoCenter of the current user on the computer to launch the agent script.

### Syntax

**VBScript**

Not implemented. See [CMS_RerunAgent](/capainstaller/vb-scripting-library/cms-functions/cms-rerunagent/)

**PowerShell**

```powershell
[bool]CMS_RunUserAgent -delay <string>
```

### Parameters

#### delay (string)

The delay after which the CallHomeUser unitCommand will be executed.

The format used for delay is very simple. Here are some examples:

‘2m’ is two minutes.

‘1h’ is one hour

‘4h35m11s’ is four hours, thirty-five minutes and eleven seconds

‘2m30s’ is two minutes and thirty seconds

‘0s’ or '' (an empty string) equals no delay and means that the command will be executed right after the current agent run.

### Return value

Boolean, TRUE if function completed successfully.

### Example

**PowerShell**

```powershell
# run the user agent in 2 minutes
CMS_RunUserAgent -delay '2m'

# run the user agent in half an hour
CMS_RunUserAgent '30m'

# run the useragent without a delay
CMS_RunUserAgent -delay '0s'
```

[Scripting Guidelines](/capainstaller/vb-scripting-library/scripting-guidelines/)

### Related functions

[CMS_RunSystemAgent](/capainstaller/vb-scripting-library/cms-functions/cms-runsystemagent/) [Constants](/capainstaller/vb-scripting-library/addendum/constants/) [Package Property](/capainstaller/vb-scripting-library/addendum/package-property/) [Variables](/capainstaller/vb-scripting-library/addendum/variables/) [Business Unit support](/capainstaller/vb-scripting-library/addendum/business-unit-support/)

[CMS_RerunAgent](/capainstaller/vb-scripting-library/cms-functions/cms-rerunagent/)
