D(one) IT

IT Tips, Tricks & Such

Category Archives: Scripts

Lync Script – Users with Desktop sharing

I frequent the Lync TechNet forums: http://social.technet.microsoft.com/Forums/en-US/category/lync and was recently asked how one would get a report for all users that have Desktop Sharing enabled.

I took the script from here: http://blogs.technet.com/b/nexthop/archive/2010/06/07/scriptuserpolicyassignments.aspx

Modified it to run for all users, detect only the Conferencing policy and write a line when EnableAppDesktopSharing is equal to Desktop for the user.

Sample output:
Jay Pritchett / Conferencing Policy: Global policy / Sharing: Desktop

Save the following as a ps1 file and run the script from the Lync Management Shell (example C:\Scripts\Get-UsersAllowedDesktop.ps1):

$y = @()

$userlist = Get-CsUser -ResultSize Unlimited
$x = Get-CsConferencingPolicy 

foreach ($user in $userlist)
{

if ($user.ConferencingPolicy -eq $Null)
    {
         
        $site = (Get-CsSite | Where-Object {$_.Pools -contains $user.RegistrarPool}).Identity
 
        foreach ($i in $x)
            {$y += ($i.Identity)}
          
                if ($y -contains "$site")
                    {
                    $Desktop = Get-CsConferencingPolicy -identity "$site" | Select -expandproperty EnableAppDesktopSharing 
                    $output = $user.DisplayName + " / Conferencing Policy: site:$site / Sharing: $Desktop"
                    }
                else
                   {
                   $Desktop = Get-CsConferencingPolicy -identity Global | Select -expandproperty EnableAppDesktopSharing
                   $output = $user.DisplayName + " / Conferencing Policy: Global policy / Sharing: $Desktop"
                   }   
    }
else
   {
   $ID = "tag:" + $user.ConferencingPolicy
   $Desktop = Get-CsConferencingPolicy -identity $ID | Select -expandproperty EnableAppDesktopSharing
   $output = $user.DisplayName + " / Conferencing Policy: " + $user.ConferencingPolicy + " / Sharing: $Desktop"
   }
if ($Desktop -eq "Desktop") 
 {$output}

$site = $Null
$Desktop = $Null
$output = $Null
}

The bulk of the script is to deal with a user’s Effective Policy because the get-csuser Cmdlet only shows Per-User Polices.

Get-CsUser -Identity Jayp |fl name, *policy

Name : Jay Pritchett
ExchangeArchivingPolicy : Uninitialized
VoicePolicy : CalgaryVoicePolicy
MobilityPolicy : BlockMobilityPolicy
ConferencingPolicy :
PresencePolicy :
VoiceRoutingPolicy :
LocationPolicy :
ClientPolicy :
ClientVersionPolicy :
ArchivingPolicy :
LegalInterceptPolicy :
PinPolicy :
ExternalAccessPolicy : BlockExtenralPolicy
HostedVoicemailPolicy :
PersistentChatPolicy :
UserServicesPolicy : UCSEnabled
ExperiencePolicy :

A rundown of the script.

  1. Grab all Lync users
  2. Individually check if a user has a Per-User Policy assigned, if not then determine if the user’s pool has a Site Policy, if not assume Global Policy is assigned.
  3. Run specific query determined by which type of policy is assigned
  4. Output formatted info
  5. Move to the next user in the list

This script can be easily modified to query different properties and/or policies.

Excel 2003 hung or long load time for network files

After applying Microsoft Office File Validation for Office 2003
http://support.microsoft.com/kb/2501584 users report Excel 2003 hanging when opening documents from a network share, or long load times.

Microsoft released a fix: http://support.microsoft.com/kb/2570623 but requires the user to be an administrator of their local machine.

  • To push the fix quickly to all users via GPO (not requiring local admin), create a logon script with the following entries:
  • ExcelOFVFIX.bat

    :: OFV fix for excel
    reg add "HKCU\SOFTWARE\Microsoft\Office\11.0\Excel\Security\FileValidation" /f
    reg add "HKCU\SOFTWARE\Microsoft\Office\11.0\Excel\Security\FileValidation" /f /v EnableOnLoad /t REG_DWORD /d 0
    
  • Or create a reg file with the following entries and have each effected user run it:
  • ExcelOFVFIX.reg

    Windows Registry Editor Version 5.00
    [HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Excel\Security]
    [HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Excel\Security\FileValidation]
    "EnableOnLoad"=dword:00000000
    

List Local Admins from list of computers

