12.20.2012

Drive Cleanup

I am impressed. I was having difficulty connecting my eSATA drive to windows 7. I found this program and it cleared out all old drive references from the registry. http://www.uwe-sieber.de/drivetools_e.html#drivecleanup

12.10.2012

SharePoint Log File Shrinking

Here is a real gem for recovering space taken up by log file growth. It is of course recommended that you back up any files first.

USE SharePoint_Config
GO

ALTER DATABASE SharePoint_Config SET RECOVERY SIMPLE
DBCC SHRINKFILE(N'SharePoint_Config_log', 50)

ALTER DATABASE 
SharePoint_Config SET RECOVERY FULL
GO

12.03.2012

SharePoint 2010 - Setting Up Development Environment

Great whitepaper I found a while ago on setting this up:
https://docs.google.com/open?id=0B4-lBnIxXbzWSmw5MHNuSG1ieGc

11.29.2012

Google+ to RSS

Here are some interesting services for creating RSS feeds of Google+ posts.
  • http://plus-one-feed-generator.appspot.com/
  • http://www.google-plus-rss.com/
  • http://plusfeed.frosas.net/
  • http://pipes.yahoo.com/pipes/
  • http://gplusrss.com/  (Requires you to authorize account access)
  • http://www.makeuseof.com/tag/ways-google-rss-feeds/

CloudCracker

Wow... now this is an interesting service, and scary.
https://www.cloudcracker.com/

11.11.2012

Scheduled Test Print

This is a simple way to send a test print. Place this command in a scheduled task to prevent ink jet cartridges from drying up.

mspaint /p C:\Schedules\Printer\Google.jpg

11.05.2012

Physical to Virtual Migration

Here are some useful tools and instructions for converting a physical windows machine to virtual. This example was used to convert a physical Windows 2003 server to a VHD, which was mounted on a Windows 2012 Hyper-V server.
  1. Run Disk2vhd utility from Microsoft. There are some nuances to this program:
      A) Run the utility from an external drive not being converted.
      B) Make sure to check the Virtual PC option.
  2. Once the .vhd is created, create a new virtual machine and attach the .vhd. Start it up in Hyper-V.
    If the "BOOTMGR is missing" (which is likely)... STOP. 
  3. Dismount the .vhd from Hyper-V at this point and use the following instructions and utilities. There are two options in these instructions for mounting the VHD. I use the process of just mounting the VHD as a drive. This can be done through  Admin Tools --> Computer Management --> Disk Management --> Action --> Attach VHD.
      A)  http://xtralogic.com/testdisk_rebuild_bootsector.shtml
      B)  http://www.cgsecurity.org/wiki/TestDisk_Download
  4. Once the BOOTMGR is fixed, recreate the Hyper-V virtual machine and attach the .vhd.
    Make sure to add the hyper-v extensions/internals to the virtual machine under settings.
  5. Start it up.You will now see multiple boot options, such as:
      A) disk2vhd
      B) Windows Server
  6. Select the Windows Server boot option. You may only have 3 seconds to select this option.
  7. The server may go through many HAL upgrade processes. At some point early on, back up your boot.ini file. Then go into boot.ini and increase the timeout and remove the boot option line related to disk2vhd. http://support.microsoft.com/kb/323427
  8.  If all goes well, you should start seeing drivers and hardware updating. Several restarts may be required.
  9. Once upgrading is completed, go into network properties and configure the IP address, gateway, etc. Confirm that you now have internet connectivity.

10.25.2012

SharePoint 2007 - Hiding Fields w/ Javascript

I actually found this solution to be a bit more elegant, and more compatible with browsers. Just use jQuery and target the ID of the field OR the attribute value.

<script language="javascript" src="https://mysite.company.org/Code/JS/jQuery/jquery-1.8.2.min.js"></script>
<script language="javascript">
// ==================================================================
// JQUERY
// ==================================================================
$(function(){
  //alert("test");
  $("#ctl00_m_g_6a6807bc_96fc_43e6_bfe3_20b1971aadcc_ctl00_ctl04_ctl00_ctl00_ctl00_ctl04_ctl00_ctl00_TextField").prop("readonly",true);
   $('input[title="Title"]').prop("readonly",true);

});
</script>


=====================================

Making fields hidden should quite frankly be a built in feature of SharePoint. Here are two interesting tricks I found to modify the NewForm.aspx and EditForm.aspx pages, without opening up SharePoint Desinger.

