Skip to content

Commit 940d571

Browse files
committed
edit pass: reference-powershell
1 parent 5ed4844 commit 940d571

File tree

1 file changed

+54
-96
lines changed

1 file changed

+54
-96
lines changed

articles/active-directory/cloud-sync/reference-powershell.md

Lines changed: 54 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 'AADCloudSyncTools PowerShell Module for Azure AD Connect cloud sync'
2+
title: 'AADCloudSyncTools PowerShell module for Azure AD Connect cloud sync'
33
description: This article describes how to install the Azure AD Connect cloud provisioning agent.
44
services: active-directory
55
author: billmath
@@ -13,111 +13,69 @@ ms.author: billmath
1313
ms.collection: M365-identity-device-management
1414
---
1515

16-
# AADCloudSyncTools PowerShell Module for Azure AD Connect cloud sync
16+
# AADCloudSyncTools PowerShell module for Azure AD Connect cloud sync
1717

18-
The AADCloudSyncTools module provides a set of useful tools that you can use to help manage your Azure AD Connect Cloud Sync deployments.
18+
The AADCloudSyncTools module provides a set of useful tools that can help you manage your deployments of Azure Active Directory Connect (Azure AD Connect) cloud sync.
1919

2020
## Prerequisites
21-
The following prerequisites are required:
2221

23-
- All the prerequisites for this module can be automatically installed using `Install-AADCloudSyncToolsPrerequisites`
24-
- This module uses MSAL authentication, so it requires MSAL.PS module installed. To verify, in a PowerShell window, execute `Get-module MSAL.PS -ListAvailable`. If the module is installed correctly you will get a response. You can use `Install-AADCloudSyncToolsPrerequisites` to install the latest version of MSAL.PS
25-
- Although the AzureAD PowerShell module is not a prerequisite for any functionality of this module it is useful to be present, so it is also automatically installed when using `Install-AADCloudSyncToolsPrerequisites`.
26-
- Installing modules from PowerShell Gallery requires TLS 1.2 enforcement. The cmdlet `Install-AADCloudSyncToolsPrerequisites` sets TLS 1.2 enforcement before installing all the prerequisites. To ensure that you can manually install modules, set the following in the PowerShell session before using `Install-Module`:
22+
You can automatically install all the prerequisites for the AADCloudSyncTools module by using `Install-AADCloudSyncToolsPrerequisites`. You'll do that in the next section of this article.
23+
24+
Here are some details about what you need:
25+
26+
- The AADCloudSyncTools module uses Microsoft Authentication Library (MSAL) authentication, so it requires installation of the MSAL.PS module. To verify the installation, in a PowerShell window, run `Get-module MSAL.PS -ListAvailable`. If the module is installed correctly, you'll get a response. If necessary, you can use `Install-AADCloudSyncToolsPrerequisites` to install the latest version of MSAL.PS.
27+
- Although the Azure AD PowerShell module is not required for any functionality of the AADCloudSyncTools module, it is useful. So it's automatically installed when you use `Install-AADCloudSyncToolsPrerequisites`.
28+
- Installing modules from the PowerShell Gallery requires Transport Layer Security (TLS) 1.2 enforcement. The cmdlet `Install-AADCloudSyncToolsPrerequisites` sets TLS 1.2 enforcement before installing all the prerequisites. To ensure that you can manually install modules, set the following in the PowerShell session before using the cmdlet:
29+
2730
```
2831
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
2932
```
3033

3134

