Skip to content

Commit

Permalink
New-TssDirectoryService - new command to create domains
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmelton committed Sep 15, 2021
1 parent 02a10f4 commit 8b99a38
Show file tree
Hide file tree
Showing 7 changed files with 587 additions and 1 deletion.
1 change: 0 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"mhutchie.git-graph",
"github.vscode-pull-request-github",
"oderwat.indent-rainbow",
"2gua.rainbow-brackets",
"vscode-icons-team.vscode-icons",
"ms-dotnettools.csharp",
"jmrog.vscode-nuget-package-manager"
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"Minimap",
"MSSQLSERVER",
"notcontains",
"onmicrosoft",
"params",
"Paren",
"Pscmdlet",
Expand Down
340 changes: 340 additions & 0 deletions docs/commands/directory-services/New-TssDirectoryService.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,340 @@
# New-TssDirectoryService

## SYNOPSIS
Create a new Directory Service for Active Direcotry, AzureAD or OpenLDAP

## SYNTAX

### openldap
```
New-TssDirectoryService [-TssSession] <Session> [-Active] -DomainName <String> -FriendlyName <String>
[-SiteId <Int32>] [-UseSecureLdap] [-MfaProvider <MfaProviderType>] [-SecretId <Int32>]
-DistinguishedName <String> -AuthType <LdapAuthType> -UserAuthType <UserAuthType> [-WhatIf] [-Confirm]
[<CommonParameters>]
```

### azure
```
New-TssDirectoryService [-TssSession] <Session> [-Active] -DomainName <String> [-SiteId <Int32>]
[-MfaProvider <MfaProviderType>] -TenantId <String> -ClientId <String> -ClientSecret <String> [-WhatIf]
[-Confirm] [<CommonParameters>]
```

### active-directory
```
New-TssDirectoryService [-TssSession] <Session> [-Active] -DomainName <String> -FriendlyName <String>
[-SiteId <Int32>] [-UseSecureLdap] [-MfaProvider <MfaProviderType>] -SecretId <Int32> [-WhatIf] [-Confirm]
[<CommonParameters>]
```

## DESCRIPTION
Create a new Directory Service for Active Direcotry, AzureAD or OpenLDAP

## EXAMPLES

### EXAMPLE 1
```
$session = New-TssSession -SecretServer https://alpha -Credential $ssCred
$newDomain = @{
TssSession = $session
Active = $true
DomainName = 'lab.local'
FriendlyName = 'lab'
SecretId = 1064
}
New-TssDirectoryService @newDomain
```

Create a new Active Directory Domain Directory Service

### EXAMPLE 2
```
$session = New-TssSession -SecretServer https://alpha -Credential $ssCred
$newDomain = @{
TssSession = $session
Active = $true
DomainName = 'lab.onmicrosoft.com'
TenantId = '1dcfeb09-1600-4865-a4db-738ceab78d3d'
ClientSecret = 'p857Q~fChrIsRkG0Pin3mUfHH3tAnp1W2RHOz'
SecretId = 1064
}
New-TssDirectoryService @newDomain
```

Create a new Azure Active Directory tenant Directory Service

## PARAMETERS

### -TssSession
TssSession object created by New-TssSession for authentication

```yaml
Type: Session
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```
### -Active
Active on creation
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### -DomainName
Domain Name, FQDN
```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -FriendlyName
Domain Friendly Name (short name, will be used in Discovery matching)
```yaml
Type: String
Parameter Sets: openldap, active-directory
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -SiteId
Site ID, default local/default site (1)
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: 1
Accept pipeline input: False
Accept wildcard characters: False
```
### -UseSecureLdap
Use Secure LDAP
```yaml
Type: SwitchParameter
Parameter Sets: openldap, active-directory
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### -MfaProvider
MFA Provider, default None
```yaml
Type: MfaProviderType
Parameter Sets: (All)
Aliases:
Accepted values: None, Radius, TOTPAuthenticator, Duo, Fido2, Email

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -SecretId
Secret used for synchronization
```yaml
Type: Int32
Parameter Sets: openldap
Aliases:

Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
```yaml
Type: Int32
Parameter Sets: active-directory
Aliases:

Required: True
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -TenantId
Tenant ID
```yaml
Type: String
Parameter Sets: azure
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -ClientId
Client ID
```yaml
Type: String
Parameter Sets: azure
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -ClientSecret
Client Secret
```yaml
Type: String
Parameter Sets: azure
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -DistinguishedName
Distinguished Name
```yaml
Type: String
Parameter Sets: openldap
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -AuthType
Authentication type
```yaml
Type: LdapAuthType
Parameter Sets: openldap
Aliases:
Accepted values: Basic, Anonymous, Kerberos

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -UserAuthType
User Authentication type (only AuthType=Anonymous)
```yaml
Type: UserAuthType
Parameter Sets: openldap
Aliases:
Accepted values: Basic, NoAuthentication, Kerberos

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
```yaml
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.
```yaml
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](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
### Thycotic.PowerShell.DirectoryServices.Domain
## NOTES
Requires TssSession object returned by New-TssSession
## RELATED LINKS
[https://thycotic-ps.github.io/thycotic.secretserver/commands/directory-services/New-TssDirectoryService](https://thycotic-ps.github.io/thycotic.secretserver/commands/directory-services/New-TssDirectoryService)
[https://github.com/thycotic-ps/thycotic.secretserver/blob/main/src/functions/directory-services/New-TssDirectoryService.ps1](https://github.com/thycotic-ps/thycotic.secretserver/blob/main/src/functions/directory-services/New-TssDirectoryService.ps1)
14 changes: 14 additions & 0 deletions src/Thycotic.SecretServer/enums/directory-services/LdapAuthType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Threading.Tasks;
using System.Management.Automation;
using System.Management.Automation.Runspaces;

namespace Thycotic.PowerShell.Enums
{
public enum LdapAuthType
{
Basic,
Anonymous,
Kerberos
}
}
14 changes: 14 additions & 0 deletions src/Thycotic.SecretServer/enums/directory-services/UserAuthType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Threading.Tasks;
using System.Management.Automation;
using System.Management.Automation.Runspaces;

namespace Thycotic.PowerShell.Enums
{
public enum UserAuthType
{
Basic,
NoAuthentication,
Kerberos
}
}
Loading

0 comments on commit 8b99a38

Please sign in to comment.