I came across this Blog posting: Brian Desmond, while looking for a simple script to list all the users that had Local Administrator rights to their computer.

 

DumpLocalAdministrators.vbs (click “show source” below)

'==========================================================================
' NAME: Dump Local Administrators Membership
'
' AUTHOR: Brian Desmond,
' DATE  : 4/16/2007
'==========================================================================

Option Explicit

Const LogFile = "LocalAdmins.log"
Const resultFile = "LocalAdministratorsMembership.csv"
Const inputFile = "computers.txt"

Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")

Dim shl
Set shl = WScript.CreateObject("WScript.Shell")

Dim fil
Set fil = fso.OpenTextFile(inputFile)

Dim results
Set results = fso.CreateTextFile(resultFile, True)

WriteToLog "Beginning Pass of " & inputFile & " at " & Now()
'WScript.Echo "Beginning Pass of " & inputFile & " at " & Now()
'On Error Resume Next

Dim grp
Dim line
Dim exec
Dim pingResults
Dim member

While Not fil.AtEndOfStream
	line = fil.ReadLine

	Set exec = shl.Exec("ping -n 2 -w 1000 " & line)
  	pingResults = LCase(exec.StdOut.ReadAll)

 	If InStr(pingResults, "reply from") Then
 		WriteToLog line & " responded to ping"
 		'WScript.Echo line & " responded to ping"

 		'On Error Resume Next

		Set grp = GetObject("WinNT://" & line & "/Administrators")

		'WScript.Echo line & ", Administrators"
		results.WriteLine line & ",Administrators,"

		For Each member In grp.Members
			'WScript.Echo 	"Administrators: " & member.Name
			WriteToLog line & ": Administrators - " & member.Name
			results.WriteLine ",," & member.Name
		Next
	Else
		WriteToLog line & " did not respond to ping"
		'WScript.Echo line & " did not respond to ping"
	End If
Wend

results.Close

Sub WriteToLog(LogData)
	On Error Resume Next

	Dim fil
	'8 = ForAppending
	Set fil = fso.OpenTextFile(LogFile, 8, True)

	fil.WriteLine(LogData)

	fil.Close
	Set fil = Nothing
End Sub

Fixing Public Folder replication issues from Exchange 2003 to 2007 or 2010

During a transition of Exchange 2003 to 2010, we ran into replication issues in some of the Public Folders. The issue was tracked down to Categories that contain a bad character. Instead of going through all the entries manually, I found a replication fix script: http://blogs.technet.com/b/bill_long/archive/2010/04/22/fixing-public-folder-replication-errors-from-exchange-2003-to-exchange-2007-or-2010.aspx

Notes:

  • You might need to modify $allPFs. Change the “All Public Folders” text to match however it looks in Outlook.
  • By default the script will not change any data unless you set $commitChanges to true.
  • Power shell’s default script execution mode is Restricted, which might prevent the use of Fix-PFItems.ps1. Quick workaround is to run the following command in power shell (remember to change back to restricted when done):
    Set-ExecutionPolicy Unrestricted

Fix-PFItems.ps1 (click “show source” below)


