-
Notifications
You must be signed in to change notification settings - Fork 0
Set UdeDbJitCache
Sets UDE database JIT access credentials in the local cache.
Set-UdeDbJitCache [-Id] <String> [-Server] <String> [-Database] <String> [-Username] <String>
[-Password] <String> [[-Expiration] <DateTime>] [[-Role] <String>] [[-EnvironmentId] <String>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
This function sets UDE database JIT access credentials in the local cache for later retrieval.
Handles storing the credentials securely using the TUN.CredentialManager module. Made to have SSMS able to retrieve the password when connecting.
Calling this cmdlet with the same Server, Database and Username will overwrite the existing cached credentials.
Set-UdeDbJitCache -Id "demo" -Server "myserver.database.windows.net" -Database "mydatabase" -Username "myuser" -Password "mypassword"
This will set the JIT database access credentials in the local cache for the specified ID. It will store the server, database, username, and password securely using the TUN.CredentialManager module.
Get-UdeDbJit -EnvironmentId "env-123" | Set-UdeDbJitCache -Id "demo" -EnvironmentId "env-123"
This will retrieve the JIT database access information for the specified environment ID using Get-UdeDbJit. It will then set the JIT database access credentials in the local cache for the ID "demo". It will store the server, database, username, and password securely using the TUN.CredentialManager module. It will store the expiration and role as provided by Get-UdeDbJit. It will also associate the environment details with the cached credentials.
The unique identifier for the JIT access credentials.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe SQL Server instance name.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalseThe database name.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 3
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalseThe username for the JIT access credentials.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 4
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalseThe password for the JIT access credentials.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 5
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalseThe expiration date and time for the JIT access credentials.
Type: DateTime
Parameter Sets: (All)
Aliases:
Required: False
Position: 6
Default value: (Get-Date).AddHours(8)
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalseThe role assigned for JIT database access. Can be either "Reader" or "Writer".
Defaults to "Reader".
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 7
Default value: Reader
Accept pipeline input: False
Accept wildcard characters: FalseThe ID of the environment that you want to work against.
Supports wildcard patterns.
Can be either the environment name or the environment GUID.
Type: String
Parameter Sets: (All)
Aliases: PpacEnvId
Required: False
Position: 8
Default value: None
Accept pipeline input: True (ByPropertyName)
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: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Author: Mötz Jensen (@Splaxi)