How to Handle a Terminated Employee’s Email

How to Handle a Terminated Employee’s Email
  1. Change the former employee’s password
  2. Choose who will handle any future emails addressed to the former employee
  3. Setup an auto respond to reply to incoming emails
  4. Setup a filter to forward emails to the employee’s replacement
  5. Wait for a set amount of time (2 weeks to 1 month)
  6. Backup and delete the former employee’s account

Process Process Process.........

Change the Former Employee’s Password
Hopefully this goes without saying, but your absolute first step should be changing the former employee’s password.

Determine the Former Employee’s Replacement
If applicable, choose who will be responsible for handling any future emails that are sent to the former employee’s email address. In the steps below, we’ll make the introduction to this person, as well as forward them any emails the former employee receives.

Setup an Auto response 
In most cases, the biggest challenge to overcome is making sure that any of the former employee’s contacts know that the former employee is no longer with the company, and more importantly who at the company they should contact in the future (the person you chose in step 1.)

To accomplish this, I find it easiest to create an auto respond (or vacation response in Gmail) for anyone that emails the former employee. I include a couple of lines similar to the following:

Thank you for contacting (company name). We regret to inform you that (former employee) is no longer employed here. Please direct any future correspondence to (person responsible) at (person responsible’s email and/or phone).

Best Regards

This is an automated reply. For your convenience, this email has been automatically forwarded to (person responsible).

Setup a Filter to Forward Emails
While you’re setting up the autoresponder, go ahead and create a new filter that will forward the incoming emails to whomever you chose as a replacement for the former employee.

Set a Reminder to Delete the Account
Pick a date in the near future when you think it’s safe to delete the former employee’s email account. The amount of time might vary based on the company, their industry, client base, etc., but I usually wait anywhere from two weeks to a month.

Set a reminder for yourself so you don’t forget.

Backup and Delete the Account
When your target date arrives make a backup of the former employee’s account, inbox, etc. if necessary (just do it. disk space is cheap, and having a backup when you need one is priceless!)

At this point, all of your bases should be covered and it should be safe for you to delete the former employee’s email account.

Process Process Process.........

Powershell - Get list of all "Full Mailbox Access by a User"

Powershell -  Get list of all "Full Mailbox Access by a User"

Get-Mailbox -ResultSize unlimited | Get-MailboxPermission | where { ($_.AccessRights -eq “FullAccess”) -and ($_.IsInherited -eq $false) -and ($_.User -like “ACME\BBunny”) } | Export-CSV  C:\FullMailBoxAccess.csv

VMware AirWatch - Bootcamp Certification

Certification of Completion is hereby granted to in recognition of successful participation in

Ashur Guliana
VMware AirWatch: Bootcamp

Powershell - hotfixes WannaCry

Powershell - hotfixes WannaCry

$hotfixes = "KB3205409", "KB3210720", "KB3210721", "KB3212646", "KB3213986", "KB4012212", "KB4012213", "KB4012214", "KB4012215", "KB4012216", "KB4012217", "KB4012218", "KB4012220", "KB4012598", "KB4012606", "KB4013198", "KB4013389", "KB4013429", "KB4015217", "KB4015438", "KB4015546", "KB4015547", "KB4015548", "KB4015549", "KB4015550", "KB4015551", "KB4015552", "KB4015553", "KB4015554", "KB4016635", "KB4019213", "KB4019214", "KB4019215", "KB4019216", "KB4019263", "KB4019264", "KB4019472", "KB4015221", "KB4019474", "KB4015219", "KB4019473"

#checks the computer it's run on if any of the listed hotfixes are present
$hotfix = Get-HotFix -ComputerName $env:computername | Where-Object {$hotfixes -contains $_.HotfixID} | Select-Object -property "HotFixID"

