New-PentestAccount
SYNOPSIS
Creates pentest accounts in Active Directory.
SYNTAX
New-PentestAccount [-ServiceRequest] <Int32> [[-Application] <String>] [-Count] <Int32>
[-ExpiryDate] <DateTime> [-User] <String> [-AzureSynced] [-AddMailbox] [-WhatIf] [-Confirm]
[<CommonParameters>]
DESCRIPTION
The `New-PentestAccount` function creates one or more pentest accounts in Active Directory. It supports specifying the service request, application, expiration date, and additional options such as Azure synchronization and mailbox creation. The function also integrates with PasswordState to store account credentials.
EXAMPLES
EXAMPLE 1
New-PentestAccount -ServiceRequest 12345 -Application "TestApp" -Count 5 -ExpiryDate (Get-Date).AddDays(30) -User "jdoe"
Creates 5 pentest accounts for the application "TestApp" with an expiration date 30 days from now.
EXAMPLE 2
New-PentestAccount -ServiceRequest 12345 -Application "TestApp" -Count 3 -ExpiryDate (Get-Date).AddDays(15) -User "jdoe" -AzureSynced
Creates 3 Azure-synced pentest accounts for the application "TestApp" with an expiration date 15 days from now.
EXAMPLE 3
New-PentestAccount -ServiceRequest 12345 -Application "TestApp" -Count 2 -ExpiryDate (Get-Date).AddDays(10) -User "jdoe" -AddMailbox
Creates 2 pentest accounts for the application "TestApp" with mailboxes and an expiration date 10 days from now.
PARAMETERS
-ServiceRequest
The service request number associated with the pentest accounts.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: 0
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
-Application
The name of the application for which the pentest accounts are created.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
-Count
The number of pentest accounts to create (between 1 and 50).
Type: Int32
Parameter Sets: (All)
Aliases:
Required: True
Position: 3
Default value: 0
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
-ExpiryDate
The expiration date for the pentest accounts.
Type: DateTime
Parameter Sets: (All)
Aliases:
Required: True
Position: 4
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
-User
The user associated with the pentest accounts.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 5
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
-AzureSynced
A switch parameter that, when specified, enables Azure synchronization for the pentest accounts.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: 6
Default value: False
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
-AddMailbox
A switch parameter that, when specified, adds a mailbox for the pentest accounts.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: 7
Default value: False
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
-WhatIf
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
-Confirm
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
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.