You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/active-directory/cloud-sync/how-to-gmsa-cmdlets.md
+39-32Lines changed: 39 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,22 +7,22 @@ manager: karenhoran
7
7
ms.service: active-directory
8
8
ms.workload: identity
9
9
ms.topic: how-to
10
-
ms.date: 11/16/2020
10
+
ms.date: 07/01/2022
11
11
ms.subservice: hybrid
12
12
ms.author: billmath
13
13
ms.collection: M365-identity-device-management
14
14
---
15
15
16
16
# Azure AD Connect cloud provisioning agent gMSA PowerShell cmdlets
17
17
18
-
The purpose of this document is to describe the Azure AD Connect cloud provisioning agent gMSA PowerShell cmdlets. These cmdlets allow you to have more granularity on the permissions that are applied on the service account (gMSA). By default, Azure AD Connect cloud sync applies all permissions similar to Azure AD Connect on the default gMSA or a custom gMSA.
18
+
The purpose of this document is to describe the Azure AD Connect cloud provisioning agent gMSA PowerShell cmdlets. These cmdlets allow you to have more granularity on the permissions that are applied on the service account (gMSA). By default, Azure AD Connect cloud sync applies all permissions similar to Azure AD Connect on the default gMSA or a custom gMSA, during cloud provisioning agent install.
19
19
20
20
This document will cover the following cmdlets:
21
21
22
-
`Set-AADCloudSyncRestrictedPermissions`
23
-
24
22
`Set-AADCloudSyncPermissions`
25
23
24
+
`Set-AADCloudSyncRestrictedPermissions`
25
+
26
26
## How to use the cmdlets:
27
27
28
28
The following prerequisites are required to use these cmdlets.
@@ -32,34 +32,26 @@ The following prerequisites are required to use these cmdlets.
32
32
2. Import Provisioning Agent PS module into a PowerShell session.
33
33
34
34
```powershell
35
-
Import-Module "C:\Program Files\Microsoft Azure AD Connect Provisioning Agent\Microsoft.CloudSync.Powershell.dll"
35
+
Import-Module "C:\Program Files\Microsoft Azure AD Connect Provisioning Agent\Microsoft.CloudSync.Powershell.dll"
36
36
```
37
37
38
-
3. Remove existing permissions. To remove all existing permissions on the service account, except SELF use: `Set-AADCloudSyncRestrictedPermission`.
39
-
40
-
This cmdlet requires a parameter called `Credential` which can be passed, or it will prompt if called without it.
38
+
3. These cmdlets require a parameter called `Credential` which can be passed, or will prompt the user if not provided in the command line. Depending on the cmdlet syntax used, these credentials must be an enterprise admin account or, at a minimum, a domain administrator of the target domain where you're setting the permissions.
41
39
42
-
To create a variable, use:
40
+
4.To create a variable for credentials, use:
43
41
44
42
`$credential = Get-Credential`
43
+
44
+
5. To set Active Directory permissions for cloud provisioning agent, you can use the following cmdlet. This will grant permissions in the root of the domain allowing the service account to manage on-premises Active Directory objects. See [Using Set-AADCloudSyncPermissions](#using-set-aadcloudsyncpermissions) below for examples on setting the permissions.
45
45
46
-
This will prompt the user to enter username and password. The credentials must be at a minimum domain administrator(of the domain where agent is installed), could be enterprise admin as well.
47
-
48
-
4. Then you can call the cmdlet to remove extra permissions:
6. To restrict Active Directory permissions set by default on the cloud provisioning agent account, you can use the following cmdlet. This will increase the security of the service account by disabling permission inheritance and removing all existing permissions, except SELF and Full Control for administrators. See [Using Set-AADCloudSyncRestrictedPermission](#using-set-aadcloudsyncrestrictedpermissions) below for examples on restricting the permissions.
55
49
56
-
`Set-AADCloudSyncRestrictedPermissions` which will prompt for credentials.
57
-
58
-
6. Add specific permission type. Permissions added are same as Azure AD Connect. See [Using Set-AADCloudSyncPermissions](#using-set-aadcloudsyncpermissions) below for examples on setting the permissions.
`Set-AADCloudSyncPermissions` supports the following permission types which are identical to the permissions used by Azure AD Connect. The following permission types are supported:
54
+
`Set-AADCloudSyncPermissions` supports the following permission types which are identical to the permissions used by Azure AD Connect Classic Sync (ADSync). The following permission types are supported:
63
55
64
56
|Permission type|Description|
65
57
|-----|-----|
@@ -69,28 +61,43 @@ The following prerequisites are required to use these cmdlets.
69
61
|HybridExchangePermissions|See [HybridExchangePermissions](../../active-directory/hybrid/how-to-connect-configure-ad-ds-connector-account.md#permissions-for-exchange-hybrid-deployment) permissions for Azure AD Connect|
70
62
|ExchangeMailPublicFolderPermissions| See [ExchangeMailPublicFolderPermissions](../../active-directory/hybrid/how-to-connect-configure-ad-ds-connector-account.md#permissions-for-exchange-mail-public-folders) permissions for Azure AD Connect|
71
63
|CloudHR| Applies 'Create/delete User objects' on 'This object and all descendant objects'|
72
-
|All|adds all the above permissions.|
64
+
|All| Applies all the above permissions|
73
65
74
66
You can use AADCloudSyncPermissions in one of two ways:
75
-
-[Grant a certain permission to all configured domains](#grant-a-certain-permission-to-all-configured-domains)
76
-
-[Grant a certain permission to a specific domain](#grant-a-certain-permission-to-a-specific-domain)
67
+
-[Grant permissions to all configured domains](#grant-permissions-to-all-configured-domains)
68
+
-[Grant permissions to a specific domain](#grant-permissions-to-a-specific-domain)
77
69
78
-
## Grant a certain permission to all configured domains
70
+
## Grant permissions to all configured domains
79
71
80
72
Granting certain permissions to all configured domains will require the use of an enterprise admin account.
81
73
82
74
```powershell
83
-
Set-AADCloudSyncPermissions -PermissionType "Any mentioned above" -EACredential $credential (prepopulated same as above [$credential = Get-Credential])
## Grant a certain permission to a specific domain
79
+
## Grant permissions to a specific domain
87
80
88
-
Granting certain permissions to a specific domain will require the use of, at minimum a domain admin account of the domain you are attempting to add.
81
+
Granting certain permissions to a specific domain will require the use of a TargetDomainCredential that is enterprise admin or, domain admin of the target domain. The TargetDomain has to be already configured through wizard.
89
82
90
83
```powershell
91
-
Set-AADCloudSyncPermissions -PermissionType "Any mentioned above" -TargetDomain "FQDN of domain" (has to be already configured through wizard) -TargetDomainCredential $credential(same as above)
Note: for 1. The credentials must be at a minimum Enterprise admin.
95
-
96
-
For 2. The Credentials can be either Domain admin or enterprise admin.
88
+
## Using Set-AADCloudSyncRestrictedPermissions
89
+
For increased security, `Set-AADCloudSyncRestrictedPermissions` will tighten the permissions set on the cloud provisioning agent account itself. Hardening permissions on the cloud provisioning agent account involves the following changes:
90
+
91
+
- Disable inheritance
92
+
- Remove all default permissions, except ACEs specific to SELF.
93
+
- Set Full Control permissions for SYSTEM, Administrators, Domain Admins, and Enterprise Admins.
94
+
- Set Read permissions for Authenticated Users and Enterprise Domain Controllers.
95
+
96
+
The -Credential parameter is necessary to specify the Administrator account that has the necessary privileges to restrict Active Directory permissions on the cloud provisioning agent account. This is typically the domain or enterprise administrator.
0 commit comments