1) Append this to the URL string. This will force the page edit option. &ToolPaneView=2

2) Add a Content Editor Web Part to the page.

3) Paste this javascript code into the web part.


 <script language="javascript" type="text/javascript">
_spBodyOnLoadFunctionNames.push("hideFields");

function findacontrol(FieldName) {
 var arr = document.getElementsByTagName("!");
 // get all comments
 for (var i=0;i < arr.length; i++ )
 {
 // now match the field name
 if (arr[i].innerHTML.indexOf(FieldName) > 0)
 { return arr[i]; }
 }
}

function hideFields() {
 var control = findacontrol("Title");
 control.parentNode.parentNode.style.display="none";
}
</script>


Sources:

9.28.2012

Google Sites - Sitemap

This just proves I can learn something new every day. I never realized that google sites automatically creates a sitemap feed.

If you created your site using Google Apps, your Sitemap URL is:
http://sites.google.com/a/(your domain)/(site name)/system/feeds/sitemap 
If your site is located at http://sites.google.com/yoursite, your Sitemap URL is:
http://sites.google.com/site/(site name)/system/feeds/sitemap 

9.26.2012

SharePoint 2010 - PowerShell ISE

Run this script to add snap-in automatically to ISE when it starts up.


if (!(test-path $profile )) { 
    new-item -type file -path $profile -force 
} 
 

$cmd = 'if((Get-PSSnapin | Where-Object {$_.Name -eq "Microsoft.SharePoint.PowerShell"}) -eq $null) { 
    Add-PSSnapIn "Microsoft.SharePoint.Powershell" 
}'

out-file -FilePath $profile -InputObject $cmd -Append

Run this script to perform a quick user audit.

$site = Get-SPSite http://yourservername/sites/yoursitecollection
$groups = $site.RootWeb.sitegroups
foreach ($grp in $groups) {"Group: " + $grp.name; foreach ($user in $grp.users) {"  User: " + $user.name} }
$site.Dispose()

Run this script to dump a user audit to a file.

$siteUrl = "http://yourservername/sites/yoursitecollection"
$web = Get-SPWeb $siteUrl

@(foreach ($group in $web.SiteGroups) {
  foreach($user in $group.Users) {
    $usergroup = New-Object System.Object
    $usergroup | Add-Member -type NoteProperty -name GroupName -value $group.Name
    $usergroup | Add-Member -type NoteProperty -name UserName -value $user.Name

     Write-Output $usergroup 
    }
}) | Export-Csv c:\userlist.csv -NoTypeInformation

9.11.2012

SharePoint 2010 - STSADM Shortcut

Here is an article for instructions on how to set up this shortcut:
  1. Create a shortcut on your desktop to cmd.exe (it's here: %SystemRoot%\system32\cmd.exe)
  2. Right-Click on the shortcut and select Properties so you can go edit them (our stuff is on Shortcut Tab)
  3. Change the Target to: %SystemRoot%\system32\cmd.exe /K stsadm.exe -help
  4. Change the Start in to: "C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\BIN\"
  5. Click Change Icon, and browse to stsadm to select it: C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\BIN\stsadm.exe
  6. Click OK until all of your windows are closed.
  7. Rename your shortcut to stsadm

SharePoint 2010 - 5586 - 'proc_UpdateStatisticsNVP'.

This fix was used to attempt to correct the 5586 missing proc_UpdateStatisticsMVP
http://blog.scuzz.ca/?p=66

The two databases that need updating are:
 - SharePoint_Config
 - WSS_Search

This microsoft article basically says to ignore:
http://support.microsoft.com/kb/2635071


9.07.2012

SharePoint Colored Calendars

Some great resources for color coding calendars in sharepoint.
  • https://store.bamboosolutions.com/p-31-calendar-plus-web-part.aspx
  • http://www.kwizcom.com/sharepoint-add-ons/sharepoint-calendar-plus-web-part/overview/
  • http://techtrainingnotes.blogspot.com/2008/11/sharepoint-color-coded-calendars.html
  • http://www.orbitone.com/en/blog/archive/2010/10/25/calendar-colour-coding-in-sharepoint.aspx
  • http://techtrainingnotes.blogspot.com/2008/11/sharepoint-color-coded-calendars.html
  • http://www.w3schools.com/html/html_colornames.asp

9.05.2012

SharePoint 2010 Install Errors

Great article documented the common errors I have seen with SharePoint 2010 installation. 
http://globaljosh.wordpress.com/