# Fix-PFItems.ps1
#
# This script should be run on a workstation where Outlook is installed
# as well as Powershell. You do not need the Exchange Management Console
# installed in order to use this. The Outlook profile you are using should be
# one that will access public folders on the Exchange 2003 server, because
# the whole point is to fix the items on the 2003 side so they will replicate
# to Exchange 2007/2010. If you're not sure which replica of a folder your
# profile is accessing, launch MFCMapi, logon to the same profile, navigate
# to the public folder, and look at the PR_REPLICA_SERVER property. This will
# tell you which replica your client is looking at.
#
# Syntax info:
#
# Examples:
# .\Fix-PFItems -folderPath "Departments\HR" -splitOnBadchar $true -resetEmptyCategories $false -doAppointments $false -doInstanceKey $false -doSubfolders $false
# .\Fix-PFItems "Departments\HR" $true $false $false $false $false
#
# folderPath should be in the form: "TopLevelFolder\Subfolder\Subfolder 2"
# a folderPath of "" will run against all public folders
# splitOnBadChar determines whether we split the category into two names, or just replace badChar
# resetEmptyCategories will clear all categories on items that already appear to have no
#   categories. This ensures that the categories value is REALLY empty, and should fix
#   items that have an empty array in the categories. Be aware that since this changes ALL
#   items that appear to have no categories, it could cause a lot of replication.
# doAppointments determines whether appointment items are processed. Note that if this is $true
#    and $commitChanges is set to $true, ALL appointment items in the specified folders
#    will be modified by the script. This will change the last modified time and cause
#    replication.
# doInstanceKey determines whether we clear PR_INSTANCE_KEY on items. Note that if this is $true
#    and $commitChanges is set to $true, ALL items in ALL folders that you specify will be
#    be modified.
# doSubfolders determines whether we automatically traverse subfolders of the specified folder
#
# This script will identify 5 types of problems:
#
# 1. Categories that contain a bad character, typically a comma. This error is identified in the
#    content conversion tracing by output that states:
#
#    PropertyValidationException: Property validation failed. Property = [{GUID}:'Keywords']
#    Categories Error = Element 0 in the multivalue property is invalid..
#
#    This problem will always be fixed if $commitChanges is $true (see below). The
#    -splitOnBadChar parameter lets you choose whether to split the category into two separate
#    categories (A category such as "catone,cattwo" would become two separate categories
#    "catone" and "cattwo") or to simply get rid of the bad character ("catone,cattwo" becomes
#    "catonecattwo").
#
# 2. Categories that contain an emtpy array. This problem is identified by the same tracing
#    output as that shown for problem #1. This problem can be fixed if -resetEmptyCategories
#     is $true and $commitChanges is changed to $true (see below). Note that this will modify
#    all items that appear to have no categories, as the script can't tell the difference
#    between an empty array and an item that truly has no categories.
#
# 3. Appointment items with invalid start/end dates. This problem can be fixed if $doAppointments
#     is $true and $commitChanges is changed to $true. See below. Note that this does not fix
#    every possible problem with appointments.
#
# 4. Address type properties that are longer than 9 characters. This problem can be identified
#    by content conversion tracing that states:
#
#    Property validation failed. Property = [{GUID}:0x8nnn] Email2AddrType Error =
#    Email2AddrType is too long: maximum length is 9, actual length is nn..
#
#    This problem cannot be fixed by the script. You can try to fix it manually using
#    mfcmapi, but sometimes these properties cannot be changed and the item
#    must be deleted.
#
# 5. A bad PR_INSTANCE_KEY. This problem can be identified by an error in the
#    content conversion tracing that says MapiExceptionPropsDontMatch. This problem can
#    be fixed by the script if -doInstanceKey is $true and $commitChanges is $true (see
#    below).
#

param([string]$folderPath, [bool]$splitOnBadchar, [bool]$resetEmptyCategories, [bool]$doAppointments, [bool]$doInstanceKey, [bool]$doSubfolders)

#
# By default, the script does NOT change anything. You must
# change $commitChanges to $true in order for the script to actually
# do anything.
#
# This has the potential to change a lot of items in your public folders!
# Run it in READ ONLY mode first to see what will get changed, and have a
# good backup just in case!
#
$commitChanges = $false

# $badChar is the character we want to get rid of in the category names.
# Normally it's a comma, but it can be changed to anything you want.
$badChar = ","

# $reportAll will make the script report all categories and address types
# that were found. This is just for reporting purposes so you can see what values
# exist.
$reportAll = $false

#
##########################################################################
#
# Be careful changing anything below this point.
#
##########################################################################
#

$allCategories = new-object System.Collections.Specialized.StringCollection
$allAddressTypes = new-object System.Collections.Specialized.StringCollection

function GetNamedFromCollection($name, $collection)
{
 foreach ($item in $collection)
 {
 if ($item.Name -eq $name -or $item.DisplayName -eq $name)
 {
 return $item
 }
 }
 return $null
}

function RecordAddrType($type)
{
 if ($reportAll)
 {
 if (!($allAddressTypes.Contains($type)))
 {
 $temp = $allAddressTypes.Add($type)
 }
 }
}

function DoCategories($item)
{
 $categoryArray = $item.PropertyAccessor.GetProperty("urn:schemas-microsoft-com:office:office#Keywords")
 if ($categoryArray.Length -eq 0 -and $resetEmptyCategories -eq $true)
 {
 if ($commitChanges)
 {
 "    Resetting categories..."
 $item.PropertyAccessor.SetProperty("urn:schemas-microsoft-com:office:office#Keywords", $null)
 $item.Save()
 }
 else
 {
 "    Would have reset the categories, but we're in Read-Only mode."
 }
 }
 else
 {
 $fixedCategories = $false
 [string[]]$newCategoryArray = @()
 foreach ($cat in $categoryArray)
 {
 if ($reportAll)
 {
 if (!($allCategories.Contains($cat)))
 {
 $temp = $allCategories.Add($cat)
 }
 }
 if ($cat.Contains($badChar))
 {
 if (!($splitOnBadchar))
 {
 # In this case, we just replace the badChar with nothing
 $newCategoryArray += $cat.Replace($badChar, "")
 }
 else
 {
 # In this case, we split it into multiple separate categories
 $categorySplit = $cat.Split($badChar)
 foreach ($newCat in $categorySplit)
 {
 $newCat = $newCat.Trim()
 if ($newCat.Length -gt 0)
 {
 $newCategoryArray += $newCat
 }
 }
 }
 $fixedCategories = $true
 }
 elseif ($cat.Trim() -eq "")
 {
 # this category should be deleted from the item
 $fixedCategories = $true
 }
 else
 {
 $newCategoryArray += $cat
 }
 }

if ($fixedCategories)
 {
 "    Old category list for this item:"
 foreach ($cat in $categoryArray)
 {
 ("        " + $cat)
 }
 "    New category list for this item:"
 foreach ($cat in $newCategoryArray)
 {
 ("        " + $cat)
 }
 if ($commitChanges)
 {
 $item.PropertyAccessor.SetProperty("urn:schemas-microsoft-com:office:office#Keywords", $newCategoryArray)
 $item.Save()
 ("    Changes saved.")
 }
 else
 {
 ("    Changes not saved (READ ONLY mode).")
 }
 }
 }
}

function DoAppointmentProps($item)
{
 if ($item.Class -eq 26) # olAppointment in the olObjectClass enumeration is 26
 {
 if ($commitChanges)
 {
 ("    Updating appointment props: " + $item.Subject)
 if ($item.IsRecurring)
 {
 $recurPattern = $item.GetRecurrencePattern()
 $recurPattern.StartTime = $recurPattern.StartTime
 $recurPattern.EndTime = $recurPattern.EndTime
 $item.Save()
 }
 else
 {
 $item.Start = $item.Start
 $item.End = $item.End
 $item.Save()
 }
 }
 else
 {
 ("    Appointment props not updated (READ ONLY mode).")
 }
 }
}

function DoInstanceKey($item)
{
 if ($commitChanges)
 {
 ("    Clearing PR_INSTANCE_KEY: " + $item.Subject)
 $item.PropertyAccessor.DeleteProperty("<a href="http://schemas.microsoft.com/mapi/proptag/0x0FF60102%22)">http://schemas.microsoft.com/mapi/proptag/0x0FF60102")</a>
 $item.Save()
 ("    Changes saved.")
 }
 else
 {
 ("    PR_INSTANCE_KEY not cleared (READ ONLY mode).")
 }
}

function DoAddrType($item)
{
 $senderAddrType = $item.PropertyAccessor.GetProperty("<a href="http://schemas.microsoft.com/mapi/proptag/0x0C1E001E%22)">http://schemas.microsoft.com/mapi/proptag/0x0C1E001E")</a>
 RecordAddrType $senderAddrType
 if ($senderAddrType.Length -gt 9)
 {
 ("    WARNING! PR_SENDER_ADDRTYPE is too long: " + $senderAddrType)
 }

$sentRepresentingAddrType = $item.PropertyAccessor.GetProperty("<a href="http://schemas.microsoft.com/mapi/proptag/0x0064001E%22)">http://schemas.microsoft.com/mapi/proptag/0x0064001E")</a>
 RecordAddrType $sentRepresentingAddrType
 if ($sentRepresentingAddrType.Length -gt 9)
 {
 ("    WARNING! PR_SENT_REPRESENTING_ADDRTYPE is too long: " + $sentRepresentingAddrType)
 }

$recipients = $item.Recipients
 if ($recipients -ne $null)
 {
 foreach ($recipient in $recipients)
 {
 $addrType = $recipient.PropertyAccessor.GetProperty("<a href="http://schemas.microsoft.com/mapi/proptag/0x3002001E%22)">http://schemas.microsoft.com/mapi/proptag/0x3002001E")</a>
 if ($addrType.Length -gt 9)
 {
 ("    WARNING! A recipient PR_ADDRTYPE is too long: " + $addrType)
 }
 }
 }

if ($item.Email1AddressType.Length -gt 0)
 {
 RecordAddrType $item.Email1AddressType
 }
 if ($item.Email1AddressType.Length -gt 9)
 {
 ("    WARNING! Email1AddressType is too long: " + $item.Email1AddressType)
 }

if ($item.Email2AddressType.Length -gt 0)
 {
 RecordAddrType $item.Email2AddressType
 }
 if ($item.Email2AddressType.Length -gt 9)
 {
 ("    WARNING! Email2AddressType is too long: " + $item.Email2AddressType)
 }

if ($item.Email3AddressType.Length -gt 0)
 {
 RecordAddrType $item.Email3AddressType
 }
 if ($item.Email3AddressType.Length -gt 9)
 {
 ("    WARNING! Email3AddressType is too long: " + $item.Email3AddressType)
 }
}

function DoFolder($folder)
{
 $replicaServer = $folder.PropertyAccessor.GetProperty("<a href="http://schemas.microsoft.com/mapi/proptag/0x6644001E%22)">http://schemas.microsoft.com/mapi/proptag/0x6644001E")</a>
 $items = $folder.Items
 ($items.Count.ToString() + " items found in folder " + $folder.FolderPath)
 ("Accessing this folder on server: " + $replicaServer)
 foreach ($item in $items)
 {
 ("Checking item: " + $item.Subject)
 if ($item.PropertyAccessor -ne $null)
 {
 DoCategories($item)
 DoAddrType($item)
 if ($doAppointments)
 {
 DoAppointmentProps($item)
 }
 if ($doInstanceKey)
 {
 DoInstanceKey($item)
 }
 }
 else
 {
 "    No PropertyAccessor on this item. It may be in a conflict state."
 }
 }
 if ($doSubfolders)
 {
 foreach ($subfolder in $folder.Folders)
 {
 DoFolder($subfolder)
 }
 }
}

"Starting..."

if ($commitChanges)
{
 "commitChanges has been set to TRUE. The script WILL save changes."
}
else
{
 "commitChanges is set to FALSE. Running in READ ONLY mode. Changes will NOT be saved."
}

$outlook = new-object -com Outlook.Application
if (!($outlook.Version -like "12.*" -or $outlook.Version -like "14.*"))
{
 ("This script requires Outlook 2007 or 2010. Your version: " + $outlook.Version)
 return
}
$mapi = $outlook.GetNamespace("MAPI")

#
# First, check the categories list and fix if necessary
#

"Checking Outlook categories list..."
$categories = $mapi.Categories
foreach ($category in $categories)
{
 if ($category.Name -ne $null)
 {
 if ($category.Name.Contains($badChar))
 {
 [string[]]$newNames = @()
 ("    Fixing category in Outlook category list: " + $category.Name)
 if (!($splitOnBadchar))
 {
 # In this case, we just replace the badChar with nothing
 $newName += $category.Name.Replace($badChar, "")
 }
 else
 {
 # In this case, we split it into multiple separate categories
 $categorySplit = $category.Name.Split($badChar)
 foreach ($newCat in $categorySplit)
 {
 if ($newCat.Length -gt 0)
 {
 $newNames += $newCat
 }
 }
 }
 if ($commitChanges)
 {
 $foo = $categories.Remove($category.Name)
 foreach ($newName in $newNames)
 {
 $foo = $categories.Add($newName)
 }
 }
 }
 }
}

#
# Categories list should be in good shape now.
# Now find the specified folder.
#

"Finding the specified folder..."
$session = $mapi.Session
$pfStore = $null
foreach ($store in $mapi.Stores)
{
 if ($store.ExchangeStoreType -eq 2)
 {
 $pfStore = $store
 }
}
$pfRoot = $pfStore.GetRootFolder()
$allPFs = GetNamedFromCollection "All Public Folders" $pfRoot.Folders
if ($allPFs -eq $null)
{
 "Couldn't find All Public Folders folder."
 return
}

if ($pfStore -eq $null)
{
 "Couldn't find public folder store."
 return
}

$pfRoot = $pfStore.GetRootFolder()

$folderPath = $folderPath.Trim("\")
$folderPathSplit = $folderPath.Split("\")
$folder = $allPFs

if ($folderPath.Length -gt 0)
{
 "Traversing folder path..."
 for ($x = 0; $x -lt $folderPathSplit.Length; $x++)
 {
 $folder = GetNamedFromCollection $folderPathSplit[$x] $folder.Folders
 }
 if ($folder -eq $null)
 {
 ("Could not find folder: " + $folderPath)
 return
 }
 ("Found folder: " + $folder.FolderPath)
}

#
# Got the folder.
# Start processing the folder and subfolders.
#

DoFolder $folder

"Done!"

if ($reportAll)
{
 ""
 "Categories found:"
 $allCategories
 ""
 "Address types found:"
 $allAddressTypes
}

Fix for imaged based clients not showing in WSUS console

WSUSMissingClientFix.bat

net stop wuauserv
reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate /v AccountDomainSid /f
reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate /v PingID /f
reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate /v SusClientId /f
reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate /v SusClientIDValidation /f
net start wuauserv
wuauclt /resetauthorization /detectnow

Boxee Box web remote

I created a simple web remote to control the Boxee Box.

(Limited due to api: http://developer.boxee.tv/Remote_Control_Interface )

ML Boxee Box Web Remote: Download

Note: changing the commandiframe to display:block; will show the the iframe used to send the commands. If the api command is successful, an “OK” is displayed.

I put most of the code into just the one html. This web remote will work launched right from a folder on a pc or off a hosted web server (not the boxee box). Most remotes I found, had you replace the boxee web server files, which is locked down on the boxee box.

remote.html (click “show source” below)

&lt;!DOCTYPE html&gt;
&lt;html&gt;
	&lt;head&gt;
		&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;&gt;
		&lt;title&gt;MAJL Boxee Remote&lt;/title&gt;
&lt;STYLE type=&quot;text/css&quot;&gt;
&lt;!--
body
{
 	background: url('images/nav.jpg') no-repeat 0 0;
}

a 				{text-decoration:none;
				color:white;}

div#preload { display: none; }

#commandiframe	{position:absolute;
	display:none;
	width:50px;
	height:50px;
	top:0px;
	left:0px;
	font-family:Helvetica, Arial, sans-serif;
	font-size:6px;
	padding:2px;
	background-color:gray
}

#inputfields	{position:absolute;
	display:block;
	width:260px;
	height:25px;
	top:10px;
	left:55px;
	font-family:Helvetica, Arial, sans-serif;
	font-size:15px;
	padding:5px;
	border:5px solid #c5e2a0;
	background-color:gray
}

#up {position:absolute;
  	display:block;
  	width: 97px;
 	height: 80px;
 	background:url('images/up.jpg') no-repeat 0 0;
  	top:236px;
  	left:125px;
  	padding: 0px 0px;
}

#up:visited, #up:hover, #up:active{
  	display:block;
  	width: 97px;
 	height: 80px;
	background:url('images/up_press.jpg') no-repeat 0 0;
	top:236px;
  	left:125px;
  	padding: 0px 0px;
}

#down {position:absolute;
  	display:block;
  	width: 97px;
 	height: 80px;
 	background:url('images/down.jpg') no-repeat 0 0;
  	top:400px;
  	left:125px;
  	padding: 0px 0px;
}

#down:visited, #down:hover, #down:active{
  	display:block;
  	width: 97px;
 	height: 80px;
	background:url('images/down_press.jpg') no-repeat 0 0;
	top:400px;
  	left:125px;
  	padding: 0px 0px;
}

#left {position:absolute;
  	display:block;
  	width: 80px;
 	height: 97px;
 	background:url('images/left.jpg') no-repeat 0 0;
  	top:310px;
  	left:52px;
  	padding: 0px 0px;
}

#left:visited, #left:hover, #left:active{
  	display:block;
  	width: 80px;
 	height: 97px;
	background:url('images/left_press.jpg') no-repeat 0 0;
	top:310px;
  	left:52px;
  	padding: 0px 0px;
}

