Skip to content

Commit e9f95db

Browse files
committed
add microsoft graph powershell content using zone pivots
1 parent 2198750 commit e9f95db

File tree

1 file changed

+26
-8
lines changed

1 file changed

+26
-8
lines changed

articles/active-directory/manage-apps/restore-application.md

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,11 @@ To recover your enterprise application with its previous configurations, first d
5353
1. To view the recently deleted enterprise application, run the following command:
5454

5555
```powershell
56-
Get-AzureADMSDeletedDirectoryObject -Id 'd4142c52-179b-4d31-b5b9-08940873507b'
57-
```
56+
Get-AzureADMSDeletedDirectoryObject -Id <id>
57+
```
58+
59+
Replace id with the object ID of the service principal that you want to restore.
60+
5861
:::zone-end
5962

6063
:::zone pivot="ms-powershell"
@@ -64,8 +67,10 @@ To recover your enterprise application with its previous configurations, first d
6467
1. To view the recently deleted enterprise applications, run the following command:
6568

6669
```powershell
67-
Get-MgDirectoryDeletedItem -DirectoryObjectId 'd4142c52-179b-4d31-b5b9-08940873507b'
70+
Get-MgDirectoryDeletedItem -DirectoryObjectId <id>
6871
```
72+
Replace id with the object ID of the service principal that you want to restore.
73+
6974
:::zone-end
7075

7176
:::zone pivot="ms-graph"
@@ -77,7 +82,11 @@ To get the list of deleted enterprise applications in your tenant, run the follo
7782
```http
7883
GET https://graph.microsoft.com/v1.0/directory/deletedItems/microsoft.graph.servicePrincipal
7984
```
80-
Record the ID of the enterprise application you want to restore.
85+
From the list of deleted service principals generated, record the ID of the enterprise application you want to restore.
86+
87+
Alternatively, if you want to get the specific enterprise application that was deleted, fetch the deleted service principal and filter the results by the client's application ID (appId) property using the following syntax:
88+
89+
`https://graph.microsoft.com/v1.0/directory/deletedItems/microsoft.graph.servicePrincipal?$filter=appId eq '{appId}'`. Once you've retrieved the object ID of the deleted service principal, proceed to restore it.
8190

8291
:::zone-end
8392

@@ -89,17 +98,23 @@ Record the ID of the enterprise application you want to restore.
8998

9099

91100
```powershell
92-
Restore-AzureADMSDeletedDirectoryObject -Id 'd4142c52-179b-4d31-b5b9-08940873507b'
101+
Restore-AzureADMSDeletedDirectoryObject -Id <id>
93102
```
103+
104+
Replace id with the object ID of the service principal that you want to restore.
105+
94106
:::zone-end
95107

96108
:::zone pivot="ms-powershell"
97109

98110
1. To restore the enterprise application, run the following command:
99111

100112
```powershell
101-
Restore-MgDirectoryObject -DirectoryObjectId 'd4142c52-179b-4d31-b5b9-08940873507b'
113+
Restore-MgDirectoryObject -DirectoryObjectId <id>
102114
```
115+
116+
Replace id with the object ID of the service principal that you want to restore.
117+
103118
:::zone-end
104119

105120
:::zone pivot="ms-graph"
@@ -109,6 +124,9 @@ Record the ID of the enterprise application you want to restore.
109124
```http
110125
POST https://graph.microsoft.com/v1.0/directory/deletedItems/{id}/restore
111126
```
127+
128+
Replace id with the object ID of the service principal that you want to restore.
129+
112130
:::zone-end
113131

114132
## Permanently delete an enterprise application
@@ -121,7 +139,7 @@ Record the ID of the enterprise application you want to restore.
121139
To permanently delete a soft deleted enterprise application, run the following command:
122140

123141
```powershell
124-
Remove-AzureADMSDeletedDirectoryObject -Id 'd4142c52-179b-4d31-b5b9-08940873507b'
142+
Remove-AzureADMSDeletedDirectoryObject -Id <id>
125143
```
126144
:::zone-end
127145

@@ -130,7 +148,7 @@ Remove-AzureADMSDeletedDirectoryObject -Id 'd4142c52-179b-4d31-b5b9-08940873507b
130148
1. To permanently delete the soft deleted enterprise application, run the following command:
131149

132150
```powershell
133-
Remove-MgDirectoryDeletedItem -DirectoryObjectId 'd4142c52-179b-4d31-b5b9-08940873507b'
151+
Remove-MgDirectoryDeletedItem -DirectoryObjectId <id>
134152
```
135153

136154
:::zone-end

0 commit comments

Comments
 (0)