Skip to content

New-LMCachedAccount

Terminal window
New-LMCachedAccount -AccessId <String> -AccessKey <String> -AccountName <String> [-CachedAccountName <String>]
[-OverwriteExisting <Boolean>] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
Terminal window
New-LMCachedAccount -AccountName <String> -BearerToken <String> [-CachedAccountName <String>]
[-OverwriteExisting <Boolean>] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]

The New-LMCachedAccount function stores LogicMonitor portal credentials securely for use with Connect-LMAccount.

Terminal window
#Cache LMv1 credentials
New-LMCachedAccount -AccessId "id123" -AccessKey "key456" -AccountName "company"
Terminal window
#Cache Bearer token
New-LMCachedAccount -BearerToken "token123" -AccountName "company" -CachedAccountName "prod"

The Access ID from your LogicMonitor API credentials.

Type: String
Parameter Sets: LMv1
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

The Access Key from your LogicMonitor API credentials.

Type: String
Parameter Sets: LMv1
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

The portal subdomain (e.g., “company” for company.logicmonitor.com).

Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

The Bearer token for authentication (alternative to AccessId/AccessKey).

Type: String
Parameter Sets: Bearer
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

The name to use for the cached account. Defaults to AccountName.

Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: $AccountName
Accept pipeline input: False
Accept wildcard characters: False

Whether to overwrite an existing cached account. Defaults to false.

Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Fill ProgressAction Description

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

None. You cannot pipe objects to this command.

Section titled “None. You cannot pipe objects to this command.”

None. Returns success message if account is cached successfully.

Section titled “None. Returns success message if account is cached successfully.”

This command creates a secure vault to store credentials if one doesn’t exist.