Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $serviceCSV = @"
- Name,VDIStartup,DefaultStartup,DisplayName
- ALG,Disabled,Manual,Application Layer Gateway Service
- BITS,Disabled,Auto,Background Intelligent Transfer Service
- BDESVC,Disabled,Manual,BitLocker Drive Encryption Service
- wbengine,Disabled,Manual,Block Level Backup Engine Service
- bthserv,Disabled,Manual,Bluetooth Support Service
- PeerDistSvc,Disabled,Manual,BranchCache
- Browser,Disabled,Manual,Computer Browser
- DeviceAssociationService,Disabled,Manual,Device Association Service
- DsmSvc,Disabled,Manual,Device Setup Manager
- DPS,Disabled,Auto,Diagnostic Policy Service
- WdiServiceHost,Disabled,Manual,Diagnostic Service Host
- WdiSystemHost,Disabled,Manual,Diagnostic System Host
- TrkWks,Disabled,Auto,Distributed Link Tracking Client
- EFS,Disabled,Manual,Encrypting File System (EFS)
- Eaphost,Disabled,Manual,Extensible Authentication Protocol
- WPCSvc,Disabled,Manual,Family Safety
- Fax,Disabled,Manual,Fax
- fhsvc,Disabled,Manual,File History Service
- FDResPub,Disabled,Manual,Function Discovery Resource Publication
- HomeGroupListener,Disabled,Manual,HomeGroup Listener
- HomeGroupProvider,Disabled,Manual,HomeGroup Provider
- SharedAccess,Disabled,Disabled,Internet Connection Sharing (ICS)
- wlidsvc,Disabled,Manual,Microsoft Account Sign-in Assistant
- MSiSCSI,Disabled,Manual,Microsoft iSCSI Initiator Service
- swprv,Disabled,Manual,Microsoft Software Shadow Copy Provider
- netprofm,Automatic,Manual,Network List Service
- CscService,Disabled,Manual,Offline Files
- defragsvc,Disabled,Manual,Optimize drives
- SstpSvc,Disabled,Manual,Secure Socket Tunneling Protocol Service
- SensrSvc,Disabled,Manual,Sensor Monitoring Service
- ShellHWDetection,Disabled,Auto,Shell Hardware Detection
- SNMPTRAP,Disabled,Manual,SNMP Trap
- SSDPSRV,Disabled,Manual,SSDP Discovery
- TapiSrv,Disabled,Manual,Telephony
- Themes,Disabled,Auto,Themes
- upnphost,Disabled,Manual,UPnP Device Host
- VSS,Disabled,Manual,Volume Shadow Copy
- WcsPlugInService,Disabled,Manual,Windows Color System
- wcncsvc,Disabled,Manual,Windows Connect Now - Config Registrar
- WinDefend,Disabled,Auto,Windows Defender Service
- WerSvc,Disabled,Manual,Windows Error Reporting Service
- WMPNetworkSvc,Disabled,Manual,Windows Media Player Network Sharing Service
- WSearch,Disabled,Auto,Windows Search
- WlanSvc,Disabled,Manual,WLAN AutoConfig
- WwanSvc,Disabled,Manual,WWAN AutoConfig
- "@
- function Set-VDIService {
- Param (
- [switch] $undo,
- [switch] $y
- )
- $recomendedservices = $serviceCSV | ConvertFrom-Csv
- if ($undo -and $y) {
- foreach ($setting in $recomendedservices) {
- Set-Service $setting.Name -StartupType $setting.DefaultStartup
- "Completed setting " + $setting.DisplayName
- }
- }#if undo and y
- elseif ($y) {
- foreach ($setting in $recomendedservices) {
- Set-Service $setting.Name -StartupType $setting.VDIStartup
- "Completed setting " + $setting.DisplayName
- }#foreach
- }#elseif y
- else {
- Write-Error "To make changes to this system, please use the -y parameter"
- }#else
- }#function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement