The script is available for download from https://gallery.technet.microsoft.com//How-to-disable-administrati-90b0a8b8. You can also use Microsoft Script Browser for Windows PowerShell ISE to download the sample with one button click from within your scripting environment.
This script sample can disable administrative shares on Windows 8.1.
In general, users are told not to disable Administrative Share because several potential issues may occur. But some users still choose to disable Administrative Share for anyone with administrative access to local computer or domain can access your whole C, D or other partitions. This script will help users easily disable Administrative Share.
You can find more All-In-One Script Framework script samples at https://aka.ms/onescriptingallery