/
githubmirror
/
sssd
Обзор
Документация
Войти
/
githubmirror
/
sssd
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/tests/multihost/ipa/remove-groups.ps1
30 строк
694 B
Steeve Goveas
Add ipa test code
13 ноя 2020, 13:19
13 ноя 2020, 13:19
3c06709
Код
Авторство
О чём код?
#Add the Active Directory module Import-Module ActiveDirectory #set default password $groups = Import-Csv .\groups.csv $nestedgroups = Import-Csv .\nestedgroups.csv foreach ($group in $groups) { try { Write-Output "Remove Group $($group.GroupName)" Remove-ADGroup -Identity $group.GroupName -Confirm:$false } catch [System.Object] { Write-Output "Could not delete group $($group.GroupName)" } } foreach ($nestedgroup in $nestedgroups) { try { Write-Output "Remove NestedGroup $($nestedgroup.NestedGroupName)" Remove-ADGroup -Identity $nestedgroup.NestedGroupName -Confirm:$false } catch [System.Object] { Write-Output "Could not delete group $($group.GroupName)" } }