SOLVED

Deleting Organization on SDS

%3CLINGO-SUB%20id%3D%22lingo-sub-110788%22%20slang%3D%22en-US%22%3EDeleting%20Organization%20on%20SDS%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-110788%22%20slang%3D%22en-US%22%3E%3CP%3EHello.%20I%20want%20to%20delete%20Organization(School)%20on%20SDS.%20(%3CA%20href%3D%22https%3A%2F%2Fsds.microsoft.com%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsds.microsoft.com%3C%2FA%3E)%3C%2FP%3E%3CP%3EHow%20can%20I%20delete%20Organization%3F%3C%2FP%3E%3CP%3EThank%20you.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F21029i0F4ABCA1DDB499FA%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%221234.png%22%20title%3D%221234.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-238265%22%20slang%3D%22en-US%22%3ERe%3A%20Deleting%20Organization%20on%20SDS%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-238265%22%20slang%3D%22en-US%22%3E%3CP%3EHi.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMaybe%20from%20the%20School%20AU%2C%20yes%2C%20as%20it%20is%20deleted.%20But%20person%20objects%20involved%20will%20have%20the%20SDS%20attributes%20still%20in%20place%2C%20not%20a%20problem%2C%20as%20those%20will%20be%20recycled%20if%20resynced%20with%20SDS%2C%20otherwise%20those%20are%20somewhat%20deep%20under%2C%20not%20really%20hidden%2C%20but%20not%20advertised%2C%20and%20not%20visible%20to%20other%20users.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20have%20to%20try%20and%20see...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMF%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-238045%22%20slang%3D%22en-US%22%3ERe%3A%20Deleting%20Organization%20on%20SDS%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-238045%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3EWill%20remove-MsolAdministrative%20unit%20also%20remove%20all%20data%20from%20the%20school%20%3F%3C%2FP%3E%3CP%3EWell%20I%20have%20synced%20the%20csv%20sample%20files%20in%20my%20tenant%20and%20want%20to%20make%20some%20cleanup.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3EJean%20Marie%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-113529%22%20slang%3D%22en-US%22%3ERe%3A%20Deleting%20Organization%20on%20SDS%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-113529%22%20slang%3D%22en-US%22%3E%3CP%3EHello.%3C%2FP%3E%3CP%3EYes%2C%20you%20can.%3C%2FP%3E%3CP%3ETake%20a%20look%20at%20Bill%20Sluss's%20SDS%20Scripts%20here%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FOfficeDev%2FO365-EDU-Tools%2Ftree%2Fmaster%2FSDS%2520Scripts%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FOfficeDev%2FO365-EDU-Tools%2Ftree%2Fmaster%2FSDS%2520Scripts%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAs%20schools%20are%20AdministrativeUnits%20(AUs)%20in%20Azure%20AD%20(AAD)%2C%20you%20must%20use%20AAD's%20AU%20commands%20to%20do%20the%20job.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20script%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FOfficeDev%2FO365-EDU-Tools%2Fblob%2Fmaster%2FSDS%2520Scripts%2FRemove-All_Schools.ps1%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FOfficeDev%2FO365-EDU-Tools%2Fblob%2Fmaster%2FSDS%2520Scripts%2FRemove-All_Schools.ps1%3C%2FA%3E%26nbsp%3Bhas%20a%20perfect%20example%2C%20what%20steps%20are%20needed%20to%20gather%20the%20AUs.%20(I%20love%20the%20part%2C%20where%20those%20scripts%20actually%20check%20for%20and%20install%20if%20needed%20the%20required%20Powershell%20and%20MSOL%20Sign-In%20Assistant...)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EQuick%20fix%20would%20be%20to%20comment%26nbsp%3Bthe%20line%20228%20from%3A%3C%2FP%3E%3CP%3E%3CEM%3E%3CSPAN%20class%3D%22pl-c1%22%3ERemove-MsolAdministrativeUnit%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pl-k%22%3E-%3C%2FSPAN%3EObjectId%20%3CSPAN%20class%3D%22pl-k%22%3E%24%3C%2FSPAN%3E%3CSPAN%20class%3D%22pl-smi%22%3Eau%3C%2FSPAN%3E%3CSPAN%20class%3D%22pl-en%22%3E.ObjectId%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pl-k%22%3E-%3C%2FSPAN%3EForce%26nbsp%3B%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CSPAN%3Eto%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3E%3CSPAN%20class%3D%22pl-c1%22%3E%23Remove-MsolAdministrativeUnit%3C%2FSPAN%3E%26nbsp%3B%3CSPAN%20class%3D%22pl-k%22%3E-%3C%2FSPAN%3EObjectId%26nbsp%3B%3CSPAN%20class%3D%22pl-k%22%3E%24%3C%2FSPAN%3E%3CSPAN%20class%3D%22pl-smi%22%3Eau%3C%2FSPAN%3E%3CSPAN%20class%3D%22pl-en%22%3E.ObjectId%3C%2FSPAN%3E%26nbsp%3B%3CSPAN%20class%3D%22pl-k%22%3E-%3C%2FSPAN%3EForce%26nbsp%3B%3C%2FEM%3E%3C%2FP%3E%3CP%3EJust%20to%20be%20sure%20nothing%20can%20be%20deleted.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENow%20its%20perfectly%20safe%20to%20run%20the%20script%20in%20Powershell%20ISE%2C%20(set%20a%20breakpoint%20at%20line%20227)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E.%5CRemove-All_Schools.ps1%20-RemoveSchoolAus%20%24true%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Erun%20to%20the%20point%20where%20it%20will%20ask%20you%20about%20deleting%20the%20schools%20really%2C%20here%20you%20can%20answer%20yes%20(as%20we%20disabled%20the%20actual%20delete-functionality%20with%20the%20%23%20in%20front%20of%20line%20228)%2C%20let%20the%20program%20run%20until%20breakpoint%20at%20line%20227%20and%20then%20examine%20the%20resulting%20csv%20file%20made.%20(name%20and%20path%20are%20on-screen)%3C%2FP%3E%3CP%3EIt%20will%20contain%20the%20needed%20ObjectIDs%20for%20the%20school%20AUs.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWith%20that%20info%20you%20can%20actually%20delete%20the%20AU%20you%20want%20like%20this%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3ERemove-MsolAdministrativeUnit%20-ObjectId%20%26nbsp%3B1dc48982-fdac-4bd5-b21a-d8997ed11111%20-Force%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThen%20check%20the%20school%20is%20deleted.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPS.%20Kudos%20to%3C%2FP%3E%3CTABLE%3E%3CTBODY%3E%3CTR%3E%3CTD%3E%3CEM%3E%3CSPAN%20class%3D%22pl-c%22%3EWritten%20by%3A%20SDS%20Team%2C%20and%20adapted%20by%20Bill%20Sluss%3C%2FSPAN%3E%3C%2FEM%3E%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%3C%2FP%3E%3CP%3EMarko%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-111763%22%20slang%3D%22en-US%22%3ERe%3A%20Deleting%20Organization%20on%20SDS%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-111763%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20believe%20you%20must%20first%20delete%20any%20sync%20profiles%20that%20include%20the%20organization%2C%20at%20that%20point%20the%20organization%20information%20should%20disappear%20from%20SDS%20after%20a%20day%20or%20two.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Regular Visitor

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

How can I delete Organization?

Thank you.

1234.png

 

 

4 Replies
Highlighted

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.

Highlighted
Best Response confirmed by 수현 김 (Regular Visitor)
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

 

Highlighted

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

 

Highlighted

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