#confirms whether hotfix is found or not
if (Get-HotFix | Where-Object {$hotfixes -contains $_.HotfixID})
"Found HotFix: " + $hotfix.HotFixID
} else {
"Didn't Find HotFix"

Powershell - Admin credentials

Powershell - Admin credentials

Read-Host "Enter Password" | ConvertTo-SecureString -AsPlainText -Force | ConvertFrom-SecureString | Out-File "\\DomainName\netlogon\cred.txt"

Add these next lines to the beginning of scripts

$pass = get-content "\\DomainName\netlogon\creds.txt" | ConvertTo-SecureString $credentials = new-object -typename System.Management.Automation.PSCredential -argumentlist "DomainName\administrator",$pass

PowerShell - scheduled task to hide users disabled in AD from the Global Address List

 daily scheduled task to hide users disabled in AD from the Global Address List

$mailboxes = get-user | where {$_.UserAccountControl -like '*AccountDisabled*' -and $_.RecipientType -eq 'UserMailbox' } | get-mailbox  | where {$_.HiddenFromAddressListsEnabled -eq $false}

foreach ($mailbox in $mailboxes) { Set-Mailbox -HiddenFromAddressListsEnabled $true -Identity $mailbox }

Powershell - Export Printer Information to and Excel document

Export Printer Information to and Excel document

Have Fun... lots of tricks here  :)

