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: docs-conceptual/azureadps-2.0-preview/signing-in-service-principal.md
+12-12Lines changed: 12 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ ms.reviewer: rodejo
17
17
18
18
This example describes how you can use a Service Principal to connect to your directory from within PowerShell. You would use this approach if you wanted to run an unattended script, as from Windows Scheduled tasks.
19
19
20
-
To enable this, we need to perform several steps.
20
+
To enable this, several steps must be performed.
21
21
22
22
## Sign in to Azure AD PowerShell with an admin account
## Give the Service Principal Reader access to the current tenant (Get-AzureADDirectoryRole)
68
68
69
69
We now have the ability to set the exact access rights this service principal has in your directory. In this example, we'll assign the access rights of the Directory Readers role in Azure AD:
We can now sign in to the directory using the new service principal.
79
+
We can now sign in to the directory using the new service principal.
80
80
> Note: if you;re running all these commands in one script, as you probably would do when trying this out, please remember that Azure AD requires some time to sync all the information you just entered through all of its components. In that case, add a Sleep cmdlet call here, this will make the script processing pause for 5 seconds:
81
81
82
-
```powershell
83
-
Sleep -s 5
84
-
```
85
-
82
+
```powershell
83
+
Sleep -s 5
84
+
```
85
+
86
86
To sign in you will need to find the ObjectID of the tenant you want to sign in to:
0 commit comments