1.29.2014

SharePoint 2010 - InfoPath - Web Browser Settings

There is a glitch in the form rendering processes. Even with all the apparent settings set correctly in Central Admin and in the Form Library itself, the form still tries to open in the client filler application. There are some workarounds.
  1. Add this query parameter to the URL string. (Documentation)
    https://intranet.mysite.org/FormLibrary/Forms/template.xsn?OpenIn=Browser
  2. Using powershell to force the settings on the library:
       http://technet.microsoft.com/en-us/library/ff805082(v=office.14).aspx
       Set-SPInfoPathFormsService -AllowUserFormBrowserRendering $true
The actual fix for me was to just do a full publish of the form again. For whatever reason the "Quick Publish" did not correct the issue.

1.10.2014

Powershell - Transferring Files from Server to Server

This is a nice little trick to get powershell to transfer files from one server directly without using domain admin credentials, or setting up an intermediary share directory. The credentials here are for the destination server. This creates a temporary network shared drive on the source server, transfers the file, then removes the shared directory.

$DriveUsername = "SERVER\USERNAME"
$DrivePassword = "PASSWORD"
$LocalFile = "C:\DIRECTORY\FILENAME.csv"
$Drive = "T:"
$RemoteFile = "$Drive\FILENAME.csv"
$UNC = "\\10.10.10.10\C$\DIRECTORY"
$net = new-object -ComObject WScript.Network

$net.MapNetworkDrive($Drive, $UNC, $false, $DriveUsername, $DrivePassword)
Copy-Item $LocalFile $RemoteFile
$net.removenetworkdrive($Drive)