#right {position:absolute;
  	display:block;
  	width: 80px;
 	height: 97px;
 	background:url('images/right.jpg') no-repeat 0 0;
  	top:310px;
  	left:220px;
  	padding: 0px 0px;
}

#right:visited, #right:hover, #right:active{
  	display:block;
  	width: 80px;
 	height: 97px;
	background:url('images/right_press.jpg') no-repeat 0 0;
	top:310px;
  	left:220px;
  	padding: 0px 0px;
}

#pause {position:absolute;
  	display:block;
  	width: 97px;
 	height: 97px;
 	background:url('images/pause.jpg') no-repeat 0 0;
  	top:80px;
  	left:125px;
  	padding: 0px 0px;
}

#pause:visited, #pause:hover, #pause:active{
	display:block;
  	width: 97px;
 	height: 97px;
	background:url('images/pause_press.jpg') no-repeat 0 0;
	top:80px;
  	left:125px;
  	padding: 0px 0px;
}

#mute {position:absolute;
  	display:block;
  	width: 64px;
 	height: 64px;
 	background:url('images/mute.jpg') no-repeat 0 0;
  	top:80px;
  	left:10px;
  	padding: 0px 0px;
}

#mute:visited, #mute:hover, #mute:active{
	display:block;
  	width: 64px;
 	height: 64px;
	background:url('images/mute_press.jpg') no-repeat 0 0;
	top:80px;
  	left:10px;
  	padding: 0px 0px;
}

