• .\MyScript.ps1 2>&1 | tee -filePath c:\results.txt Explained: tee (tee-object) cmdlet redirects output into two directions, stores in a file or var and sends down the pipeline. In our use, it sends to a file and also displays on console. 2>&1  construct, (stderr) 2> redirects the standard and appends the &1 (stderr…



  • #call out the paramenter and data type, in our case [string]. param( [string]$arg1 ) if ($arg1 -eq “revert”) { ‘do this’ }else { ‘do that’ } write-host $arg1 #shows the string Usage example: test.ps1 revert  



  • Master  powershell’s extensibility’s use of functions is key real life application of PS scripts. Parameters are primarily known as input functions, where information can be passed and validated. Below is an example of how of passing a parameter and setting static validation sets: Param( [parameter(Mandatory=$true)] [ValidateSet(“Low”, “Average”, “High”)] [String[]]$Detail ) Reference:…



  • nc -C mail.domain.com 25 HELO senderdomain.com MAIL FROM:sender@example.org RCPT TO:rcpt@example.com DATA From: sender@example.org To: rcpt@example.com Subject: subject example Date: Fri, 10 Jan 2019 12:00:00 +0000 . QUIT



  • Exploring Hashmaps in Powershell $keep = @{} //declare an empty hashmap /* Next add all the shared mailboxes to the hashmap */ $keep = get-mailbox | ? { $_.recipienttypedetails -eq ‘sharedmailbox’ } | % { $keep.add($_.name,$_.primarysmtpaddress) } /* Big assumption for this next portion: I’ll assume you’ve put the list of…




  •   Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Select DisplayName, ItemCount, TotalItemSize | Export-CSV C:\temp\results.csv  



  • A Blue Screen of Death (BSOD), also called a STOP Error (Typically shows a STOP Code) , fatal system error, or system crash. BSOD will cause the System or Windows OS to stop abruptly ensuring no further damage occurs because it can no longer able to operate safely. Causes: BSODs are…



  • OPUtil.vbs   Issue: “Error code is 2771,1635,1603″ popping up when installing SP3 Rollup 17 on Exchange 2010.  Cause: Generally this issue is caused by the Rollup installation searching and failing to find the previous rollups or missing components. Troubleshooting: Clear the data in the “%SystemDrive%\Windows\TEMP”folder. Try to re-install the update rollup…



  • DNS stands for domain name system – It is one of the most frequently asked interview questions when applying for a job in Information Technology (IT). DNS controls your domain’s website and e-mail configurations and settings. When someone visits your website/domain like tecism.com, the DNS record controls which name server (NS…