New-RDMRandomPassword

    2025-01-21

    New-RDMRandomPassword

    SYNOPSIS

    Create a new random password

    SYNTAX

    All (Default)

    New-RDMRandomPassword [-ForcePromptAnswer <DialogResult[]>] [<CommonParameters>]
    

    Session

    New-RDMRandomPassword [[-Session] <PSConnection>] [-ForcePromptAnswer <DialogResult[]>]
     [<CommonParameters>]
    

    Mode

    New-RDMRandomPassword -Mode <PasswordGeneratorMode> [-ForcePromptAnswer <DialogResult[]>]
     [<CommonParameters>]
    

    Template

    New-RDMRandomPassword [[-TemplateName] <string>] [-ForcePromptAnswer <DialogResult[]>]
     [<CommonParameters>]
    

    ALIASES

    This cmdlet has the following aliases,

    DESCRIPTION

    Create a new random password

    EXAMPLES

    EXAMPLE 1

    PS C:> $randomPassword = New-RDMRandomPassword

    Generate a random password with the default settings

    EXAMPLE 2

    PS C:> $randomPassword = New-RDMRandomPassword -TemplateName $templateName

    Generate a random password with the template settings

    EXAMPLE 3

    PS C:> $session = Get-RDMSession -Name MySession; $randomPassword = New-RDMRandomPassword -Session $session

    Generate a random password with the password complexity of the session

    EXAMPLE 4

    PS C:> $pwd = New-RandomPassword -Mode Default -MinimumDigit 10 -MinimumLength 1

    Generate a random password composed of 10 digits.

    EXAMPLE 5

    PS C:> $pwd = New-RandomPassword -Mode SpecifiedSettings -Digit 1 -Bracket 0 -Underline 1 -Lowercase 0 -Special 0 -Uppercase 0

    Generate a random password composed of at least 1 digit and 1 underline. The other characters are either a digit, a lowercase, an uppercase, a special symbol, a bracket , or an underline. High ANSI, minus and space characters are not present in the password. There is not guarantuee the password is XML Compliant.

    EXAMPLE 6

    PS C:> $pwd = New-RandomPassword -Mode Passphrase -AppendNumber LastWord -CapitalizeFirstLetter FirstWord -PassphraseLength 10 -WordSeparator ""

    Generate a random password composed of 10 unspaced english words. Its first letter is the only one capitalized, and it ends with the only digit.

    PARAMETERS

    -ForcePromptAnswer

    Switch to use with caution. It will automatically answer prompt asking yes/no, yes/no/cancel, or ok/cancel questions. In case of multiple prompts, multiple values can be passed to this parameter. Here are the accepted values:

    • Yes: Accept the prompt. Cover the OK and Automatic value.
    • No: Refuse the yes/no/cancel prompt. Cancel is the fallback option if there is not an option No.
    • Cancel: Cancel the yes/no/cancel prompt. No is the fallback option if there is not an option Cancel.
    Type: System.Windows.Forms.DialogResult[]
    DefaultValue: ''
    SupportsWildcards: false
    ParameterValue: []
    Aliases: []
    ParameterSets:
    - Name: (All)
      Position: Named
      IsRequired: false
      ValueFromPipeline: false
      ValueFromPipelineByPropertyName: false
      ValueFromRemainingArguments: false
    DontShow: false
    AcceptedValues: []
    HelpMessage: ''
    

    -Mode

    Type: System.Nullable`1[Devolutions.RemoteDesktopManager.PasswordGeneratorMode]
    DefaultValue: ''
    SupportsWildcards: false
    ParameterValue: []
    Aliases: []
    ParameterSets:
    - Name: Mode
      Position: Named
      IsRequired: true
      ValueFromPipeline: false
      ValueFromPipelineByPropertyName: false
      ValueFromRemainingArguments: false
    DontShow: false
    AcceptedValues: []
    HelpMessage: ''
    

    -Session

    Generate a random password with the password complexity of that session

    Type: RemoteDesktopManager.PowerShellModule.PSOutputObject.PSConnection
    DefaultValue: ''
    SupportsWildcards: false
    ParameterValue: []
    Aliases: []
    ParameterSets:
    - Name: Session
      Position: 1
      IsRequired: false
      ValueFromPipeline: false
      ValueFromPipelineByPropertyName: false
      ValueFromRemainingArguments: false
    DontShow: false
    AcceptedValues: []
    HelpMessage: ''
    

    -TemplateName

    Generate a random password with the template settings.

    Type: System.String
    DefaultValue: ''
    SupportsWildcards: false
    ParameterValue: []
    Aliases: []
    ParameterSets:
    - Name: Template
      Position: 1
      IsRequired: false
      ValueFromPipeline: false
      ValueFromPipelineByPropertyName: false
      ValueFromRemainingArguments: false
    DontShow: false
    AcceptedValues: []
    HelpMessage: ''
    

    CommonParameters

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

    INPUTS

    OUTPUTS

    NOTES

    For more information, type "Get-Help New-RDMRandomPassword -detailed". For technical information, type "Get-Help New-RDMRandomPassword -full".