Param (
    [string]$Printservers = "PRINTSERVER"

# Create new Excel workbook
$Excel = New-Object -ComObject Excel.Application
$Excel.Visible = $True
$Excel = $Excel.Workbooks.Add()
$Sheet = $Excel.Worksheets.Item(1)
$Sheet.Name = "Printer Inventory"
$Sheet.Cells.Item(1,1) = "Print Server"
$Sheet.Cells.Item(1,2) = "Printer Name"
$Sheet.Cells.Item(1,3) = "Location"
$Sheet.Cells.Item(1,4) = "Comment"
$Sheet.Cells.Item(1,5) = "IP Address"
$Sheet.Cells.Item(1,6) = "Driver Name"
$Sheet.Cells.Item(1,7) = "Driver Version"
$Sheet.Cells.Item(1,8) = "Driver"
$Sheet.Cells.Item(1,9) = "Shared"
$Sheet.Cells.Item(1,10) = "Share Name"
$intRow = 2
$WorkBook = $Sheet.UsedRange
$WorkBook.Interior.ColorIndex = 40
$WorkBook.Font.ColorIndex = 11
$WorkBook.Font.Bold = $True

# Get printer information
ForEach ($Printserver in $Printservers)
{   $Printers = Get-WmiObject Win32_Printer -ComputerName $Printserver
    ForEach ($Printer in $Printers)
        if ($Printer.Name -notlike "Microsoft XPS*")
            $Sheet.Cells.Item($intRow, 1) = $Printserver
            $Sheet.Cells.Item($intRow, 2) = $Printer.Name
            $Sheet.Cells.Item($intRow, 3) = $Printer.Location
            $Sheet.Cells.Item($intRow, 4) = $Printer.Comment
            If ($Printer.PortName -notlike "*\*")
            {   $Ports = Get-WmiObject Win32_TcpIpPrinterPort -Filter "name = '$($Printer.Portname)'" -ComputerName $Printserver
                ForEach ($Port in $Ports)
                    $Sheet.Cells.Item($intRow, 5) = $Port.HostAddress
            $Drivers = Get-WmiObject Win32_PrinterDriver -Filter "__path like '%$($Printer.DriverName)%'" -ComputerName $Printserver
            ForEach ($Driver in $Drivers)
                $Drive = $Driver.DriverPath.Substring(0,1)
                $Sheet.Cells.Item($intRow, 7) = (Get-ItemProperty ($Driver.DriverPath.Replace("$Drive`:","\\$PrintServer\$Drive`$"))).VersionInfo.ProductVersion
                $Sheet.Cells.Item($intRow,8) = Split-Path $Driver.DriverPath -Leaf
            $Sheet.Cells.Item($intRow, 6) = $Printer.DriverName
            $Sheet.Cells.Item($intRow, 9) = $Printer.Shared
            $Sheet.Cells.Item($intRow, 10) = $Printer.ShareName
            $intRow ++
    $WorkBook.EntireColumn.AutoFit() | Out-Null

$intRow ++
$Sheet.Cells.Item($intRow,1) = "Printer inventory completed"
$Sheet.Cells.Item($intRow,1).Font.Bold = $True
$Sheet.Cells.Item($intRow,1).Interior.ColorIndex = 40
$Sheet.Cells.Item($intRow,2).Interior.ColorIndex = 40

Powershell - Add a picture for a user in AD

Add a picture for a user in AD

fun and fast...........

Set-ADUser BBunny -Replace @{thumbnailPhoto=([byte[]](Get-Content "C:\temp\BBunny.jpg" -Encoding byte))}

you can allways add a bunch of users this way

$users = @(
$list += @()
foreach ($user in $users) {
Set-ADUser $user -Replace @{thumbnailPhoto=([byte[]](Get-Content "C:\temp\$user.jpg" -Encoding byte))}

The most useful websites and web apps

The Most Useful Websites and Web Apps – for capturing screenshots of web pages on mobile and desktops. – online voice recognition in the browser itself.
Most Useful – find full-length movies on YouTube. – record movies of your desktop and send them straight to YouTube. – shorten long URLs and convert URLs into QR codes.
unfurlr.come – find the original URL that’s hiding behind a short URL.
qClock – find the local time of a city using Google Maps. – copy special characters that aren’t on your keyboard. – the best place to learn coding online. – create flowcharts, network diagrams, sitemaps, etc. – find icons of all sizes. – download templates, clipart and images for your Office documents. – the easiest way to setup email reminders. – scan any suspicious file or email attachment for viruses. – gets answers directly without searching   – see more wolfram tips. – print web pages without the clutter. – save online files to Dropbox or Google Drive directly.
ctrql.rss – a search engine for RSS feeds. – a simple online timer for your daily needs. – if a site is down due to heavy traffic, try accessing it through coral CDN. – pick random numbers, flip coins, and more. – lets you can quickly edit PDFs in the browser itself. – simultaneously upload videos to YouTube and other video sites. – share you email address online without worrying about spam. – now get read receipts for your email. – quickly determine the font name from an image. – a good collection of open source fonts. – find data hidden in your photographs – see more EXIF tools. – broadcast events live over the web, including your desktop screen. – helps you search domains across all TLDs. – design from scratch or re-model your home in 3d. – share you screen with anyone over the web. – recognize text from scanned PDFs – see other OCR tools. – Track flight status at airports worldwide. – for sharing really big files online. – the site lets you download free Kindle books. – check your writing for spelling or grammatical errors. – easily highlight the important parts of a web page for sharing. – work on the same document with multiple people. – planning an event? find a date that works for all. – a less confusing view of the world time zones. – the perfect tool for measuring your site performance online. – print music sheets, write your own music online (review). – chat with your buddies on Skype, Facebook, Google Talk, etc. from one place. – translate web pages, PDFs and Office documents. – create paintings and sketches with a wide variety of brushes. – discover new sites that are similar to what you like already. – quick summarize long pieces of text with tag clouds. – create mind-maps, brainstorm ideas in the browser. – get color ideas, also extract colors from photographs. – share your photos in an album instantly. – when your friends are too lazy to use Google on their own. – when you need to find the name of a song. – see your past searches, also among most important Google URLs – automatically find perfectly-sized wallpapers for mobiles. – send an online fax for free – see more fax services. – get RSS feeds as an email newsletter. – qiuckly send a file to someone, they can even preview it before downloading. – transfer files of any size without uploading to a third-party server. – setup a private chat room in micro-seconds. – create text notes that will self-destruct after being read. – track the status of any shipment on Google Maps – alternative. – create vector drawings in the browser – create diagrams and flowcharts in the browser, export your drawings to Google Drive and Dropbox. – find if your favorite website is offline or not? – find the other websites of a person with reverse Analytics lookup. – find the web host of any website. – software tutorials and how-to guides. – create a temporary web page that self-destruct. – find definitions of slangs and informal words. – consult this site before choosing a seat for your next flight. – download images absolutely free. – view very high-resolution images in your browser without scrolling. – create custom Google Maps easily. – quickly setup email reminders for important events. – Picnik is offline but PicMonkey is an even better image editor. – you can ask or answer personal questions here. – an excellent layer-based online image editor. – find if that email offer you received is real or just another scam. – master touch-typing with these practice sessions. – send video emails to anyone using your web cam. – create timelines with audio, video and images. – make a movie out of your images, audio and video clips. – check the trust level of any website. – a beautiful to-do app that looks like your paper dairy. – you’ll need this when your bookmarked web pages are deleted. – quickly capture effective notes during meetings. – Watch YouTube channels in TV mode. – quickly create a video playlist of your favorite artist. – Send tweets longer than 140 characters. – create a free and simple website using your Dropbox account. – find the technology stack to know everything about a website. – research a website from the SEO perspective. – broadcast live audio over the web. – bookmark online videos and watch them later (review). – add QR codes to your documents and presentations (review). – the easiest way to write short text notes in the browser. – send rich-text mails to anyone, anonymously. – hire people to do little things for $5. – easily manage your online files on Dropbox, Google Docs, etc. – create a connection between all your online accounts.
Changelog and Updates

Windows PowerShell Scripting and Toolmaking

Course 55039A:Windows PowerShell Scripting and Toolmaking

This five-day instructor-led course is intended for IT Professionals who have a working knowledge of Windows PowerShell 3.0 techniques and technologies, and who want to build reusable tools by using Windows PowerShell 3.0. Students of this course may administer a wide variety of server and client products and technologies that offer Windows PowerShell integration, including Microsoft Exchange Server, Microsoft Windows Active Directory Domain Services, Microsoft SharePoint Server, and more. This course focuses on the Windows PowerShell scripting language, and on the concepts and techniques needed to produce reusable, professional tools.
Audience profile

This course is intended for administrators that have little or no programming experience, but who have a working knowledge of Windows PowerShell and who are able to use Windows PowerShell to run complex, interactive commands.
At course completion
After completing this course, students will be able to:

  • Design tools, including input requirements, output requirements, and functional requirements.
  • Write tools, including scripting, parameterizing commands, and providing verbose output.
  • Debug tools and provide error handling within tools.
  • Combine tools into script and manifest modules.
  • Create custom formatting views.
  • Create tools that are consistent in naming and operation with native Windows PowerShell tools



Open up your Microsoft.PowerShellISE_profile.ps1 file and add the following lines:

$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add('Run with -Verbose', { Invoke-Expression -Command ". '$($psISE.CurrentFile.FullPath)' -Verbose" }, 'Ctrl+F5') | Out-Null
$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add('Run with -Debug',   { Invoke-Expression -Command ". '$($psISE.CurrentFile.FullPath)' -Debug" }, 'Ctrl+F6') | Out-Null

 restart ISE you should see the options under the Add-Ons menu.

Spiceworks Link



updating windows and control when the system restarts.
Thanks to Rönnkvist
Copy the following files to %ProgramFiles%\RebootIfNeeded
RebootIfNeeded.ps1 – Copy script below
hstart64.exe – Download from (needed to hide the scheduled task completely)
ShutdownTool.exe – Download from (you can find the latest version in the comments)
Create a Scheduled Task that runs once or twice every day (I have it set at 08:00 and 13:00 every weekday), and on that task create an with the following configuration:
Program: %ProgramFiles%\RebootIfNeeded\hstart64.exe
Arguments: /NOCONSOLE /WAIT “”%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe” -NoLogo -NoProfile -NonInteractive -File “%ProgramFiles%\RebootIfNeeded\RebootIfNeeded.ps1″”

    $maxBootAgeDays = 35,
    $restartTimeOut = (9 * 60), # 9 hours
    $restartMaxPostpone = (48 * 60), # 48 hours
    $restartDescriptions = @{
        "en-US" = "Your computer needs to restart to receive the latest updates.";
    $defaultLanguage = "en-US"
Function Get-PendingReboot {
    # Local HKLM
    $HKLM = [UInt32] "0x80000002"
    $wmiRegistry = [WMIClass] "\\.\root\default:StdRegProv"
    $PendingReboot = $false
    # CBS - Reboot Required ?
    $RegSubKeysCBS = $wmiRegistry.EnumKey($HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\")
    if ($RegSubKeysCBS.sNames -contains "RebootPending") {
        Write-Verbose "Component Based Servicing have a reboot pending"
        $PendingReboot = $true
    # Windows Update - Reboot Required?
    $RegistryWUAU = $wmiRegistry.EnumKey($HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\")
    if ($RegistryWUAU.sNames -contains "RebootRequired") {
        Write-Verbose "Windows Update have a reboot required"
        $PendingReboot = $true
    ## Pending FileRenameOperations ?
    $RegSubKeySM = $wmiRegistry.GetMultiStringValue($HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\","PendingFileRenameOperations")
    If ($RegSubKeySM.sValue) {
        $RegSubKeySM.sValue | ForEach-Object { 
            If ($_.Trim() -ne '') {
                Write-Verbose "Pending FileRename operation: $($_)"
        $PendingReboot = $true
    # ConfigMgr - Pending reboot ?
    TRY {
        $CCMClientSDK = Invoke-WmiMethod -NameSpace "ROOT\ccm\ClientSDK" -Class "CCM_ClientUtilities" -Name "DetermineIfRebootPending" -ErrorAction Stop
        If ($CCMClientSDK.IsHardRebootPending -or $CCMClientSDK.RebootPending) {
            Write-Verbose "ConfigMgr have reboot pending"
            $PendingReboot = $true
    } CATCH {
        Write-Verbose "Cant talk to ConfigMgr Agent"
    Write-Verbose "Pending reboot: $($PendingReboot)"
    Return $PendingReboot
Function Check-OldBootAge {
    PARAM (
        $maxAgeDays = 35
    $BootTime = Get-WmiObject  Win32_Operatingsystem
    [Int]$days = (New-TimeSpan -Start $boottime.ConvertToDateTime($boottime.LastBootUpTime) -End (Get-Date)).TotalDays
    if ($days -ge $maxAgeDays) {
        Write-Verbose "Boot age is $($days) days (more than $($maxBootAgeDays)), reboot required"
        Return $true
    } else {
        Write-Verbose "Boot age is $($days) days (less than $($maxBootAgeDays))"
        Return $false
    Return $days
Function Get-UserLanguage {
    Return [String] ([System.Threading.Thread]::CurrentThread).CurrentUICulture.Name
# ------------------------------------------------------------------------------------------------------------
# Main script
if ( (Get-WmiObject -Query "SELECT ProductType FROM Win32_OperatingSystem").ProductType -eq 1) {
    If ( (Get-Process "ShutdownTool" -ErrorAction SilentlyContinue) ) {
        Write-Host "Already running ShutdownTool"
    } else {
        If ((Check-OldBootAge -maxAgeDays $maxBootAgeDays) -or (Get-PendingReboot)) {
            Write-Host "Reboot is required, calling restart utility"
            $userLanguage = Get-UserLanguage
            Write-Verbose "Language: $($userLanguage)"
            # Find description
            $Description = $restartDescriptions[$userLanguage]
            if ($Description -eq $null) {
                $Description = $restartDescriptions[$defaultLanguage]
            $timeOutSeconds = ($restartTimeOut*60) - 1
            Write-Verbose "Restart timeout: $($timeOutSeconds) seconds"
            Write-Verbose "Max postpone: $($restartMaxPostpone) minutes"
            Write-Verbose "Description: $($Description)"
            If ((Test-Path ".\ShutdownTool.exe") -eq $false) {
                Throw "Cant find ShutdownTool.exe"
            } else {
                Write-Verbose "Calling restart with ShutdownTool"
                .\ShutdownTool.exe /g:$userLanguage /d:"$Description" /t:$timeOutSeconds /m:$restartMaxPostpone /r /c
            # /g - Language
            # /d - description
            # /t - countdown in sec
            # /m - max postpone in min
            # /r - reboot instead of shutdown
            # /c - force & remove abort-btn
} else {
    Write-Verbose "Not a client OS"
# Done!

Spiceworks Link



Add-AdThumbnailPhoto {
    PARAM (
        [ValidateScript({Test-Path $_ -PathType Leaf})] [string] $PicturePath,
    If (!(Test-IsModuleLoaded "ActiveDirectory")) {
        Throw "You need to run: Import-Module ActiveDirectory"
    Write-Verbose "Adding $($PicturePath) to $($UserAccount)"
    $pictureBinary = [byte[]](Get-Content $PicturePath -Encoding byte)
    If ([System.Text.Encoding]::ASCII.GetString($pictureBinary).Length -ge 100Kb) {
        Throw "Picture to large, max size is 100Kb"
    Try {
        Set-AdUser $UserAccount -Replace @{ thumbnailPhoto = $pictureBinary }
    Catch {
        Throw $error[0]

# one liner
Add-AdThumbnailPhoto -PicturePath "C:\MyPicture.jpg" -UserAccount "MyUserAccount"
# or
Set-AdUser "MyUserAccount" -Replace @{ thumbnailPhoto = ([byte[]](Get-Content "C:\MyPicture.jpg" -Encoding byte) }

Spiceworks Link