#selecta {position:absolute;
  	display:block;
  	width: 97px;
 	height: 97px;
 	background:url('images/select.jpg') no-repeat 0 0;
  	top:310px;
  	left:125px;
  	padding: 0px 0px;
}

#selecta:visited, #selecta:hover, #selecta:active{
  	display:block;
  	width: 97px;
 	height: 97px;
	background:url('images/select_press.jpg') no-repeat 0 0;
	top:310px;
  	left:125px;
  	padding: 0px 0px;
}

#selectb {position:absolute;
  	display:block;
  	width: 97px;
 	height: 97px;
 	background:url('images/home.jpg') no-repeat 0 0;
  	top:580px;
  	left:125px;
  	padding: 0px 0px;
}

#selectb:visited, #selectb:hover, #selectb:active{
  	display:block;
  	width: 97px;
 	height: 97px;
	background:url('images/home_press.jpg') no-repeat 0 0;
	top:580px;
  	left:125px;
  	padding: 0px 0px;
}
--&gt;
&lt;/STYLE&gt;

&lt;SCRIPT LANGUAGE=&quot;JavaScript&quot;&gt;
&lt;!--
function toggle() {
	var ele = document.getElementById(&quot;settings&quot;);
	var text = document.getElementById(&quot;displayText&quot;);
	if(ele.style.display == &quot;block&quot;) {
    		ele.style.display = &quot;none&quot;;
		text.innerHTML = &quot;Device&quot;;
  	}
	else {
		ele.style.display = &quot;block&quot;;
		text.innerHTML = &quot;Hide&quot;;
	}
}

function linkGenerator(commands){
	frames['debug'].location.href= 'http://' + document.getElementById('userIP').value +':' + document.getElementById('userPort').value + '/xbmcCmds/xbmcHttp?command=' + commands;
	}
--&gt;
&lt;/script&gt;

	&lt;/head&gt;
	&lt;body&gt;
&lt;div id=&quot;preload&quot;&gt;
	&lt;img src=&quot;images/nav.jpg&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;
	&lt;img src=&quot;images/mute.jpg&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;
    &lt;img src=&quot;images/pause.jpg&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;
    &lt;img src=&quot;images/up.jpg&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;
    &lt;img src=&quot;images/select.jpg&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;
    &lt;img src=&quot;images/left.jpg&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;
    &lt;img src=&quot;images/right.jpg&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;
    &lt;img src=&quot;images/down.jpg&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;
    &lt;img src=&quot;images/home.jpg&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;
    &lt;img src=&quot;images/mute_press.jpg&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;
    &lt;img src=&quot;images/pause_press.jpg&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;
    &lt;img src=&quot;images/select_press.jpg&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;
    &lt;img src=&quot;images/home_press.jpg&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;
    &lt;img src=&quot;images/up_press.jpg&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;
    &lt;img src=&quot;images/left_press.jpg&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;
    &lt;img src=&quot;images/right_press.jpg&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;
    &lt;img src=&quot;images/down_press.jpg&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;
