How to enable copy paste in a VMware console

isolation.tools.copy.disable     false
isolation.tools.paste.disable    false

First off, this process is easy and most of the time you don’t even need to do enable this feature. However, during my day to day I have found it helpful when managing vms to enable copy / paste in the built-in console of VMware.

Second, this is not new. This functionality has been around at least since vsphere 4.x. Case and point, just check out VMware’s online publication here. So why blog about it? Syntax. I keep forgetting the exact name in the parameters to enable copy / paste. I’m writing about to help me remember and to have an easy reference for the future.

How To:

Log into VMware vCenter or ESXi directly > right click on a vm and select ‘Edit Settings’. Select ‘VM Options’

Edit VM settings > VM Options tab” class=”wp-image-445″/></figure>



<figure class=

Above, in VM Options expand ‘Advanced’ and select ‘Edit Configuration’

Below, in the Configuration Parameters click ‘Add parameter’ and enter the following for the key and value:

(Note: you will have to ‘Add parameter’ twice)

Name / KeyValue
isolation.tools.copy.disable false
isolation.tools.paste.disable false

You may have to restart your vm for the change to take effect. You should now be able to copy paste in a VMware console onto your vm.

Check out my other tech blog posts here.

Create Restart Program Batch Script

This week I was playing around with a new setup, multiple computers and multiple monitors. I tried to use a program called mouse ShareMouse… and it worked great. However the free version causes you to buy or restart the program every 30 min or so to use the ‘pro’ features. That’s when I thought to just create a restart program script just to see if it would work. 

I decided to use batch to script the restart for ShareMouse. I would need to use a loop, timeout, taskkill and start. First I stopped the service when the script started to ensure the loop didn’t fail if the program was already running. 

@echo off
title SharedMouse Restart Script

taskkill /F /IM ShareMouse.exe

Then you enter the loop. I start the program, wait an amount of time less than the program pro version timeout and stop ShareMouse. 

:loop
echo Starting Application
start "" "C:\Program Files (x86)\ShareMouse\ShareMouse.exe"
timeout /t 300
echo Stopping Application
taskkill /F /IM ShareMouse.exe
goto loop

I ran this script on every computer with ShareMouse and it worked fine. I went all day without hiccup. Just thought I’d share this simple restart program script. 

If you want to get ShareMouse you can find it here

Check out my last scripting post here.

gpupdate and RDP with PowerShell

How to gpudate and RDP with PowerShell

In my first PowerShell post, I described running into the issue of maintaining a network where you do not have all admin permissions. A second issue that I ran into was how to gpupdate and RDP with PowerShell.  Updates were pushed out from group policy but machines were not pulling them and staying up to date. How I forced gpupdate was a lot like how I forced remote reboots with PowerShell.

for($i=0; $i -lt $WorkstationArray.Count; $i++){
     $temp = $WorkstationArray[$i]
     Write-Output "Initiate gpupdate for: " $temp
     Invoke-GPUpdate -Computer $temp
}

Loop through an array and RDP into machines

While looping through an array of the workstations it was possible that some of them would be disconnected from the network. I added code to allow me to log any workstation that I could not RDP into. I also added code to save my username and password, but you could make that more secure and not save that in your script.

$LogFile = "C:\workstation_unreachables.txt"
$User="XXXXXXXXXXXXXXX"
$Password="XXXXXXXXXXXXXXX"

Function Logfile{
    Param ([string]$logstring)
    Add-content $LogFile -value $logstring
}

for($i=0; $i -lt $ServerArray.Count; $i++){ 
    cmdkey /generic:"$Templogin" /U:$User /pass:$Password
    $temp = $ServerArray[$i] mstsc /v:"$temp" /admin 
    $log = Read-Host -Prompt "Press y to log this computer name
                   Press any other key to continue"
    if ($log -match "y"){
        LogFile "$temp"
    }
}

Run PowerShell as admin

The last item I had to do was run the PowerShell script as an administrator.  I decided to make a batch script for that. This prompted me for admin credentials whenever it was ran.

@ECHO OFF 

PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Start-Process PowerShell -ArgumentList '-NoProfile -ExecutionPolicy Bypass -File ""C:\gpupdate.ps1""' -Verb RunAs}"

:END
pause

I hope this helps with your admin tasks on your network. If you missed my first post you can read more here. Thank you – Powersjo

How to loop through AD objects with PowerShell

How to Loop through AD objects with PowerShell

While at work, I came across the problem of ‘You don’t own the network but you must deploy and administer the network’. That’s when I had the idea to employ PowerShell scripts and Batch files. When you are given tier 2 admin access to only a particular OU and not full admin access to the whole domain, these scripts might help you ensure your workstations stay up to date. How did I loop through AD objects with PowerShell?

Grab list from Active Directory

In order to loop through multiple active directory objects, I made the choice to grab all the objects in an OU and put them in a text file. To do this I ran a simple windows command in a batch file. Use the command ‘DSQUERY COMPUTER’.
For each OU, start at the top level OU and dive into the final OU.
For the Domain Controller (DC), start at your top level domain (example: blog) eventually diving into the overall domain (example: com, mil, org, us, etc…)

@echo off

DSQUERY COMPUTER "OU=TOPLEVEL,OU=MIDLEVEL,OU=LOWERLEVEL,OU=FINALLEVEL,DC=BLOG,DC=POWERSJO,DC=COM" -o rdn -limit 1000 > c:\objects.txt

pause

Using an array in PowerShell

$WorkstationArray =
''number1'', “number2”, “number3”

In the array put the list of objects from the batch file. I did this manually but I’m sure there is a way to automate it.

Loop through an array in PowerShell

for($i=0; $i -lt $WorkstationArray.Count; $i++){
$temp = $WorkstationArray[$i]
Write-Output "Initiate reboot for: " $temp
Restart-Computer -ComputerName $temp -Force
}

In the above loop I reference each workstation and initiate a restart of each one. If you use ‘-Force’, even when a user is logged in the workstation will restart.

In the next blog post I will post my method of running ‘gpupdate’, initiating RDP and running the PowerShell scripts as an administrator with batch files.

List of Veeam file extensions

First off, below is a list of Veeam file extensions with an explanation for each. Overall, I used this list for studying for the VMCE exam. (Updated 1/17/2019)

  • VBK – this is a full backup file
  • VIB – incremental backup file
  • VRB – reverse incremental backup file
    • (Quick note, I think VBR is a miss-print you may see on the web)
  • VBM – replica metadata file
  • BCO – configuration backup file
  • DEM – private and public encryption key – Enterprise manager
  • VSB – virtual synthetic backup (these are pointers to backup data blocks)
  • VLB – A generic Veeam database log
  • VSM – Microsoft SQL Server transaction log backup
  • VOM – database log file (Oracle)
  • DIT – active directory database file
  • MDF – Microsoft SharePoint content database file
  • EDB – Similarly, this is a Microsoft Exchange mailbox database
  • ERM – Scale out backup repository
  • RCT and MRT – used to complement CBT data with Microsoft Hyper-V 2016 RCT (Resilient Changed Tracking)
  • CTP – info on data blocks that have changed for Hyper-V replication from a Veeam proprietary driver.

Overall, I found this information in my VMCE-95 textbook, and in Veeam’s online documentation. Additionally, a direct reference here.

Finally, this extension list is part of my Veeam Study Guide.