commit 917dcbb2a2a7047afe3c97ed121fca2d5e5130db
parent 158785027ecf0d0b93089686d9aaeec2d1d16b7d
Author: Administrator@GAMER.EPIC <Administrator@GAMER.EPIC>
Date: Sun, 7 Jun 2020 12:34:56 -0700
bug fixes with users on AD
Diffstat:
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/CyberPolice.bat b/CyberPolice.bat
@@ -3,7 +3,7 @@
SETLOCAL EnableDelayedExpansion
set functions=checkfiles usermgmtff userprop services firewall features passwordpol audit lockout rdp power sessions shares checkdns uac windef backuplsp lsp regharden verifysys auto logging
-set analysisFunctions=allgpo listgpos listdisabledgpos gpoinfo gporeport backupgpos logfirewall logservices netstat checksync manual
+set analysisFunctions=allgpo listgpos listdisabledgpos gpoinfo gporeport backupgpos logfirewall logservices logusers netstat checksync manual
for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do (
set "DEL=%%a"
@@ -849,6 +849,11 @@ dcdiag /q
dcdiag /q > %output%\logs\synclog.txt
goto:EOF
+:logusers
+net user
+net user > %output%\logs\userlog.txt
+goto:EOF
+
:createFile
%powershellPath% -ExecutionPolicy Bypass -File "%powershellScriptPath%/CreateFile.ps1" %~1 %~2
goto:EOF
diff --git a/PowershellScripts/UserList.ps1 b/PowershellScripts/UserList.ps1
@@ -12,8 +12,25 @@ if (!(Test-Path "$path2/users.txt"))
Write-Host "Created users.txt file!" -ForegroundColor Yellow
}
+Write-host "Are you on an AD (Default is No)" -ForegroundColor Yellow
+$Readhost = Read-Host "[Y/N]"
+Switch ($ReadHost) {
+ Y {
+ if (!(Test-Path "$path2/usersAD.txt"))
+ {
+ New-Item $path2/usersAD.txt -ItemType file | Out-Null
+ Write-Host "Created usersAD.txt file!" -ForegroundColor Yellow
+ }
+ Get-ADUser -Filter * | Out-File -FilePath $path2/usersAD.txt
+ Write-Host "AD Users added to text file!" -ForegroundColor Yellow;
+ }
+ N { Write-Host "Ok." -ForegroundColor Gray }
+ Default { Write-Host "Ok." -ForegroundColor Gray }
+}
+
Clear-content "$path2\users.txt"
foreach($l in $accounts){
Add-Content -Path $path2\users.txt -Value $l -PassThru
}
+
Write-Host "Users added to text file!" -ForegroundColor Yellow;