Skip to content

Instantly share code, notes, and snippets.

View dnewsholme's full-sized avatar

Daryl Newsholme dnewsholme

  • Bradford, UK
View GitHub Profile
@dnewsholme
dnewsholme / Get-UsersGroups.ps1
Created December 16, 2022 11:44
Get-UsersGroups
Function Get-UsersGroups{
param (
$username,
[switch]$recurse
)
#Initialize output variable
$groups = @()
#Search AD user and retrieve the groups removing the unwanted characters from the strings.
((((get-aduser $username -properties memberof).memberof) | `
% {$_ -split(",",2)} | `
bucket = "Synology"
[[inputs.snmp]]
# List of agents to poll
agents = [ "192.168.0.0:161" ] # required - enter the IP address of your Synology device
# Polling interval
interval = "20s"
# Timeout for each SNMP query.
timeout = "10s"
@dnewsholme
dnewsholme / Export-NSG.ps1
Last active March 20, 2023 16:44
Export-NSG.ps1
[CmdletBinding()]
PARAM()
<# CONSTANTS
$AzureDefaultRuleNames contains the names of the defaule rules in an Azure Network Security Group.
These names can be updated if Microsoft introduce new default rules in to Azure Network Security Groups.
#>
$AzureDefaultRuleNames = @("ALLOW VNET INBOUND", "ALLOW AZURE LOAD BALANCER INBOUND", "DENY ALL INBOUND", "ALLOW VNET OUTBOUND", "ALLOW INTERNET OUTBOUND", "DENY ALL OUTBOUND")