&lt;/div&gt;

  &lt;div id=&quot;settings&quot; style=&quot;display:none&quot;&gt;
    &lt;form id=&quot;inputfields&quot;&gt;
	&lt;b&gt;Boxee&lt;/b&gt;
	&lt;input id=userIP type=&quot;text&quot; size=15 name=&quot;IPvalue&quot; value=&quot;BoxeeBox&quot; onfocus=&quot;if(!this._haschanged){this.value=''};this._haschanged=true;&quot;/&gt;
	&lt;b&gt;:&lt;/b&gt;
	&lt;input id=userPort type=&quot;text&quot; size=5 name=&quot;Portvalue&quot; value=&quot;8800&quot; maxlength=&quot;5&quot;&gt;
	&lt;/form&gt;
  &lt;/div&gt;

		    &lt;div id=&quot;navigation&quot;&gt;
		    &lt;a id=&quot;displayText&quot; href=&quot;javascript:toggle();&quot;&gt;Device&lt;/a&gt;

			&lt;div id=&quot;up&quot; onClick =&quot;linkGenerator('SendKey(270)')&quot;&gt;&lt;/div&gt;

			&lt;div id=&quot;down&quot; onClick=&quot;linkGenerator('SendKey(271)')&quot;&gt;&lt;/div&gt;

			&lt;div id=&quot;left&quot; onClick=&quot;linkGenerator('SendKey(272)')&quot;&gt;&lt;/div&gt;

			&lt;div id=&quot;right&quot; onClick=&quot;linkGenerator('SendKey(273)')&quot;&gt;&lt;/div&gt;

			&lt;div id=&quot;selecta&quot; onClick=&quot;linkGenerator('SendKey(256)')&quot;&gt;&lt;/div&gt;

			&lt;div id=&quot;selectb&quot; onClick=&quot;linkGenerator('SendKey(257)')&quot;&gt;&lt;/div&gt;

			&lt;div id=&quot;mute&quot; onClick=&quot;linkGenerator('Mute()')&quot;&gt;&lt;/div&gt;

			&lt;div id=&quot;pause&quot; onclick=&quot;linkGenerator('Pause()')&quot;&gt;&lt;/div&gt;

			&lt;div id=&quot;commandiframe&quot;&gt;
			    <a href=""></a>
			&lt;/div&gt;

	    &lt;/div&gt;

	&lt;/div&gt;
	&lt;/body&gt;
&lt;/html&gt;

Copy large files using ESEUTIL

While looking for a better method to copy large 100+ GB files to a removable disk, I came across this blog: http://blogs.technet.com/b/askperf/archive/2007/05/08/slow-large-file-copy-issues.aspx

ESEUTIL (the exchange tool) can be used to copy one large file at a time, the preformance is around three times faster than Robocopy or other methods I’ve tested. A copy of ESEUTIL.EXE and ESE.DLL is all that’s required, make sure to get either the 32 or 64bit version depending on the client OS.

syntax: eseutil /y <srcfile> /d <destfile>

I wrote a simple batch file using eseutil to copy all backup files from a shared folder to a removable disk.

Copylargefiles.bat

@echo off
setlocal enabledelayedexpansion

set SOURCE=\\NAS01\Veeam
set DEST=e:\Veeam
mkdir e:\Veeam
for %%f in (%SOURCE%\*.vbk) do (
ESEUTIL.exe /Y %%f /D %DEST%\%%~nxf
)
exit

Show passwords behind asterisks in browsers

I found this little script that when pasted into the address bar, it will reveal the password hidden behind the ***** for the current page.

javascript: var p=r(); function r(){var g=0;var x=false;var x=z(document.forms);g=g+1;var w=window.frames;for(var k=0;k<w.length;k++) {var x = ((x) || (z(w[k].document.forms)));g=g+1;}if (!x) alert('Password not found in ' + g + ' forms');}function z(f){var b=false;for(var i=0;i<f.length;i++) {var e=f[i].elements;for(var j=0;j<e.length;j++) {if (h(e[j])) {b=true}}}return b;}function h(ej){var s='';if (ej.type=='password'){s=ej.value;if (s!=''){prompt('Password found ', s)}else{alert('Password is blank')}return true;}}

Tested in the latest versions of Chrome, IE and FF. You might get a security prompt to allow the script to run. I take no credit for the writing of this script.

Sdelete

Using Veeam Backup and Replication, I found that this size of the backup file can be greatly reduced if you use Sdelete to zero out the free space in the VMs being backed up (Fixed Disk).

I use a script from Yellow Bricks, which defrags all local drives then runs sdelete to zero out free space. I usually run this script after major program installs, Drive increase or on a quarterly bases.

sdfrag.bat

@echo off
cscript c:\sdfrag.vbs
pause

sdfrag.vbs

 Set WshShell = WScript.CreateObject("WScript.Shell")
Dim fso, d, dc
Set fso = CreateObject("Scripting.FileSystemObject")
Set dc = fso.Drives
WshShell.RegWrite "HKCU\Software\Sysinternals\", 0, "REG_SZ"
WshShell.RegWrite "HKCU\Software\Sysinternals\SDelete\", 0, "REG_SZ"
WshShell.RegWrite "HKCU\Software\Sysinternals\SDelete\EulaAccepted", 1, "REG_DWORD"
For Each d in dc
If d.DriveType = 2 Then
Return = WshShell.Run("defrag " &amp; d &amp; " -f", 1, TRUE)'
Return = WshShell.Run("sdelete -c " &amp; d, 1, TRUE)
End If
Next
Set WshShell = Nothing