Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Get-ADServiceAccount.md #3887

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 20 additions & 8 deletions docset/winserver2022-ps/activedirectory/Get-ADServiceAccount.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ HostComputers :
DistinguishedName : CN=service1,CN=Managed Service Accounts,DC=contoso,DC=com
```

This command gets a managed service account with SAM account name service1.
This command gets a managed service account with SAM account name `service1`.

### Example 2: Get a managed service account by its SID
```powershell
Expand Down Expand Up @@ -108,6 +108,24 @@ DistinguishedName : CN=service1,CN=Managed Service Accounts,DC=contoso,DC=com

This command gets the managed service accounts allowed to be used on the computer `CN=SQL-Server-1,DC=contoso,DC=com`.

### Example 4: Get a managed service account from another domain by name
```powershell
PS C:\> Get-ADServiceAccount -Identity service1 -server server1.child1.contoso.com
```
```output
Enabled : True
Name : service1
UserPrincipalName :
SamAccountName : service1$
ObjectClass : msDS-ManagedServiceAccount
SID : S-1-5-21-2216061493-1510163535-4121908508-4603
ObjectGUID : 7b4705e0-036a-49ad-a01f-23c124ea1552
HostComputers :
DistinguishedName : CN=service1,CN=Managed Service Accounts,dc=child1,DC=contoso,DC=com
```

This command gets a managed service account with SAM account name `service1` in domain `child1.contoso.com`.

## PARAMETERS

### -AuthType
Expand Down Expand Up @@ -260,13 +278,7 @@ In AD DS environments, a default value for **Partition** will be set in the foll
- If running cmdlets from an Active Directory provider drive, the default value of **Partition** is automatically generated from the current path in the drive.
- If none of the previous cases apply, the default value of **Partition** will be set to the default partition or naming context of the target domain.

In AD LDS environments, a default value for Partition will be set in the following cases:

- If the **Identity** parameter is set to a distinguished name, the default value of **Partition** is automatically generated from this distinguished name.
- If running cmdlets from an Active Directory provider drive, the default value of **Partition** is automatically generated from the current path in the drive.
- If the target AD LDS instance has a default naming context, the default value of **Partition** will be set to the default naming context.
To specify a default naming context for an AD LDS environment, set the **msDS-defaultNamingContext** property of the Active Directory directory service agent (DSA) object (**nTDSDSA**) for the AD LDS instance.
- If none of the previous cases apply, the **Partition** parameter will not take any default value.
The parameter is only useful for snapshots. On live AD domains, the domain NC is the only allowed partition, relative to the value of the “-server” parameter.

```yaml
Type: String
Expand Down
Loading