Month: March 2020

Problem Solving Exercise: Auto Manufacturing Case

Sample Answer 1. Produce a problem statement:We are investigating the root cause of production delays…

PowerShell: File Server Cluster Migration Scripts

<# File-Server-Migration-Intra-Domain.ps1 Purposes: 1. Create Volumes with Labels 2. Create Virtual Clustered File Servers 3.…

PowerShell: Quick EMCopy

# Short Version $arr=@(); $arr+=[PSCustomObject]@{From='D:\Someshare';To='\\NEWSERVER\Someshare'} $arr+=[PSCustomObject]@{From='D:\Test';To='\\NEWSERVER\Test'} # Normal copying # $arr|%{emcopy $_.From $_.To /s /de…

PowerShell: Copying File Share Permissions from Source to Destination

# Copy-SMB-Share-Permissions.ps1 # Set some SMB Share variables $sourceSmbPath="\\FILESERVER002\Home" $destinationSmbPath="\\FILESERVER002-n\Home" $dateStamp = Get-Date -Format "yyyy-MM-dd-hhmmss"…

PowerShell: Expand Volume of Virtual FileServer Role

Option 1: Expanding disk of a Virtual Machine in Hyper-V # ExpandVolumeVirtualFileServerRole.ps1 # Update these…

PowerShell: ADFS Backup and Restore

# AD FS Backup and Restore # Reference documentation: https://docs.microsoft.com/en-us/windows-server/identity/ad-fs/operations/ad-fs-rapid-restore-tool # Set Variables $filePassword="password" $adfsToolDownload="https://download.microsoft.com/download/6/8/A/68AF3CD3-1337-4389-967C-A6751182F286/ADFSRapidRecreationTool.msi"…

PowerShell: Moving Guest VMs in Hyper-V in Conjunction with Microsoft Failover Cluster

This code is outdated. Refactor before reuse.. ############################################################################################################### # HyperV-MoveVM.ps1 # Assumption: Hyper-V has been…

PowerShell: Create Mailbox Report on Office 365

# connect-to-exchange-online.ps1 # How to connect to Office 365 Cloud Services using PowerShell # Office…

PowerShell: Get Active Directory Domain Controller Replication Status

$domaincontroller=(Get-ADForest |Select-Object -ExpandProperty RootDomain |Get-ADDomain |Select-Object -Property PDCEmulator).PDCEmulator; ## Define Objects ## $report = New-Object…

PowerShell: Compressing Files and Folders

# Set variables $compressTarget="C:\Temp\Win2016_Std_Template.ova" $parentFolder=split-path $compressTarget -Parent $grandParentFolder=split-path $parentFolder -Parent $compressedFile=$grandParentFolder+"\compressed.zip" # PowerShell version 5…

PowerShell: Performing System Disk Cleanup

Version 2: # cleanupWindows.ps1 # Version 0.0.2 ################################## Excuting Program as an Administrator #################################### #…

PowerShell: List Biggest Files and Folders on a Volume

# listBigFilesAndFolders-v0.01.ps1 # Set variables $parentDirectory="C:\" $depth=4 $topX=10 $excludeDirectories="C:\Windows","C:\Program Files","C:\Program Files (x86)" $clusterSizeOfNetworkShare=8192 # Sanitize…

Azure: TrafficManager

Requirement Create a Traffic Manager profile for KimConnect using the Azure portal. Overview ---------------------------------"Setup Phase"1.…

PowerShell: Hyper-V Guest-VM C-Volume Expansion

# Hyper-V-Guest-VM-Volume-Expansion.ps1 # Set variables: $vmName="TESTWindows.intranet.kimconnect.net"; $driveLetter="C"; $newSize="160GB"; function selectDisk($vmname){ $paths=(get-vm $vmName | select -expand…

PowerShell: Windows Systems Inventory

<# Systems-Inventory.ps1 Version: 0.04 Purpose: to generate a report with information about servers on the…

PowerShell: Windows System Discovery – Deprecated

<# windows-localhost-discovery-v0.11.ps1 Purpose: scan the local or remote Windows machine for general system resources, security…

PowerShell: Creating Clustered File Shares

# Define Destination Mount Points and UNC Paths $arr=@{} $arr["from"] = @{}; $arr["to"] = @{}…

PowerShell: SMB Shares Migration

$object='\\fileserver\sharename' $identity='domain\account' $permissions='Full' function importNtfsSecurity{ try{ set-executionpolicy unrestricted -force # Include the required NTFSSecurity library…