Skip to content

Instantly share code, notes, and snippets.

View web.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="swaggerwcf" type="SwaggerWcf.Configuration.SwaggerWcfSection, SwaggerWcf" />
<section name="lithnetResourceManagementClient" type="Lithnet.ResourceManagement.Client.ClientConfigurationSection, Lithnet.ResourceManagement.Client" />
</configSections>
<appSettings>
<add key="pageCacheIntervalSeconds" value="60" />
</appSettings>
<swaggerwcf>
View chunks.ps1
if($membersToAdd.Count -gt 0){
Write-Host("Writing membersToAdd")
$chunkArr = $membersToAdd
$chunks = [System.Collections.ArrayList]::new()
for ($i = 0; $i -lt $chunkArr.Count; $i += 20) {
if(($chunkArr.Count - $i) -gt 19) {
$null = $chunks.add($chunkArr[$i..($i + 19)])
}else{
$null = $chunks.add($chunkArr[$i..($chunkArr.Count - 1)])
View Bomgar PSADT.ps1
$installParams = @(
"--jc-name `"$($env:computername)`"",
"--install-dir `"$AgentInstallPath`"",
"--jc-jump-group `"jumpgroup:$BomgarJumpGroup`"",
"--jc-session-policy-present `"$BomgarSessionPolicy_Customer_present`"",
"--jc-session-policy-not-present `"$BomgarSessionPolicy_Customer_not_present`"",
"--silent"
)
Write-Log -Message "Installing Bomgar to $AgentInstallPath"
Write-Log -Message "Executing: $binary $($installParams -join " ")"
View Set-DelegateList.ps1
#Load Modules
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn;
Import-Module ActiveDirectory
try{
Write-Host("Retrieving AD Users")
$ADUsers = Get-ADUser -Filter * -Properties objectSID, msExchMasterAccountSid, sidHistory, msExchDelegateListLink -ErrorAction Stop
Write-Host("Retrieving Mailbox Permissions")
$MailboxPerm = Get-MailboxPermission -ResultSize Unlimited -Identity * -ErrorAction Stop
View Bomgar Script Detection Method.ps1
$installFolder = "$env:ProgramFiles\BomgarJumpClient"
if(
(Test-Path -Path $installFolder) -and
(Test-Path -Path "$installFolder\bomgar-scc.exe") -and
(Test-Path -Path "$installFolder\server.lic")
){
Get-ChildItem -Path $installFolder | Where-Object { $_.LastWriteTime -gt (Get-Date).AddDays(-7) } | ForEach-Object {
"Installed"
}
}
View Renew-OCSPResponderCertificate.ps1
Moved to https://github.com/RobinBeismann/PowerShell-Scripts/blob/master/PKI/Enroll-DMZ-OCSP-Responder-Certificate
@RobinBeismann
RobinBeismann / join.sh
Created Jan 2, 2018
PBIS Open Domain Joining
View join.sh
wget https://github.com/BeyondTrust/pbis-open/releases/download/8.5.7/pbis-open-8.5.7.385.linux.x86_64.deb.sh;
chmod +x pbis-open-*.sh;
./pbis-open-*.sh;
/opt/pbis/bin/domainjoin-cli join contoso.com binduser "bindpw";
pam-auth-update --force;
/opt/pbis/bin/config UserDomainPrefix CONTOSO;
View Correct-ADPrimaryGroup.ps1
#region Variable Definition
$dryRun = $true
$searchBase = (Get-ADDomain).DistinguishedName
#endregion
#region Code below
#Gather the DomainSID
$domainSID = (Get-ADDomain).DomainSid.Value
#Fix on one DC so we don't run into replication problems after adding a user to a group
View Fill-OldOUAttribute.ps1
[regex]$regex = "(?:,)(?'name'((CN|OU=).*))"
Get-ADUser -Filter * -SearchBase "OU=Benutzer,DC=ad2016,DC=faq-o-matic,DC=net" | ForEach-Object {
$ou = $regex.Match($_.DistinguishedName).Groups['name']
Write-Host($_.Name + ": $ou")
$_ | Set-ADUser -Add @{info=$ou}
}
View Copy-CRLs.ps1
<#----------------------------------------------------------------------------------------------------------------------------
August 2017 - Robin Beismann - Michael Wessel Informationstechnologie GmbH
This script copys the CRLs from the different sites onto the DMZ Webserver(s)
config.xml may look like:
<Config>
<source share="<to be filled>" username="<to be filled>" password="<to be filled>"/>
<destination share="<to be filled>" username="<to be filled>" password="<to be filled>"/>