> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell/da/powershell-commands/new-dsaccountlifecyclepolicyinfo.md).

# New-DSAccountLifecyclePolicyInfo

New-DSAccountLifecyclePolicyInfo opretter en konto lifecycle politik objekt i Devolutions Server for brug når configuring eller updating PAM udbydere.

### Synopsis

Opret en ny konto lifecycle politik.

### Syntaks

#### Type (standard)

```
New-DSAccountLifecyclePolicyInfo [-Source <AccountLifecyclePolicyProviderMode>]
 [-PolicyType <AccountLifecyclePolicyType>] [<CommonParameters>]
```

#### GetByID

```
New-DSAccountLifecyclePolicyInfo -PolicyID <guid> [<CommonParameters>]
```

### Description

Opret en ny konto lifecycle politik i en PowerShell-friendly format at kan være brugt når initializing eller updating PAM udbydere. For at redigere specifik indstillinger på politikken, den er nødvendig at redigere egenskaber på returneret objekt.

Adgangskode skabelon: Første sæt `$policy.Policy.PasswordTemplate.Mode = 'Custom'`. Assign en adgangskode skabelon ID til `$policy.Policy.PasswordTemplate.TemplateID` (hentet fra `Get-DSPasswordPolicy`).

Adgangskode reset: Configure automatic adgangskode rotation af indstilling `$policy.Policy.PasswordReset.ScheduleMode = 'Custom'`. Angiv hyppighed med `$policy.Policy.PasswordReset.ScheduleFrequency`. Sæt unit med `$policy.Policy.PasswordReset.ScheduleFrequencyUnit` (Dag, Time, etc.). Optionally sæt klokkeslættet med `$policy.Policy.PasswordReset.ScheduleAtDateTime`.

Adgangskode propagation scripts: Configure adgangskode propagation af indstilling `$policy.Policy.Propagation.Mode = 'Custom'`. Assign script IDs til `$policy.Policy.Propagation.ScriptConfigurationIds` (hentet fra `Get-DSScriptConfigurationSummary`).

### Eksempler

#### Eksempel 1

```powershell
PS C:\> $template = Get-DSPasswordPolicy -Name "Strong password"
PS C:\> $script = Get-DSScriptConfigurationSummary -Name "My password propagation script"
PS C:\> $policy = New-DSAccountLifecyclePolicyInfo -Source Custom -PolicyType Custom
PS C:\> $gateway = Get-DSGateway -Name 'MyGateway'
PS C:\> $policy.Policy.PasswordTemplate.Mode = 'Custom'
PS C:\> $policy.Policy.PasswordTemplate.TemplateID = $template.ID
PS C:\> $policy.Policy.CheckInAction.Mode = 'Custom'
PS C:\> $policy.Policy.CheckInAction.Actions = @('ResetPassword')
PS C:\> $policy.Policy.PasswordReset.ScheduleMode = 'Custom'
PS C:\> $policy.Policy.PasswordReset.ScheduleFrequency = 30
PS C:\> $policy.Policy.PasswordReset.ScheduleFrequencyUnit = 'Day'
PS C:\> $policy.Policy.PasswordReset.ScheduleAtDateTime = Get-Date -Hour 14 -Minute 0 -Second 0
PS C:\> $policy.Policy.Propagation.Mode = 'Custom'
PS C:\> $policy.Policy.Propagation.ScriptConfigurationIds = @($script.ID)
PS C:\> New-DSPamProvider -Name "MyProvider" -CredentialType DomainUser -DomainName "mydomain.loc" -Username "admin" -Password "P@ssw0rd" -AccountLifecyclePolicy $policy -Gateway $gateway
```

Opret en PAM udbyder med en brugerdefineret konto lifecycle politik og initialize flere egenskaber til brugerdefineret værdier. Note: 'ResetPassword' i CheckInAction.Actions corresponds til 'Adgangskode rotation' indstilling i UI.

#### Eksempel 2

```powershell
PS C:\> $customPolicy = Get-DSAccountLifecyclePolicy -Name "My Custom Policy"
PS C:\> $policy = New-DSAccountLifecyclePolicyInfo -PolicyID $customPolicy.ID
PS C:\> New-DSPamProvider -Name "MyProvider" -CredentialType DomainUser -DomainName "mydomain.loc" -Username "admin" -Password "P@ssw0rd" -AccountLifecyclePolicy $policy
```

Opret en PAM udbyder ved hjælp af en eksisterende konto lifecycle politik. `Source` er automatisk angivet til `Custom`.

### Parametre

#### -PolicyID

ID af en eksisterende konto lifecycle politik. ny politik vil brug denne politikken indstillinger. `Source` af returneret politik er automatisk angivet til `Custom`.

```yaml
Type: System.Guid
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: GetByID
  Position: Named
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### -PolicyType

Politikken type (Standard eller Brugerdefineret). Denne vil sæt returneret objektet PolicyID felt til en equivalent værdi.

```yaml
Type: RemoteDesktopManager.PowerShellModule.Private.enums.AccountLifecyclePolicyType
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Type
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### -Source

Politikken kilde (Standard, Brugerdefineret, eller Ingen)

```yaml
Type: RemoteDesktopManager.PowerShellModule.Private.enums.AccountLifecyclePolicyProviderMode
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Type
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### CommonParameters

Denne cmdlet understøtter de almindelige parametre: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction og -WarningVariable. Yderligere oplysninger finder De i [about\_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

### Output

#### RemoteDesktopManager.PowerShellModule.Private.models.PSAccountLifecyclePolicyInfo

### Noter

Yderligere oplysninger får De ved at skrive "Get-Help New-DSAccountLifecyclePolicyInfo -detailed". Tekniske oplysninger får De ved at skrive "Get-Help New-DSAccountLifecyclePolicyInfo -full".


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.devolutions.net/powershell/da/powershell-commands/new-dsaccountlifecyclepolicyinfo.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
