Skip to content

Commit f0613f5

Browse files
Update Get-ADServiceAccount.md
add cross-domain example, remove LDS in -Partition parameter as GMSAs don't exist in LDS
1 parent 8a35f5e commit f0613f5

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

docset/winserver2022-ps/activedirectory/Get-ADServiceAccount.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ HostComputers :
7070
DistinguishedName : CN=service1,CN=Managed Service Accounts,DC=contoso,DC=com
7171
```
7272

73-
This command gets a managed service account with SAM account name service1.
73+
This command gets a managed service account with SAM account name `service1`.
7474

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

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

111+
### Example 4: Get a managed service account from another domain by name
112+
```powershell
113+
PS C:\> Get-ADServiceAccount -Identity service1 -server server1.child1.contoso.com
114+
```
115+
```output
116+
Enabled : True
117+
Name : service1
118+
UserPrincipalName :
119+
SamAccountName : service1$
120+
ObjectClass : msDS-ManagedServiceAccount
121+
SID : S-1-5-21-2216061493-1510163535-4121908508-4603
122+
ObjectGUID : 7b4705e0-036a-49ad-a01f-23c124ea1552
123+
HostComputers :
124+
DistinguishedName : CN=service1,CN=Managed Service Accounts,dc=child1,DC=contoso,DC=com
125+
```
126+
127+
This command gets a managed service account with SAM account name `service1` in domain `child1.contoso.com`.
128+
111129
## PARAMETERS
112130

113131
### -AuthType
@@ -260,13 +278,7 @@ In AD DS environments, a default value for **Partition** will be set in the foll
260278
- If running cmdlets from an Active Directory provider drive, the default value of **Partition** is automatically generated from the current path in the drive.
261279
- 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.
262280

263-
In AD LDS environments, a default value for Partition will be set in the following cases:
264-
265-
- If the **Identity** parameter is set to a distinguished name, the default value of **Partition** is automatically generated from this distinguished name.
266-
- If running cmdlets from an Active Directory provider drive, the default value of **Partition** is automatically generated from the current path in the drive.
267-
- If the target AD LDS instance has a default naming context, the default value of **Partition** will be set to the default naming context.
268-
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.
269-
- If none of the previous cases apply, the **Partition** parameter will not take any default value.
281+
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.
270282

271283
```yaml
272284
Type: String

0 commit comments

Comments
 (0)