Rescan OwnCloud Files Through PowerShell

The open-source project OwnCloud is a great alternative to Dropbox, Box, or other file-sharing and syncing sites if you need to keep control of your data in-house.  I've been managing a few installs of it since version 4, and while the online management tools have come a long way, there are still a few things that need to be done from the command line.

Here's a PowerShell script I came up with to trigger a rescan of a user's files when needed (if I've had to clean out files or restore them from a backup).  Hope someone finds this useful.

## Configuration Options 
$phpPath = "C:\path-to-php\" 
$phpExec = "php.exe" 
$ownCloudPath = "D:\path-to-owncloud-web\" 

$userName = Read-Host "What user should be rescanned? (Leave blank to rescan all users)" 
if (-not ($userName)) { $userName = "--all" } 

$command = $phpPath + $phpExec + " " + $ownCloudPath + "console.php files:scan " + $userName 

iex $command
Read more ››

Mac + (some) SMB = ugh.

Sometimes I just need to jot myself some notes so I don't forget them.  In this case, this page on MacWindows.com has helped me greatly in the past (and will again in the very near future), and it may help others who find odd SMB access errors, slowness, or other problems (especially on older Mac OSs).

In this newer case, I think the problem is crappy firmware for the  WD Sharespace...  Need to convince the owner that a Synology or QNap or Drobo would be a far better thing to trust their business data to.  At least they have backups...

Read more ››

Still No Great Windows Tablets?

I'm really disappointed with Dell on this one.  Latitude 10 tablets could be great, except they're artificially capped at 2GB of ram.  At least they're relatively cheap, or you can spend more for one with Windows 8 Pro and a stylus.

It looks like Acer has a quiet winner with the Acer Iconia W700, plopping in Core i series chips (instead of Atoms) and 4GB of ram.  However, it seems to have a number of drawbacks that make it a nice lightweight laptop but not a great tablet.  The Iconia W510 seems to be a better choice for tablet-y uses.

The HP Envy X2 gets good reviews, but still maxes out at 2GB of ram.

Samsung's offering is over $1000, and lacks some features standard on much cheaper competitors.

Sadly, there's no magic device that has everything and is able to keep the price down to throw-away levels.  IT folks are waiting with bated breath for Haswell tablets to start getting churned out.

Read more ››

Network load balancing IIS 7.5 on less than stellar networking equipment

I recently came across a few issues configuring Network Load Balancing (NLB) on two Windows 2008 R2 Hyper-V VMs running IIS and MySql as a hosting solution for 100+ medium traffic WordPress sites to be migrated over after testing.

Installation and configuration of NLB went fine, and the cluster was initially configured as multicast.  This worked fine, until I went to go test connectivity from the outside world - no respone.  Turns out, the gateway on this network was (correctly) set to not relay multicast packets.  Unfortunately, creating static routes on this gateway was not an option, so it was going to have to be unicast.  Not a problem - I shut the machines down, added another virtual ethernet adapter, and reconfigured NLB to use the dedicated second adapter.  Windows 2008 R2 and 2012 Hyper-V hosts are now set to block VM MAC address spoofing by default, so that needed to be enabled for that second adapter.

All's well and good - WordPress sets up, everything works... until I log into WordPress and find that it can't retrieve any external info (themes, plugins, WordPress news, etc.)  Because of the way NLB works in unicast mode, each site was trying to use the adapter it was bound to (the dedicated NLB adapter), which because of the spoofed identical MAC addresses, couldn't guarantee that the response would come back to the machine that generated it.

The following commands, courtsey of The Cable Guy, cleared this issue up:

netsh interface ipv4 set interface {NLB adapter} weakhostsend=enabled
netsh interface ipv4 set interface {NLB adapter} weakhostreceive=enabled
netsh interface ipv4 set interface {NLB adapter}ignoredefaultroutes=enabled

...in addition to going into Advanced Settings from the Network Connections list and setting the Management adapter as a higher priority than the NLB adapter.

The first two commands reenable weak binding, while the third command allows outgoing traffic to go out over the non-load balanced adapter, based upon the order of the connections (and guaranteeing it would come back to that specific machine).

Upon further testing, this solution did not work for the given scenario.   NLB is an outdated solution with flaws, but for a while it was the only game in town (on the cheap end).  As stated in the setup docs, NLB creates a massive amount of multicast data in this mode.  The network configuration is unfortunately large and flat, and this configuration generated multicast storms of each and every request.  On an isolated VLAN, this could work, but at that point, you might as well have gone in another direction.  Also, upload speeds are hobbled because of how much traffic is created with incoming packets.

Dedicated load balancers and proxy servers are much better for keeping large amounts of web data highly available.   Physical devices are expensive but well-designed.  Even a lightweight software solution like Squid on quality hardware would fit the bill, plus you get the added benefit of offloading caching and compression to the proxy server, but you lose the ease of a single-point SSL configuration that the better featured physical devices include and instead have to pass encrypted traffic straight-through.  Luckily, IIS >= 8 has that covered.

Read more ››

Removing Windows 7 SP1 Install Files in Audit Mode

Normally when preparing a Windows 7 base image, I'll install it normally, update everything, remove temporary files, and then enter audit mode to take care of a few final steps.  For this particular image, I decided to do everything from audit mode.

Normally after installing Service Pack 1, I remove the temporary files by running

dism /online /Cleanup-Image /spsuperseded

However, DISM quit out with

Error: 1084
This service cannot be started in Safe Mode

After checking the logs, DISM is failing while trying to create a system restore point, which does not run in audit mode.

The solution?  Go into Windows System Settings -> System Protection -> Protection Settings -> Configure, and turn off System Restore.  Once that's done, re-run the DISM command and it should complete normally.  After that, re-enable System Restore and continue on.

Read more ››

Problems Deploying Adobe Acrobat Via Sysprepped Image

After installing Adobe Acrobat XI to an image in audit mode, after finishing the sysprep process and installing it onto a new PC, Acrobat will not run.  It gives an error stating that the user should uninstall and reinstall, or talk to their systems administrator.

Turns out, it's because the permissions aren't being properly set on the ProgramData folder that Acrobat writes to when it tries to present the end user with the license agreement and registration form.

All that's needed is to take ownership of the directory, and then to grant the Users group modify permissions on C:\ProgramData\Adobe, either through the GUI or by running

takeown /f "C:\ProgramData\Adobe" /a /r /d y
icacls "C:\ProgramData\Adobe" /grant Users:F /t

Now, after finishing the sysprep process and installing, Acrobat functions as expected upon first run.

Read more ››