Skip to content

Instantly share code, notes, and snippets.

@RobinBeismann
RobinBeismann / Set-DelegateList.ps1
Created October 9, 2020 14:28
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
$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"
}
}
Moved to https://github.com/RobinBeismann/PowerShell-Scripts/blob/master/PKI/Enroll-DMZ-OCSP-Responder-Certificate
<#----------------------------------------------------------------------------------------------------------------------------
August 2017 - Robin Beismann - Michael Wessel Informationstechnologie GmbH
This script creates dummy users for MAC based Microsoft NPS Radius authentication by using MAC Addresses out of a specific
AD User Attribut containing MAC Addresses seperated by semicolas
CAUTION: THIS WILL DELETE ALL USERS OUT OF A SPECIFIC ORGANIZATIONAL UNIT IF THEY MATCH THE SCHEMA!
----------------------------------------------------------------------------------------------------------------------------#>
#Define base OU for the dummy users
@RobinBeismann
RobinBeismann / join.sh
Created January 2, 2018 01:33
PBIS Open Domain Joining
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;
@RobinBeismann
RobinBeismann / Fill-OldOUAttribute.ps1
Last active October 15, 2017 22:46
Code Vorschlag
[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}
}
<#----------------------------------------------------------------------------------------------------------------------------
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>"/>