3235
## Install the AADCloudSyncTools PowerShell module
33-
To install and use AADCloudSyncTools module use the following steps:
34-
35-
1. Open Windows PowerShell with administrative privileges
36-
2. Type or copy and paste the following: `Import-module -Name "C:\Program Files\Microsoft Azure AD Connect Provisioning Agent\Utility\AADCloudSyncTools"`
37-
3. Hit enter.
38-
4. To verify the module was imported, enter or copy and paste the following: `Get-module AADCloudSyncTools`
39-
5. You should now see information about the module.
40-
6. Next, to install the AADCloudSyncTools module pre-requisites run: `Install-AADCloudSyncToolsPrerequisites`
41-
7. On the first run, the PoweShellGet module will be installed if not present. To load the new PowershellGet module close the PowerShell Window and open a new PowerShell session with administrative privileges.
42-
8. Import the module again using step 2.
43-
9. Run `Install-AADCloudSyncToolsPrerequisites` to install the MSAL and AzureAD modules
44-
11. All prerequisites should be successfully installed
45-
![Install module](media/reference-powershell/install-1.png)
46-
12. Every time you want to use AADCloudSyncTools module in new PowerShell session, enter or copy and paste the following:
47-
```
48-
Import-module "C:\Program Files\Microsoft Azure AD Connect Provisioning Agent\Utility\AADCloudSyncTools"
49-
```
50-
51-
52-
## AADCloudSyncTools Cmdlets
53-
### Connect-AADCloudSyncTools
54-
Uses the MSAL.PS module to request a token for the Azure AD administrator to access Microsoft Graph
55-
56-
57-
### Export-AADCloudSyncToolsLogs
58-
Exports and packages all the troubleshooting data in a compressed file, as follows:
59-
1. Sets verbose tracing and starts collecting data from the provisioning agent (same as `Start-AADCloudSyncToolsVerboseLogs`)
60-
<br>You can find these trace logs in the folder `C:\ProgramData\Microsoft\Azure AD Connect Provisioning Agent\Trace` </br>
61-
2. Stops data collection after 3 minutes and disables verbose tracing (same as `Stop-AADCloudSyncToolsVerboseLogs`)
62-
<br>You can specify a different duration with `-TracingDurationMins` or completely skip verbose tracing with `-SkipVerboseTrace` </br>
63-
3. Collects Event Viewer Logs for the last 24 hours
64-
4. Compresses all the agent logs, verbose logs and event viewer logs into a compressed zip file under the User's Documents folder
65-
<br>You can specify a different output folder with `-OutputPath <folder path>` </br>
66-
67-
### Get-AADCloudSyncToolsInfo
68-
Shows Azure AD Tenant details and internal variables state
69-
70-
### Get-AADCloudSyncToolsJob
71-
Uses Graph to get AD2AAD Service Principals and returns the Synchronization Job information.
72-
Can be also called using the specific Sync Job ID as a parameter.
73-
74-
### Get-AADCloudSyncToolsJobSchedule
75-
Uses Graph to get AD2AAD Service Principals and returns the Synchronization Job's Schedule.
76-
Can be also called using the specific Sync Job ID as a parameter.
77-
78-
### Get-AADCloudSyncToolsJobSchema
79-
Uses Graph to get AD2AAD Service Principals and returns the Synchronization Job's Schema.
80-
81-
### Get-AADCloudSyncToolsJobScope
82-
Uses Graph to get the Synchronization Job's Schema for the provided Sync Job ID and outputs all filter group's scopes.
83-
84-
### Get-AADCloudSyncToolsJobSettings
85-
Uses Graph to get AD2AAD Service Principals and returns the Synchronization Job's Settings.
86-
Can be also called using the specific Sync Job ID as a parameter.
87-
88-
### Get-AADCloudSyncToolsJobStatus
89-
Uses Graph to get AD2AAD Service Principals and returns the Synchronization Job's Status.
90-
Can be also called using the specific Sync Job ID as a parameter.
91-
92-
### Get-AADCloudSyncToolsServicePrincipal
93-
Uses Graph to get the Service Principal(s) for AD2AAD and/or SyncFabric.
94-
Without parameters, will only return AD2AAD Service Principal(s).
95-
96-
### Install-AADCloudSyncToolsPrerequisites
97-
Checks for the presence of PowerShellGet v2.2.4.1 or later and Azure AD and MSAL.PS modules and installs these if missing.
98-
99-
### Invoke-AADCloudSyncToolsGraphQuery
100-
Invokes a Web request for the URI, Method and Body specified as parameters
101-
102-
### Repair-AADCloudSyncToolsAccount
103-
Uses Azure AD PowerShell to delete the current account (if present) and resets the Sync Account authentication with a new synchronization account in Azure AD.
104-
105-
### Restart-AADCloudSyncToolsJob
106-
Restarts a full synchronization.
107-
108-
### Resume-AADCloudSyncToolsJob
109-
Continues synchronization from the previous watermark.
110-
111-
### Start-AADCloudSyncToolsVerboseLogs
112-
Modifies the 'AADConnectProvisioningAgent.exe.config' to enable verbose tracing and restarts the AADConnectProvisioningAgent service
113-
You can use -SkipServiceRestart to prevent service restart but any config changes will not take effect. You can find these trace logs in the folder C:\ProgramData\Microsoft\Azure AD Connect Provisioning Agent\Trace.
114-
115-
### Stop-AADCloudSyncToolsVerboseLogs
116-
Modifies the 'AADConnectProvisioningAgent.exe.config' to disable verbose tracing and restarts the AADConnectProvisioningAgent service.
117-
You can use -SkipServiceRestart to prevent service restart but any config changes will not take effect.
118-
119-
### Suspend-AADCloudSyncToolsJob
120-
Pauses synchronization.
36+
37+
1. Open Windows PowerShell with administrative privileges.
38+
2. Run `Import-module -Name "C:\Program Files\Microsoft Azure AD Connect Provisioning Agent\Utility\AADCloudSyncTools"`.
39+
3. To verify that the module was imported, run `Get-module AADCloudSyncTools`.
40+
41+
You should now see information about the module.
42+
4. To install the AADCloudSyncTools module prerequisites, run `Install-AADCloudSyncToolsPrerequisites`.
43+
5. On the first run, the PowerShellGet module will be installed if it's not present. To load the new PowerShellGet module, close the PowerShell window and open a new PowerShell session with administrative privileges.
44+
6. Import the module again by running `Import-module -Name "C:\Program Files\Microsoft Azure AD Connect Provisioning Agent\Utility\AADCloudSyncTools"`.
45+
7. Run `Install-AADCloudSyncToolsPrerequisites` again to install the MSAL and Azure AD modules.
46+
47+
All prerequisites should now be installed.
48+
49+
![Screenshot of the notification in the PowerShell window that says the prerequisites were installed successfully.](media/reference-powershell/install-1.png)
50+
8. Every time you want to use the AADCloudSyncTools module in a new PowerShell session, run the following command:
51+
52+
```
53+
Import-module "C:\Program Files\Microsoft Azure AD Connect Provisioning Agent\Utility\AADCloudSyncTools"
54+
```
55+
56+
57+
## AADCloudSyncTools cmdlets
58+
59+
|Cmdlet|Purpose|
60+
|-----|-----|
61+
|`Connect-AADCloudSyncTools`|Uses the MSAL.PS module to request a token for the Azure AD administrator to access Microsoft Graph.
62+
|`Export-AADCloudSyncToolsLogs`|Exports and packages all the troubleshooting data in a compressed file, as follows: </br><br>1. Sets verbose tracing and starts collecting data from the provisioning agent (same as `Start-AADCloudSyncToolsVerboseLogs`). <br>You can find these trace logs in the folder *C:\ProgramData\Microsoft\Azure AD Connect Provisioning Agent\Trace*. </br></br>2. Stops data collection after three minutes and disables verbose tracing (same as `Stop-AADCloudSyncToolsVerboseLogs`). <br>You can specify a different duration by using `-TracingDurationMins` or completely skip verbose tracing by using `-SkipVerboseTrace`. </br></br>3. Collects Event Viewer logs for the last 24 hours. </br></br>4. Compresses all the agent logs, verbose logs, and Event Viewer logs into a .zip file in the user's *Documents* folder. <br>You can specify a different output folder by using `-OutputPath <folder path>`. </br>
63+
|`Get-AADCloudSyncToolsInfo`|Shows Azure AD tenant details and the state of internal variables.
64+
|`Get-AADCloudSyncToolsJob`|Uses Microsoft Graph to get Azure AD service principals and returns the sync job information. Can also be called using the specific sync job ID as a parameter.
65+
|`Get-AADCloudSyncToolsJobSchedule`|Uses Microsoft Graph to get Azure AD service principals and returns the sync job's schedule. Can also be called using the specific sync job ID as a parameter.
66+
|`Get-AADCloudSyncToolsJobSchema`|Uses Microsoft Graph to get Azure AD service principals and returns the sync job's schema.
67+
|`Get-AADCloudSyncToolsJobScope`|Uses Microsoft Graph to get the sync job's schema for the provided sync job ID and outputs all filter groups' scopes.
68+
|`Get-AADCloudSyncToolsJobSettings`|Uses Microsoft Graph to get Azure AD service principals and returns the sync job's settings. Can also be called using the specific sync job ID as a parameter.
69+
|`Get-AADCloudSyncToolsJobStatus`|Uses Microsoft Graph to get Azure AD service principals and returns the sync job's status. Can also be called using the specific sync job ID as a parameter.
70+
|`Get-AADCloudSyncToolsServicePrincipal`|Uses Microsoft Graph to get the service principals for Azure AD and/or Azure Service Fabric. Without parameters, will only return Azure AD service principals.
71+
|`Install-AADCloudSyncToolsPrerequisites`|Checks for the presence of PowerShellGet v2.2.4.1 or later and Azure AD and MSAL.PS modules, and installs these if they're missing.
72+
|`Invoke-AADCloudSyncToolsGraphQuery`|Invokes a web request for the URI, method, and body specified as parameters.
73+
|`Repair-AADCloudSyncToolsAccount`|Uses Azure AD PowerShell to delete the current account (if present) and resets the sync account authentication with a new synchronization account in Azure AD.
74+
|`Restart-AADCloudSyncToolsJob`|Restarts a full synchronization.
75+
|`Resume-AADCloudSyncToolsJob`|Continues synchronization from the previous watermark.
76+
|`Start-AADCloudSyncToolsVerboseLogs`|Modifies *AADConnectProvisioningAgent.exe.config* to enable verbose tracing and restarts the AADConnectProvisioningAgent service. You can use `-SkipServiceRestart` to prevent service restart, but any configuration changes will not take effect. You can find these trace logs in the folder *C:\ProgramData\Microsoft\Azure AD Connect Provisioning Agent\Trace*.
77+
|`Stop-AADCloudSyncToolsVerboseLogs`|Modifies *AADConnectProvisioningAgent.exe.config* to disable verbose tracing and restarts the AADConnectProvisioningAgent service. You can use `-SkipServiceRestart` to prevent service restart, but any configuration changes will not take effect.
78+
|`Suspend-AADCloudSyncToolsJob`|Pauses synchronization.
12179

12280
## Next steps
12381

0 commit comments

Comments
 (0)