SharePoint Web Services GUIDs – named

I’m always forgetting this command to translate those silly GUID services into text which is understandable. So here it is, where we can all find it. Get-SPServiceApplication | sort Id | FT -property Id, DisplayName -AutoSize


SharePoint – SPmonitoredScope – Dashboard

In order for custom code to show up in the dev dashboard you need to make use of the SpMonitoredScope: using (new SPMonitoredScope(“My Scope Name”)){   doSomeWork(); }  We have been finding that a few tough issues should have been trivial if the parts had been showing up!  

Windows – BeatUp-Windows – stress memory and cpu’s

# BeatUp-Windows.ps1 # $psProcess = gps -id $PID $psInstances = (gps -Name $ if ($psInstances -gt 1) { $psName = “{0}#{1}” -f $,$($psInstances – 1) } else { $psName = $ } # RAM in box $box=get-WMIobject Win32_ComputerSystem $Global:physMB=$box.TotalPhysicalMemory / 1024 /1024 ##################### # perfmon counters $Global:psPerfCPU = new-object System.Diagnostics.PerformanceCounter(“Processor”,”% Processor Time”,”_Total”) $Global:psPerfMEM = new-object…


SharePoint – AV scanning SharePoint.

Make sure you tell it to ignore your search indexes and other SharePoint areas!See: To be sure it is not hitting your index location, you can check where that is currently set by: Central Admin -> Application Management -> Manage service applications   -> Search Service Application ->Search Application Topology (Modify)      -> IndexPartition/Query Component (Edit Properties). Or via…


Windows – Get-WindowsUpdateLog

# Get-WindowsUpdateLog.ps1# walk the WindowsUpdate.log to list the # Security Updates that have been installed. # [anything][PatchDate][anything][matchtext][PatchText]$PATTERN  = “([^\n]+\}\t)”$PATTERN += “(?<PatchDate>[0-9]{4}-[0-9]{2}-[0-9]{2})”$PATTERN += “([^\n]+Windows successfully installed the following update:\s)”$PATTERN += “(?<PatchText>[^\n]+)” Function Get-WindowsUpdates($Server) { $WindowsUpdateLogPath = “\\” + $Server + “\Admin$\WindowsUpdate.log” $WindowsUpdateLog = Get-Content $WindowsUpdateLogPath $result = @() ForEach ($line in $WindowsUpdateLog) {   if ($line.Contains(“Windows successfully installed the following update:”))…

SharePoint – import a picture from AD for the user profile

Consider the following scenario.  You have JPG pictures in AD, stored with the users thumbnailPhoto attribute. You try to import pictures for a user profile from the Active Directory thumbnailPhoto attribute,  to store within the Picture attribute in Microsoft SharePoint Server 2010.  You have set up an import Picture URL mapping.  User Profile synch and mysites…


PowerShell – add a JPG into AD for the user photo

# Update-AD-Picture.ps1## copy a .jpg into a byte array, then push that into # the “thumbnailPhoto” property of the specified user in AD function UpDate-AD-Picture { param ([STRING] $UserName, [STRING] $JPEGfilePath)  if ( ($JPEGfilePath) -and (test-path($JPEGfilePath)) ) {   [BYTE[]] $JPEG = Get-Content $JPEGfilePath -encoding BYTE     $domain = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()   $root = $domain.GetDirectoryEntry()     $search = [System.DirectoryServices.DirectorySearcher]…