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
$tenantFQDN = "<TENANT NAME>.ONMICROSOFT.COM" # <= CONFIGURE THIS!!!!! | |
$applicationName = "<APPLICATION DISPLAY NAME>" # <= CONFIGURE THIS!!!!! | |
Invoke-Command -ArgumentList $tenantFQDN,$applicationName -ScriptBlock { | |
Param ( | |
$tenantFQDN, | |
$applicationName | |
) | |
<# |
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
# To generate and export the certificate, local administrator rights in an elevated PowerShell window are required! | |
$certPurpose = "<CERTIFICATE PURPOSE>" # "Authentication", "Token Signing", "Token Encryption" # <= CONFIGURE THIS!!!!! | |
$svcDisplayName = "<SERVICE DISPLAY NAME AND/OR FQDN>" # <= CONFIGURE THIS!!!!! | |
$keyLength = 4096 # 4096 | 2048 # <= CONFIGURE THIS!!!!! | |
$daysBeforeToday = 0 # <= CONFIGURE THIS!!!!! (Positive Number For AFTER Today, Negative Number For Before Today!) | |
$daysAfterToday = 397 # 13 Months (Best Practice According To DigiCert) # <= CONFIGURE THIS!!!!! | |
$selfSignedCert = Invoke-Command -ArgumentList $certPurpose,$svcDisplayName,$keyLength,$daysBeforeToday,$daysAfterToday -ScriptBlock { | |
Param ( |
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
$tenantFQDN = "<TENANT NAME>.ONMICROSOFT.COM" # <= CONFIGURE THIS!!!!! | |
$appRegDisplayName = "<APPLICATION DISPLAY NAME>" # <= CONFIGURE THIS!!!!! | |
$credentialType = "<CREDENTIAL TYPE>" # "Secret" OR "Certificate" <= CONFIGURE THIS!!!!! | |
$lifetimeSecretInDays = 365 # <= CONFIGURE THIS!!!!! | |
$certCERFilePath = "<CERTIFICATE CER FILE PATH>" # <= CONFIGURE THIS!!!!! | |
$mailboxMailAddress = "<MAIL ADDRESS OF MAILBOX TO ALLOW TO SEND MAIL FROM>" # <= CONFIGURE THIS!!!!! | |
Invoke-Command -ArgumentList $tenantFQDN,$appRegDisplayName,$credentialType,$lifetimeSecretInDays,$certCERFilePath,$mailboxMailAddress -ScriptBlock { | |
Param ( | |
$tenantFQDN, |
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
Invoke-Command -ScriptBlock { | |
Clear-Host | |
Write-Host "" | |
Write-Host "###############################################################################" -Foregroundcolor Yellow | |
Write-Host "### SECURING THE DEFAULT DOMAIN ADMIN ACCOUNT ###" -Foregroundcolor Yellow | |
Write-Host "###############################################################################" -Foregroundcolor Yellow | |
$defaultDomainAdm = Get-ADUser -Identity "$((Get-ADDomain).DomainSID.value)-500" -Properties description,mail,memberOf,"msDS-PrincipalName","msDS-SupportedEncryptionTypes",servicePrincipalNames,userAccountControl -Server $((Get-ADDomain).PDCEmulator) | |
If ($defaultDomainAdm."msDS-PrincipalName" -ne ([Security.Principal.WindowsIdentity]::GetCurrent()).Name) { |
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
#------- | |
# Configuring New Or Existing GPO With The GenCounter System Service To NOT Start (i.e., Disable Generation ID) | |
#------- | |
$gpoName = "<Name Of Existing Or New GPO>" # <=== CONFIGURE !!!! | |
Invoke-Command -ArgumentList $gpoName -Scriptblock { | |
Param ( | |
$gpoName | |
) | |
Clear-Host | |
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
#------- | |
# Fixing Broken DFS-R Replication Group Replication Between All Replication Group Members While Assigning A Primary Member As Source | |
#------- | |
# ASSUMPTIONS: | |
# * Name Resolution Works | |
# * All DCs In The AD Domain Are Available/Up And Running | |
# * All DCs In The AD Domain Are Reachable For LDAP, ADWS, Remote Management, WMI | |
# * The Account Used To Execute This Has AT LEAST "Domain Admin" Equivalent Permissions In The AD Domain Being Processed | |
# * The Content Of The SYSVOL Of The Chosen DC To Be The Primary Member Is Healthy | |
#--------------------#-----------------------#-----------------------#-----------------------#-----------------------#----------------------- |