SOLVED

Deleting Organization on SDS

Copper Contributor

Hello. I want to delete Organization(School) on SDS. (https://sds.microsoft.com)

How can I delete Organization?

Thank you.

1234.png

 

 

4 Replies

Hello,

 

I believe you must first delete any sync profiles that include the organization, at that point the organization information should disappear from SDS after a day or two.

best response confirmed by 수현 김 (Copper Contributor)
Solution

Hello.

Yes, you can.

Take a look at Bill Sluss's SDS Scripts here: https://github.com/OfficeDev/O365-EDU-Tools/tree/master/SDS%20Scripts

 

As schools are AdministrativeUnits (AUs) in Azure AD (AAD), you must use AAD's AU commands to do the job.

 

This script https://github.com/OfficeDev/O365-EDU-Tools/blob/master/SDS%20Scripts/Remove-All_Schools.ps1 has a perfect example, what steps are needed to gather the AUs. (I love the part, where those scripts actually check for and install if needed the required Powershell and MSOL Sign-In Assistant...)

 

Quick fix would be to comment the line 228 from:

Remove-MsolAdministrativeUnit -ObjectId $au.ObjectId -Force 

to

#Remove-MsolAdministrativeUnit -ObjectId $au.ObjectId -Force 

Just to be sure nothing can be deleted.

 

Now its perfectly safe to run the script in Powershell ISE, (set a breakpoint at line 227)

 

.\Remove-All_Schools.ps1 -RemoveSchoolAus $true 

 

run to the point where it will ask you about deleting the schools really, here you can answer yes (as we disabled the actual delete-functionality with the # in front of line 228), let the program run until breakpoint at line 227 and then examine the resulting csv file made. (name and path are on-screen)

It will contain the needed ObjectIDs for the school AUs.

 

With that info you can actually delete the AU you want like this:

 

Remove-MsolAdministrativeUnit -ObjectId  1dc48982-fdac-4bd5-b21a-d8997ed11111 -Force

 

Then check the school is deleted.

 

PS. Kudos to

Written by: SDS Team, and adapted by Bill Sluss

 

Regards

Marko

 

Hello,

Will remove-MsolAdministrative unit also remove all data from the school ?

Well I have synced the csv sample files in my tenant and want to make some cleanup.

 

Thanks,

Jean Marie

 

Hi.

 

Maybe from the School AU, yes, as it is deleted. But person objects involved will have the SDS attributes still in place, not a problem, as those will be recycled if resynced with SDS, otherwise those are somewhat deep under, not really hidden, but not advertised, and not visible to other users. 

 

You have to try and see...

 

MF

1 best response

Accepted Solutions
best response confirmed by 수현 김 (Copper Contributor)
Solution

Hello.

Yes, you can.

Take a look at Bill Sluss's SDS Scripts here: https://github.com/OfficeDev/O365-EDU-Tools/tree/master/SDS%20Scripts

 

As schools are AdministrativeUnits (AUs) in Azure AD (AAD), you must use AAD's AU commands to do the job.

 

This script https://github.com/OfficeDev/O365-EDU-Tools/blob/master/SDS%20Scripts/Remove-All_Schools.ps1 has a perfect example, what steps are needed to gather the AUs. (I love the part, where those scripts actually check for and install if needed the required Powershell and MSOL Sign-In Assistant...)

 

Quick fix would be to comment the line 228 from:

Remove-MsolAdministrativeUnit -ObjectId $au.ObjectId -Force 

to

#Remove-MsolAdministrativeUnit -ObjectId $au.ObjectId -Force 

Just to be sure nothing can be deleted.

 

Now its perfectly safe to run the script in Powershell ISE, (set a breakpoint at line 227)

 

.\Remove-All_Schools.ps1 -RemoveSchoolAus $true 

 

run to the point where it will ask you about deleting the schools really, here you can answer yes (as we disabled the actual delete-functionality with the # in front of line 228), let the program run until breakpoint at line 227 and then examine the resulting csv file made. (name and path are on-screen)

It will contain the needed ObjectIDs for the school AUs.

 

With that info you can actually delete the AU you want like this:

 

Remove-MsolAdministrativeUnit -ObjectId  1dc48982-fdac-4bd5-b21a-d8997ed11111 -Force

 

Then check the school is deleted.

 

PS. Kudos to

Written by: SDS Team, and adapted by Bill Sluss

 

Regards

Marko

 

View solution in original post