Skip to content

Commit 15df491

Browse files
authored
Merge pull request #97668 from anwarmahmood1/patch-2
include Microsoft Graph PowerShell SDK examples
2 parents 49df825 + 994e80c commit 15df491

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

articles/active-directory/roles/admin-units-manage.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,27 @@ In Azure AD, you can delete an administrative unit that you no longer need as a
109109

110110
1. To confirm that you want to delete the administrative unit, select **Yes**.
111111

112-
### PowerShell
112+
### PowerShell - AzureAD Module
113113

114114
Use the [Remove-AzureADMSAdministrativeUnit](/powershell/module/azuread/remove-azureadmsadministrativeunit) command to delete an administrative unit.
115115

116116
```powershell
117117
$adminUnitObj = Get-AzureADMSAdministrativeUnit -Filter "displayname eq 'DeleteMe Admin Unit'"
118118
Remove-AzureADMSAdministrativeUnit -Id $adminUnitObj.Id
119119
```
120+
### PowerShell - Microsoft Graph PowerShell SDK
121+
122+
```
123+
Import-Module Microsoft.Graph.Identity.DirectoryManagement
124+
125+
$params = @{
126+
DisplayName = "Seattle District Technical Schools"
127+
Description = "Seattle district technical schools administration"
128+
Visibility = "HiddenMembership"
129+
}
130+
131+
New-MgDirectoryAdministrativeUnit -BodyParameter $params
132+
```
120133

121134
### Microsoft Graph API
122135

0 commit comments

Comments
 (0)