forked from KurtDeGreeff/PlayPowershell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCustom.ps1
65 lines (42 loc) · 2.31 KB
/
Custom.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
"Path = "+ (Split-Path -parent $MyInvocation.MyCommand.Definition)
# Free Space on C:
$DiskDrive = Get-WmiObject -Class Win32_LogicalDisk | Where {$_.DeviceId -Eq "C:"}
$DriveSpace = ($DiskDrive.FreeSpace /1GB)
"Free Diskspace C: = $DriveSpace GB"
#Available RAM
"RAM = "+((Get-WmiObject Win32_OperatingSystem).TotalVisibleMemorySize / 1kb).tostring("F00") +" MB"
# Don't hide file extensions
# $ext = New-Object -ComObject WScript.Shell
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name HideFileExt -Value 0
#Disable autorun
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name NoDriveTypeAutorun -Value 255
# Disable Backup Notifications
# $ext.RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsBackup\DisableMonitoring","1","REG_DWORD")
Set-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsBackup -Name DisableMonitoring -Value 1
# Disable BitLocker Drive Encryption Service, HomeGroupListener,HomeGroupProvider,Ipv6,iSCSI,VPN,TabletInputService,Offline Files,..
Set-Service -Name BDESVC -StartupType disabled
Set-Service -Name HomeGroupListener -StartupType disabled
Set-Service -Name HomeGroupProvider -StartupType disabled
Set-Service -Name iphlpsvc -StartupType disabled
Set-Service -Name MSiSCSI -StartupType disabled
Set-Service -Name SstpSvc -StartupType disabled
Set-Service -Name SSDPSRV -StartupType disabled
# Set-Service -Name wscsvc -StartupType disabled
Set-Service -Name TabletInputService -StartupType disabled
Set-Service -Name upnphost -StartupType disabled
Set-Service -Name ehRecvr -StartupType disabled
Set-Service -Name ehSched -StartupType disabled
Set-Service -Name WwanSvc -StartupType disabled
Set-Service -Name CscService -StartupType disabled
#Disables User Access Control (UAC)
#Set-ItemProperty -path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableLUA -Value 0
#Turn off Default Network Location Dialogue
New-Item HKLM:\System\CurrentControlSet\Control\Network\NewNetworkWindowOff
#Run winrm quickconfig defaults
echo Y | winrm quickconfig
#Run enable psremoting command with defaults
enable-psremoting -force
#Enabled Trusted Hosts for Universal Access
cd wsman:\localhost\client
Set-Item TrustedHosts * -force
restart-Service winrm