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
| SigninLogs | |
| | where parse_json(tostring(parse_json(NetworkLocationDetails)[0].networkNames))[0] == "Guest WiFi" | |
| | where DeviceDetail.trustType == "Hybrid Azure AD joined" | |
| | extend displayName_ = tostring(DeviceDetail.displayName) | |
| | project UserPrincipalName, displayName_ | |
| | summarize count() by UserPrincipalName, displayName_ | |
| | sort by count_ |
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
| <# | |
| https://community.fortinet.com/t5/FortiGate/Technical-Tip-List-of-TCP-and-UDP-ports-used-by-the-FSSO/ta-p/194130 | |
| UDP/8002 – DC Agent keepalive and push logon info to Collector Agent | |
| TCP/8001 – FortiGate to FSSO Collector Agent connection (SSL) | |
| TCP/8000 – FortiGate to FSSO Collector Agent connection | |
| TCP/8000 – NTLM | |
| #> | |
| $fgtIP = '192.168.0.1' | |
| $DCs = @('192.168.0.51', '192.168.0.52', '192.168.0.61', '192.168.0.62') |
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
| get-content $env:systemroot\system32\LogFiles\Firewall\pfirewall.log | Select-Object -Last 20 |
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
| ### Set Common Parameters ### | |
| $now = Get-Date -UFormat "%Y-%m-%d_%H-%M-%S" | |
| $extNIC = "Ethernet" | |
| $extSM = "255.255.255.0" | |
| $outpath = "c:\temp\" | |
| $outscriptname = "setIP_postwork.ps1" | |
| $outfile = $outpath + $outscriptname | |
| $CheckFilePath = Test-Path $outfile | |
| ## Get the current IPv4 info for external NIC ## | |
| $NetIPextnic = (Get-NetIPAddress -AddressFamily IPv4 -InterfaceAlias $extnic) |
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
| $now = Get-Date -UFormat "%Y-%m-%d_%H-%M-%S" | |
| $filepath = 'C:\temp\Service_Accounts_' + $now + '.csv' | |
| Get-ADUser -Filter * -Searchbase "DC=domain,DC=com" -Properties * | Export-CSV -append -NoTypeInformation $filepath |
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
| $files = Get-ChildItem -file -Path "C:temp\" | |
| ForEach ($file in $files) { | |
| Rename-Item -Path $file.FullName -NewName ([String]$(Get-Random) + $file.Extension) | |
| } |
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
| # Changes | |
| ConfigurationChange | |
| | take 5 | |
| # Data | |
| ConfigurationData | |
| | take 5 | |
| # Changes by Computer | |
| ConfigurationChange |
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
| Remove-Item ` | |
| -Path HKLM:SoftwarePoliciesMicrosoftWindowsWindowsUpdate ` | |
| -Force ` | |
| -Recurse ` | |
| -ErrorAction SilentlyContinue; | |
| Stop-Service -Name wuauserv; | |
| Start-Service -Name wuauserv; | |
| (New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow() |
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
| let oldest = ProtectionStatus | |
| | where TimeGenerated < ago(1h) | |
| | top 10 by TimeGenerated desc; | |
| let newest = ProtectionStatus | |
| | where TimeGenerated < ago(1h) | |
| | top 10 by TimeGenerated asc; | |
| union oldest, newest |
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
| SigninLogs | |
| | where Status contains "MFA" | |
| | project TimeGenerated,OperationName,ResultDescription,AuthenticationRequirement,Status.additionalDetails,AuthenticationDetails,ConditionalAccessPolicies |
NewerOlder