New-LMCachedAccount
Syntax
Lmv1 (Default)
New-LMCachedAccount -AccessId <String> -AccessKey <String> -AccountName <String> [-CachedAccountName <String>] [-OverwriteExisting <Boolean>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Bearer
New-LMCachedAccount -AccountName <String> -BearerToken <String> [-CachedAccountName <String>] [-OverwriteExisting <Boolean>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Description
The New-LMCachedAccount function stores LogicMonitor portal credentials securely for use with Connect-LMAccount.
Examples
Example 1
#Cache LMv1 credentialsNew-LMCachedAccount -AccessId "id123" -AccessKey "key456" -AccountName "company"
Example 2
#Cache Bearer tokenNew-LMCachedAccount -BearerToken "token123" -AccountName "company" -CachedAccountName "prod"
Parameters
-AccessId
The Access ID from your LogicMonitor API credentials.
Type: StringParameter Sets: LMv1Aliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-AccessKey
The Access Key from your LogicMonitor API credentials.
Type: StringParameter Sets: LMv1Aliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-AccountName
The portal subdomain (e.g., “company” for company.logicmonitor.com).
Type: StringParameter Sets: (All)Aliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-BearerToken
The Bearer token for authentication (alternative to AccessId/AccessKey).
Type: StringParameter Sets: BearerAliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-CachedAccountName
The name to use for the cached account. Defaults to AccountName.
Type: StringParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: $AccountNameAccept pipeline input: FalseAccept wildcard characters: False
-OverwriteExisting
Whether to overwrite an existing cached account. Defaults to false.
Type: BooleanParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: FalseAccept pipeline input: FalseAccept wildcard characters: False
-ProgressAction
Fill ProgressAction Description
Type: ActionPreferenceParameter Sets: (All)Aliases: proga
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
None. You cannot pipe objects to this command.
Outputs
None. Returns success message if account is cached successfully.
Notes
This command creates a secure vault to store credentials if one doesn’t exist.