Skip to content

Commit

Permalink
Merge pull request #1006 from j0rt3g4/Issue#246
Browse files Browse the repository at this point in the history
Issue #246
  • Loading branch information
AndreaBarr committed Apr 24, 2019
2 parents fb3d307 + 4f4216b commit 8073ea4
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 38 deletions.
45 changes: 38 additions & 7 deletions docset/windows/addsadministration/new-adserviceaccount.md
Expand Up @@ -26,7 +26,7 @@ Creates a new Active Directory managed service account or group managed service
## SYNTAX

### Group (Default)
```
```yaml
New-ADServiceAccount [-WhatIf] [-Confirm] [-AccountExpirationDate <DateTime>] [-AccountNotDelegated <Boolean>]
[-AuthenticationPolicy <ADAuthenticationPolicy>] [-AuthenticationPolicySilo <ADAuthenticationPolicySilo>]
[-AuthType <ADAuthType>] [-Certificates <String[]>] [-CompoundIdentitySupported <Boolean>]
Expand All @@ -40,7 +40,7 @@ New-ADServiceAccount [-WhatIf] [-Confirm] [-AccountExpirationDate <DateTime>] [-
```

### RestrictedToSingleComputer
```
```yaml
New-ADServiceAccount [-WhatIf] [-Confirm] [-AccountExpirationDate <DateTime>] [-AccountNotDelegated <Boolean>]
[-AccountPassword <SecureString>] [-AuthenticationPolicy <ADAuthenticationPolicy>]
[-AuthenticationPolicySilo <ADAuthenticationPolicySilo>] [-AuthType <ADAuthType>] [-Certificates <String[]>]
Expand All @@ -52,7 +52,7 @@ New-ADServiceAccount [-WhatIf] [-Confirm] [-AccountExpirationDate <DateTime>] [-
```

### RestrictedToOutboundAuthenticationOnly
```
```yaml
New-ADServiceAccount [-WhatIf] [-Confirm] [-AccountExpirationDate <DateTime>] [-AccountNotDelegated <Boolean>]
[-AuthenticationPolicy <ADAuthenticationPolicy>] [-AuthenticationPolicySilo <ADAuthenticationPolicySilo>]
[-AuthType <ADAuthType>] [-Certificates <String[]>] [-Credential <PSCredential>] [-Description <String>]
Expand Down Expand Up @@ -92,28 +92,28 @@ Then pass these objects through the pipeline to the **New-ADServiceAccount** cmd
## EXAMPLES

### Example 1: Create an enabled managed service account
```
```Powershell
PS C:\> New-ADServiceAccount -Name "Service01" -DNSHostName "Service01.contoso.com" -Enabled $True
```

This command creates an enabled managed service account in Active Directory Domain Services (AD DS).

### Example 2: Create a managed service account and register its service principal name
```
```Powershell
PS C:\> New-ADServiceAccount -Name "Service01" -ServicePrincipalNames "MSSQLSVC/Machine3.corp.contoso.com" -DNSHostName "Service01.contoso.com"
```

This command creates a managed service account and registers its service principal name.

### Example 3: Create a managed service account for a single computer
```
```Powershell
PS C:\> New-ADServiceAccount -Name "Service01" -RestrictToSingleComputer
```

This command creates a managed service account and restricts its use to a single computer.

### Example 4: Create a managed service account for outbound authentication only
```
```Powershell
PS C:\> New-ADServiceAccount -Name "Service01" -RestrictToOutboundAuthenticationOnly
```

Expand Down Expand Up @@ -756,6 +756,37 @@ Specifies the service principal names for the account.
This parameter sets the **ServicePrincipalNames** property of the account.
The LDAP display name (**ldapDisplayName**) for this property is servicePrincipalName.

To add values:

```Powershell
-ServicePrincipalNames @{Add=value1,value2,...}
```

To remove values:
```Powershell
-ServicePrincipalNames @{Remove=value1,value2,...}
```

To replace values:
```Powershell
-ServicePrincipalNames @{Replace=value1,value2,...}
```

To clear all values:
```Powershell
-ServicePrincipalNames $null
```

You can specify more than one change by using a list separated by semicolons.
For example, use the following syntax to add and remove service principal names.

`@{Add=value1,value2,...};@{Remove=value3,value4,...}`

The operators are applied in the following sequence:

- Remove
- Add
- Replace

```yaml
Type: String[]
Expand Down
52 changes: 28 additions & 24 deletions docset/winserver2012-ps/activedirectory/New-ADServiceAccount.md
Expand Up @@ -17,7 +17,7 @@ Creates a new Active Directory managed service account or group managed service
## SYNTAX

### Group (Default)
```
```yaml
New-ADServiceAccount [-WhatIf] [-Confirm] [-AccountExpirationDate <DateTime>] [-AccountNotDelegated <Boolean>]
[-AuthType <ADAuthType>] [-Certificates <String[]>] [-CompoundIdentitySupported <Boolean>]
[-Credential <PSCredential>] [-Description <String>] [-DisplayName <String>] -DNSHostName <String>
Expand All @@ -30,7 +30,7 @@ New-ADServiceAccount [-WhatIf] [-Confirm] [-AccountExpirationDate <DateTime>] [-
```

### RestrictedToSingleComputer
```
```yaml
New-ADServiceAccount [-WhatIf] [-Confirm] [-AccountExpirationDate <DateTime>] [-AccountNotDelegated <Boolean>]
[-AccountPassword <SecureString>] [-AuthType <ADAuthType>] [-Certificates <String[]>]
[-Credential <PSCredential>] [-Description <String>] [-DisplayName <String>] [-Enabled <Boolean>]
Expand All @@ -41,7 +41,7 @@ New-ADServiceAccount [-WhatIf] [-Confirm] [-AccountExpirationDate <DateTime>] [-
```

### RestrictedToOutboundAuthenticationOnly
```
```yaml
New-ADServiceAccount [-WhatIf] [-Confirm] [-AccountExpirationDate <DateTime>] [-AccountNotDelegated <Boolean>]
[-AuthType <ADAuthType>] [-Certificates <String[]>] [-Credential <PSCredential>] [-Description <String>]
[-DisplayName <String>] [-Enabled <Boolean>] [-HomePage <String>] [-Instance <ADServiceAccount>]
Expand Down Expand Up @@ -79,7 +79,7 @@ Then pass these objects through the pipeline to the New-ADServiceAccount cmdlet
## EXAMPLES

### -------------------------- EXAMPLE 1 --------------------------
```
```Powershell
C:\PS>New-ADServiceAccount service1 -DNSHostName service1.contoso.com -Enabled $true
```

Expand All @@ -90,7 +90,7 @@ Description
Create a new enabled managed service account in AD DS.

### -------------------------- EXAMPLE 2 --------------------------
```
```Powershell
C:\PS>New-ADServiceAccount service1 -ServicePrincipalNames "MSSQLSVC/Machine3.corp.contoso.com" -DNSHostName service1.contoso.com
```

Expand All @@ -101,7 +101,7 @@ Description
Create a new managed service account and register its service principal name.

### -------------------------- EXAMPLE 3 --------------------------
```
```Powershell
C:\PS>New-ADServiceAccount service1 -RestrictToSingleComputer
```

Expand All @@ -112,7 +112,7 @@ Description
Create a new managed service account and restrict its use to only a single computer.

### -------------------------- EXAMPLE 4 --------------------------
```
```Powershell
C:\PS>New-ADServiceAccount service1 -RestrictToOutboundAuthenticationOnly
```

Expand Down Expand Up @@ -297,11 +297,9 @@ For example, use the following syntax to add and remove Certificate values

The operators will be applied in the following sequence:

..Remove

..Add

..Replace
- Remove
- Add
- Replace

The following example shows how to create a certificate by using the New-Object cmdlet, and then add it to a user account.
When this cmdlet is run, \<certificate password\> is replaced by the password used to add the certificate.
Expand Down Expand Up @@ -878,32 +876,38 @@ Accept wildcard characters: False

### -ServicePrincipalNames
Specifies the service principal names for the account.
This parameter sets the ServicePrincipalNames property of the account.
The LDAP display name (ldapDisplayName) for this property is servicePrincipalName.
This parameter sets the **ServicePrincipalNames** property of the account.
The LDAP display name (**ldapDisplayName**) for this property is servicePrincipalName.
This parameter uses the following syntax to add remove, replace or clear service principal name values.

Syntax:

To add values:

-ServicePrincipalNames @{Add=value1,value2,...}

To remove values:

-ServicePrincipalNames @{Remove=value3,value4,...}
```Powershell
-ServicePrincipalNames @{Add=value1,value2,...}
```

To replace values:
To remove values: To remove values:
```Powershell
-ServicePrincipalNames @{Remove=value3,value4,...}
```

-ServicePrincipalNames @{Replace=value1,value2,...}
To replace values: To replace values:
```Powershell
-ServicePrincipalNames @{Replace=value1,value2,...}
```

To clear all values:

-ServicePrincipalNames $null
To clear all values: To clear all values:
```Powershell
-ServicePrincipalNames $null
```

You can specify more than one change by using a list separated by semicolons.
For example, use the following syntax to add and remove service principal names.

@{Add=value1,value2,...};@{Remove=value3,value4,...}
`@{Add=value1,value2,...};@{Remove=value3,value4,...}`

The operators will be applied in the following sequence:

Expand Down
Expand Up @@ -25,7 +25,7 @@ Creates a new Active Directory managed service account or group managed service
## SYNTAX

### Group (Default)
```
```yaml
New-ADServiceAccount [-WhatIf] [-Confirm] [-AccountExpirationDate <DateTime>] [-AccountNotDelegated <Boolean>]
[-AuthenticationPolicy <ADAuthenticationPolicy>] [-AuthenticationPolicySilo <ADAuthenticationPolicySilo>]
[-AuthType <ADAuthType>] [-Certificates <String[]>] [-CompoundIdentitySupported <Boolean>]
Expand All @@ -39,7 +39,7 @@ New-ADServiceAccount [-WhatIf] [-Confirm] [-AccountExpirationDate <DateTime>] [-
```

### RestrictedToSingleComputer
```
```yaml
New-ADServiceAccount [-WhatIf] [-Confirm] [-AccountExpirationDate <DateTime>] [-AccountNotDelegated <Boolean>]
[-AccountPassword <SecureString>] [-AuthenticationPolicy <ADAuthenticationPolicy>]
[-AuthenticationPolicySilo <ADAuthenticationPolicySilo>] [-AuthType <ADAuthType>] [-Certificates <String[]>]
Expand All @@ -51,7 +51,7 @@ New-ADServiceAccount [-WhatIf] [-Confirm] [-AccountExpirationDate <DateTime>] [-
```

### RestrictedToOutboundAuthenticationOnly
```
```yaml
New-ADServiceAccount [-WhatIf] [-Confirm] [-AccountExpirationDate <DateTime>] [-AccountNotDelegated <Boolean>]
[-AuthenticationPolicy <ADAuthenticationPolicy>] [-AuthenticationPolicySilo <ADAuthenticationPolicySilo>]
[-AuthType <ADAuthType>] [-Certificates <String[]>] [-Credential <PSCredential>] [-Description <String>]
Expand Down Expand Up @@ -91,28 +91,28 @@ Then pass these objects through the pipeline to the **New-ADServiceAccount** cmd
## EXAMPLES

### Example 1: Create an enabled managed service account
```
```Powershell
PS C:\> New-ADServiceAccount -Name "Service01" -DNSHostName "Service01.contoso.com" -Enabled $True
```

This command creates an enabled managed service account in Active Directory Domain Services (AD DS).

### Example 2: Create a managed service account and register its service principal name
```
```Powershell
PS C:\> New-ADServiceAccount -Name "Service01" -ServicePrincipalNames "MSSQLSVC/Machine3.corp.contoso.com" -DNSHostName "Service01.contoso.com"
```

This command creates a managed service account and registers its service principal name.

### Example 3: Create a managed service account for a single computer
```
```Powershell
PS C:\> New-ADServiceAccount -Name "Service01" -RestrictToSingleComputer
```

This command creates a managed service account and restricts its use to a single computer.

### Example 4: Create a managed service account for outbound authentication only
```
```Powershell
PS C:\>New-ADServiceAccount -Name "Service01" -RestrictToOutboundAuthenticationOnly
```

Expand Down

0 comments on commit 8073ea4

Please sign in to comment.