<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2015 v4.2.99 Created on: 2/5/2016 11:42 AM Created by: Organization: Filename: =========================================================================== .DESCRIPTION A description of the file. #> # Get the ID and security principal of the current user account $myWindowsID = [System.Security.Principal.WindowsIdentity]::GetCurrent() $myWindowsPrincipal = new-object System.Security.Principal.WindowsPrincipal($myWindowsID) # Get the security principal for the Administrator role $adminRole = [System.Security.Principal.WindowsBuiltInRole]::Administrator # Check to see if we are currently running "as Administrator" if ($myWindowsPrincipal.IsInRole($adminRole)) { # We are running "as Administrator" - so change the title and background color to indicate this $Host.UI.RawUI.BackgroundColor = "Black" Clear-Host } else { # We are not running "as Administrator" - so relaunch as administrator # Create a new process object that starts PowerShell $newProcess = new-object System.Diagnostics.ProcessStartInfo "PowerShell"; # Specify the current script path and name as a parameter $newProcess.Arguments = $myInvocation.MyCommand.Definition; # Indicate that the process should be elevated $newProcess.Verb = "runas"; # Start the new process [System.Diagnostics.Process]::Start($newProcess); # Exit from the current, unelevated, process exit } Enable-WindowsOptionalFeature -FeatureName RSATClient -Online -All -NoRestart | Out-Default; Clear-Host Enable-WindowsOptionalFeature -FeatureName RSATClient-Roles -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-Features -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-ServerManager -Online -NoRestart | Out-Default; Clear-Host Enable-WindowsOptionalFeature -FeatureName RSATClient-Roles-AD -Online -NoRestart | Out-Default; Clear-Host Enable-WindowsOptionalFeature -FeatureName RSATClient-Roles-AD-DS -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-Roles-AD-DS-SnapIns -Online -NoRestart | Out-Default; Clear-Host Enable-WindowsOptionalFeature -FeatureName RSATClient-Roles-AD-Powershell -Online -NoRestart | Out-Default; Clear-Host Enable-WindowsOptionalFeature -FeatureName RSATClient-Roles-AD-DS-AdministrativeCenter -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-Roles-FileServices -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-Roles-FileServices-Dfs -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-Roles-FileServices-SR -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-Roles-FileServices-Nfs -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-Roles-FileServices-FSRM-Management -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-Features-Clustering -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-Features-BitLocker -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-Features-ShieldedVMTools -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-Roles-VA -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-Roles-DNS -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-Roles-CertificateServices -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-Roles-CertificateServices-CA -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-Roles-CertificateServices-OnlineResponder -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-Features-GP -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-Roles-WSUS -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-Roles-WSUS-API -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-Roles-WSUS-UI -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-Roles-DHCP -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-Features-NICTeaming -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-Features-IPAM -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-Features-LoadBalancing -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-Roles-RemoteAccessMgmtTools -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-Roles-RemoteAccessPowerShell -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-Roles-DamgmtTools -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-Roles-RDS -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-Roles-RDS-LicensingUI -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-Roles-RDS-LicensingDiagUI -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-Roles-RDS-Gateway -Online -NoRestart | Out-Default; Clear-Host Disable-WindowsOptionalFeature -FeatureName RSATClient-Features-NetworkControllerTools -Online -NoRestart | Out-Default; Clear-Host Add-Type -AssemblyName "System.Windows.Forms" [void][System.Windows.Forms.MessageBox]::Show("Win 10 ADFS Tools installed. Please restart your system for the changes to take effect.", "Complete")