-
Notifications
You must be signed in to change notification settings - Fork 0
/
Get-BasicEnum.ps1
54 lines (45 loc) · 2.4 KB
/
Get-BasicEnum.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
54
function Get-BasicEnum{
$error.clear()
$noPerms = New-Object System.Collections.Generic.List[System.Object]
gci c:\users
gci c:\users | ForEach-Object {
gci $_.FullName -ErrorAction SilentlyContinue | Out-Null
if ($error) {
$noPerms.add("$($_.fullname)")
$error.clear()
}
else {
$desktop="$($_.FullName)\Desktop"
$documents="$($_.FullName)\Documents"
#gci $_.FullName -ErrorAction SilentlyContinue
gci $documents -Force
gci $($_.fullname).Destktop -Force
}
}
write-output "##############################################################################"
$noPerms | foreach-object { write-output "Permission denied for paths $_"}
write-output "##############################################################################"
write-output 'Directory listing of C:\'
gci 'c:\'
write-output "##############################################################################"
write-output 'Directory listing of C:\'
gci 'C:\Program Files'
write-output "##############################################################################"
write-output 'Directory listing of C:\Program Files (x86)'
gci 'C:\Program Files (x86)'
write-output "##############################################################################"
write-output 'Process List'
get-process | select ProcessName, Path
write-output "##############################################################################"
write-output 'Services'
Get-WmiObject win32_service | select Name, DisplayName, @{Name="Path"; Expression={$_.PathName.split('"')[1]}} | Format-List
write-output "##############################################################################"
write-output 'Non-Standard Services'
Get-wmiobject win32_service | where { $_.Caption -notmatch "Windows" -and $_.PathName -notmatch "Windows" -and $_.PathName -notmatch "policyhost.exe" -and $_.Name -ne "LSM" -and $_.PathName -notmatch "OSE.EXE" -and $_.PathName -notmatch "OSPPSVC.EXE" -and $_.PathName -notmatch "Microsoft Security Client" }
write-output "##############################################################################"
write-output 'GPO Results'
gpresult.exe /Z
write-output "##############################################################################"
write-output 'netstat output'
netstat -anp tcp
}