Skip to content

Instantly share code, notes, and snippets.

Darren Robinson darrenjrobinson

Block or report user

Report or block darrenjrobinson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View who is home and away.ps1
# Clients to Monitor
$uInterestingClients = @()
$uInterestingClients += "myPhone"
$uInterestingClients += "otherPhone"
$uInterestingClients += "anotherPhone"
# Unifi Controller Login Base URI
$uController = 'yourControllerIP' # e.g 'https://192.168.1.2:8443'
# Identifier of the site in UniFi. Set to Default to use the default site
$uSiteID = "default"
@darrenjrobinson
darrenjrobinson / Get-Unifi-Details.ps1
Last active Jul 15, 2019
PowerShell Script to get Ubiquiti Unifi Sites, Devices and Active Clients. Associated blogpost https://blog.darrenjrobinson.com/accessing-your-ubiquiti-unifi-network-configuration-with-powershell/
View Get-Unifi-Details.ps1
# Unifi Controller Login Base URI
$uController = 'yourControllerIP' # e.g 'https://192.168.1.2:8443'
# Identifier of the site in UniFi. Set to default for the default site
$uSiteID = "default"
$uUsername = 'adminuser' # yourAdmin UserID
$uPassword = 'yourPassword' # yourAdmin User Password
$uAuthBody = @{"username" = $uUsername; "password" = $uPassword }
$uHeaders = @{"Content-Type" = "application/json" }
View import.ps1
param (
$Username,
$Password,
$OperationType,
[bool] $usepagedimport,
$pagesize,
$Credentials
)
$DebugFilePath = "C:\Program Files\Microsoft Forefront Identity Manager\2010\Synchronization Service\Extensions\RACF\Debug\racfUsersImport.txt"
View schema.ps1
# RACF Minimal Schema to support a Join Rule
$obj = New-Object -Type PSCustomObject
$obj | Add-Member -Type NoteProperty -Name "Anchor-racfID|String" -Value ""
$obj | Add-Member -Type NoteProperty -Name "objectClass|String" -Value "racfUser"
$obj
View connect to zOS.ps1
# wc3270 HTTPD Config from wc3270 Start Options e.g. wc3270 A:mainframe.customer.com.au -httpd 127.0.0.1:6001
$wc3270HTTPDHost = "127.0.0.1" # e.g FQDN of host running it, or localhost DNS Name or IP
$wc3270HTTPDPort = "6001" # HTTPD Port
$racfHost = "zoshost.customer.com.au" # z/OS Host
$racfUserID = "ADMINUserName" # RACF UserID
$racfUserPassword = "AdminPassword" # RACF Password
$tracelog = "c:\temp\zOStracelog.txt" # TraceLogPath
$wc3270Path = "C:\Program Files\wc3270" # wc3270 Install Path
$wc3270Args = "A:$($racfHost) -httpd $($wc3270HTTPDHost):$($wc3270HTTPDPort) -trace -tracefile `"$($tracelog)`" -utf8"
View import.ps1
param (
$Username,
$Password,
$OperationType,
[bool] $usepagedimport,
$pagesize,
$Credentials
)
$DebugFilePath = "C:\Program Files\Microsoft Forefront Identity Manager\2010\Synchronization Service\Extensions\OID\Debug\usersImport.txt"
View schema.ps1
# Oracle eBusiness Suite OID LDAP Schema
$obj = New-Object -Type PSCustomObject
$obj | Add-Member -Type NoteProperty -Name "Anchor-orclguid|String" -Value ""
$obj | Add-Member -Type NoteProperty -Name "objectClass|String" -Value "ldapUser"
$obj | Add-Member -Type NoteProperty -Name "company|string" -Value "string"
$obj | Add-Member -Type NoteProperty -Name "middlename|string" -Value "string"
$obj | Add-Member -Type NoteProperty -Name "preferredname|string" -Value "string"
$obj | Add-Member -Type NoteProperty -Name "departmentnumber|string" -Value "string"
$obj | Add-Member -Type NoteProperty -Name "DistinguishedName|string" -Value "string"
$obj | Add-Member -Type NoteProperty -Name "paygroup|string" -Value "string"
View Get ChangeLog.ps1
# Uses slightly different query that for general users as ChangeLog is extremely perscriptive on format in Oracle Internet Directory
$changeNumber = "8781760"
$changeResponse = $null
$ldapCredentials = New-Object System.Net.NetworkCredential($username,$password)
$ldapConnection = New-Object System.DirectoryServices.Protocols.LDAPConnection("$($server):$($port)",$ldapCredentials,"Basic")
$changeFilter = "(&(targetdn=*$($ldapSearchBase))(changeNumber>=$($changeNumber)))"
$changeTimeOut = new-timespan -Seconds 30
$changeRequest = New-Object System.DirectoryServices.Protocols.SearchRequest("cn=changelog", $changeFilter, "OneLevel", $null)
$changeResponse = $ldapConnection.SendRequest($changeRequest, $changeTimeOut)
$changeResponse.Entries
@darrenjrobinson
darrenjrobinson / Get OID User.ps1
Last active Jun 12, 2019
PowerShell Connect to Oracle Internet Directory and return object as Text. Associated blogpost https://blog.darrenjrobinson.com/querying-oracle-internet-directory-ldap-with-powershell/
View Get OID User.ps1
# Needs reference to .NET assembly used in the script.
Add-Type -AssemblyName System.DirectoryServices.Protocols
function Get-LdapObject {
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[ValidateNotNull()]
[System.DirectoryServices.Protocols.LdapConnection] $LdapConnection,
[Parameter(ParameterSetName = 'DistinguishedName',
View Connect to OID.ps1
# Needs reference to .NET assembly used in the script.
Add-Type -AssemblyName System.DirectoryServices.Protocols
$username = 'cn=ldapUser'
$pwd = 'S3cur3P@$$W0rd'
$server = "ldap.customer.com.au"
$port = "80001"
$password = $pwd | ConvertTo-SecureString -asPlainText -Force
# Top Level OU under which users are located
$ldapSearchBase = "cn=users,dc=customer,dc=com,dc=au"
# Filter to find the user we are connecting with
You can’t perform that action at this time.