This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $passwd = (Get-Content /etc/passwd).ForEach({ | |
| $userfields = $_ -split ':' | |
| return [pscustomobject]@{ | |
| UserName = $UserFields[0] | |
| ShadowFile = $(if ($userfields[1] -eq 'x') { $true }else { $false }) | |
| UserId = $UserFields[2] | |
| GroupId = $userfields[3] | |
| FullName = $Userfields[4] | |
| HomeDirectory = $UserFields[5] | |
| ShellAccount = $Userfields[6] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $Users = get-aduser -Filter {admincount -gt 0} -Properties adminCount -ResultSetSize $null | |
| $Users | Select-Object Name, UserPrincipalName, SamAccountName |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs -Wait } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Test-WinCredential { | |
| <# | |
| .SYNOPSIS | |
| Validates Windows user credentials. | |
| .DESCRIPTION | |
| Validates a [pscredential] instance representing user-account credentials | |
| against the current user's logon domain or local machine. | |
| .PARAMETER Credential |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [appdomain]::CurrentDomain.GetAssemblies() | ForEach { | |
| Try { | |
| $_.GetExportedTypes() | Where { | |
| $_.Fullname -match 'Exception' | |
| } | |
| } Catch {} | |
| } | Select FullName |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $Error[0].Exception.GetType().FullName |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Generate Report of BitLocker Status for Computers in the BitLocker Machines OU. | |
| # Sources: https://4sysops.com/archives/find-bitlocker-recovery-passwords-in-active-directory-with-powershell/ | |
| param([string]$OutputDirectory="~/Desktop",[string]$OrganizationalUnit=([adsi]'').distinguishedName) | |
| if(!([Security.Principal.WindowsPrincipal] ` | |
| [Security.Principal.WindowsIdentity]::GetCurrent() ` | |
| ).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { | |
| Write-Host -ForegroundColor Yellow "Only Administrators can read BitLocker Recovery Keys." | |
| exit | |
| } | |
| $computers = Get-ADComputer -Filter * -SearchBase $OrganizationalUnit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker run \ | |
| --name {{printf "%q" .Name}} \ | |
| {{- with .HostConfig}} | |
| {{- if .Privileged}} | |
| --privileged \ | |
| {{- end}} | |
| {{- if .AutoRemove}} | |
| --rm \ | |
| {{- end}} | |
| {{- if .Runtime}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 4444 ssl http2; | |
| listen [::]:4444 ssl http2; | |
| server_name CHANGE_SERVERNAME; | |
| ssl_certificate /usr/syno/etc/certificate/system/default/ECC-fullchain.pem; | |
| ssl_certificate_key /usr/syno/etc/certificate/system/default/ECC-privkey.pem; | |
| ssl_trusted_certificate /usr/syno/etc/certificate/system/default/ECC-fullchain.pem; | |
| add_header Strict-Transport-Security "max-age=15768000; includeSubdomains; preload" always; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Hide border on tab bar, force its state to 'scroll', adjust margin-left for width of scrollbar. | |
| #tabbar { | |
| border: 0; | |
| overflow-y: scroll !important; | |
| margin-left: -18px !important; | |
| } | |
| */ | |
| /* Hide .twisty and adjust margins so favicons have 7px on left. */ | |
| .tab .twisty { |
OlderNewer