Category: Codes

PowerShell: Check ADFS for Duplicate Identifiers

function checkDuplicateIdf{ write-host "Checking each relying party trust for any duplicates of identifiers..." $trusts=Get-AdfsRelyingPartyTrust $allTrustNames=$trusts.Name…

PowerShell: Creating Active Directory Accounts from CSV File

# User-input Variables $csvFile='C:\Users\rambo\Desktop\newUsers-finalized.csv' $newOu='CN=Users,DC=kimconnect,DC=com' $newCompany='KimConnect.com' $logFile="c:\temp\createActiveDirectoryAccounts-$(get-date -f yyyy-mm-dd-hh-mm-ss).txt" function createActiveDirectoryAccounts{ param( $csvFile, $newOu, $newCompany,…

PowerShell: Maintain Chocolatey Applications

This current version has some bugs... Review these other codes for some ideas on fixing...…

Add Chocolatey Private Repo

$privateRepo='kimconnectrepo' $privateRepoUrl='https://choco.kimconnect.net/chocolatey' $priority=1 # Set private repo source if it doesn't exist function addRepo{ param(…

PowerShell: Uninstalling an Application

$appname='Google Chrome' function uninstallApp($appName){ $alternativeMethod=$false try{ $app = Get-WmiObject -Class Win32_Product | Where-Object{$_.Name -eq $appName}…

PowerShell: Disable Microsoft Dynamics CRM Organization

# disableCrmOrganization.ps1 $orgname='testOrg' $domain='kimconnect.com' $dnsServer='10.10.10.10' $credentials=@{ 'kimconnect\crmAdmin'='password'; 'kimconnect\devAdmin'='password'; } $usernamePrefix='kimconnect\crm' $servernameSuffix='-app01' $ipDictionary=@{ 'dev01'='1.1.1.1'; 'prod01'='2.2.2.2'; }…

PowerShell: CredSSP

# Part 1: enable client mode on the local jump box $remoteComputer='SHERVER009' Enable-WSManCredSSP Client -DelegateComputer…

PowerShell: Check Active Directory Username Collisions

$originalCsvFile='C:\Users\rambo\Desktop\Usernames.csv' $newCsvFile='C:\Users\rambo\Desktop\Usernames-processed.csv' function checkUsernameCollisions($originalCsv,$newCsv){ $csvContents=import-csv $originalCsv write-host "Pulling existing records from Active Directory of $env:USERDNSDOMAIN..."…

PowerShell: Microsoft Dynamics Update All Organizations

# updateCrmOrgs.ps1 function updateCrmOrgs{ try{ Add-PSSnapin Microsoft.Crm.Powershell $servers=Get-CrmServer $highestVersion=($servers.Version|measure-object -Maximum).Maximum $lowVersionServers=$servers|?{[version]$_.Version -lt [version]$highestVersion} if($lowVersionServers){ write-warning…

PowerShell: Adding a New Domain Controller

Error when trying to run DCPROMO on a Windows 2019 Server: ---------------------------Active Directory Domain Services…

PowerShell: Perform Windows Discovery of Services, Connections, and Security Settings

# windowsDiscovery.ps1 function checkSpectreVulnerability($computer=$env:computername){ $command={ $patchedVersion="10.0.14393.2842" $actualVersion=(Get-Item C:\Windows\system32\mcupdate_genuineintel.dll | select VersionInfo).VersionInfo.ProductVersion $intelDllPatched=[version]$actualVersion -ge [version]$patchedVersion <#…

PowerShell: Update CSV File Using Active Directory

# adAccountsCsvUpdate.ps1 $originalCsv='C:\Users\rambo\Desktop\kimconnectUsers.csv' $newCsv='C:\Users\rambo\Desktop\kimconnectUsers-processed.csv' $newEmailSuffix='@kimconnect.com' $newOu='OU=Test,DC=kimconnect,DC=com' function adAccountsCsvUpdate{ param( $originalCsv, $newCsv, $newEmailSuffix, $newOu ) function…

Installing IBM VPN Client

On a Linux Machine # Install VPN Client shellScript=https://support.arraynetworks.net/prx/001/http/supportportal.arraynetworks.net/downloads/pkg_9_4_0_385/MP_Linux_1.2.9/MotionPro_Linux_Ubuntu_x64_build-8.sh cd Desktop wget $shellScript sudo ./MotionPro_Linux_Ubuntu_x64_build-8.sh…

PowerShell: Dealing with Service Principle Names (SPNs)

Basic Commands: # Show SPNs$computername="$env:computername"Get-ADComputer -Identity $computername -Properties ServicePrincipalNames |Select-Object -ExpandProperty ServicePrincipalNames# Add one SPNSet-ADComputer…

Optimizing Windows IIS Server

Most IIS instances are fine with default settings. However, it's often beneficial to configure some…

PowerShell: How To Invoke Rest Method with RingCentral Rest API

[string]$restApiTokenUrl="https://platform.ringcentral.com/restapi/oauth/token" [string]$restApiUrl="https://platform.ringcentral.com/restapi/v1.0/account/~/extension?page=1" [string]$username='15555555555' [string]$password='PASSWORDHERE' [string]$extension='100' [string]$appKey='APPKEYHERE' # Part 1: Obtain Rest-API Token / Authorization function…

PowerShell: How To Set IP and Domain Restrictions to Specific IIS Sites

# Enable IP Filtering Feature in IIS using PowerShell Install-WindowsFeature Web-IP-Security Restart-Service W3SVC # Optional:…

Hyper-V Servers Report

# hyperVServersReport.ps1 # Version: 0.0.1 # Description: # This script will scan for Hyper-V Hosts…

Kubernetes Container Deployment with NFS Persistent Volumes

Introduction: Update: we have provided a practical application of the knowledge conveyed in this article…