Posts Tagged ‘SharePoint’

Posted by Isaac Blum at 21 January 2010

Category: Business, For The Greater Good, Free Help, MOSS 2007, PowerShell, SharePoint

Tags: , , , , , ,

The below links were used to create this script. Thanks

http://blogs.msdn.com/powershell/archive/2009/01/10/capture-console-screen.aspx

http://www.sharepointdevwiki.com/display/public/Updating+User+Profiles+in+SharePoint+SSP+using+PowerShell

http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,a332015d-c5dc-4433-a0f3-247fd37b0b04.aspx

Download the file here

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
[void][reflection.assembly]::Loadwithpartialname("Microsoft.SharePoint") | out-null
[void][reflection.assembly]::Loadwithpartialname("Microsoft.Office.Server.Search") | out-null
[void][reflection.assembly]::Loadwithpartialname("Microsoft.Office.Server") | out-null
 
#################################################################################################################
# Get-ConsoleAsText.ps1
# Thanks to http://blogs.msdn.com/powershell/archive/2009/01/10/capture-console-screen.aspx for Get-ConsoleAsText.ps1
# The script captures console screen buffer up to the current cursor position and returns it in plain text format.
#
# Returns: ASCII-encoded string.
#
# Example:
#
# $textFileName = "$env:temp\ConsoleBuffer.txt"
# .\Get-ConsoleAsText | out-file $textFileName -encoding ascii
# $null = [System.Diagnostics.Process]::Start("$textFileName")
#################################################################################################################
function Get-ConsoleAsText{
# Check the host name and exit if the host is not the Windows PowerShell console host.
if ($host.Name -ne 'ConsoleHost')
{
  write-host -ForegroundColor Red "This script runs only in the console host. You cannot run this script in $($host.Name)."
  exit -1
}
 
# Initialize string builder.
$textBuilder = new-object system.text.stringbuilder
 
# Grab the console screen buffer contents using the Host console API.
$bufferWidth = $host.ui.rawui.BufferSize.Width
$bufferHeight = $host.ui.rawui.CursorPosition.Y
$rec = new-object System.Management.Automation.Host.Rectangle 0,0,($bufferWidth - 1),$bufferHeight
$buffer = $host.ui.rawui.GetBufferContents($rec)
 
# Iterate through the lines in the console buffer.
for($i = 0; $i -lt $bufferHeight; $i++)
{
  for($j = 0; $j -lt $bufferWidth; $j++)
  {
    $cell = $buffer[$i,$j]
    $null = $textBuilder.Append($cell.Character)
  }
  $null = $textBuilder.Append("`r`n")
}
return $textBuilder.ToString()
}
 
################################################################
 
# Pause Script
function Pause ($Message="Script Complete. Press any key to continue...")
{
Write-Host -NoNewLine $Message
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
Write-Host ""
}
 
################################################################
 
function Get-UserProfileConfigManager([string]$siteUrl)
{
# Need to get a PortalContext object
# as we do not have a HttpContext we need to source one the hard way
$site=new-object Microsoft.SharePoint.SPSite($siteUrl)
$servercontext=[Microsoft.Office.Server.ServerContext]::GetContext($site)
$site.Dispose() # clean up
 
################################################################
 
# Return the UserProfileConfigManager
new-object Microsoft.Office.Server.UserProfiles.UserProfileConfigmanager($servercontext)
}
function Get-SPProfileManager([string]$siteUrl)
{
# Need to get a PortalContext object
# as we do not have a HttpContext we need to source one the hard way
$site=new-object Microsoft.SharePoint.SPSite($siteUrl)
$servercontext=[Microsoft.Office.Server.ServerContext]::GetContext($site)
$site.Dispose() # clean up
 
################################################################
 
# Return the UserProfileManager
new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($servercontext)
}
function Get-SPUserProfile([string]$siteUrl, [string] $u)
{
$upm= Get-SPProfileManager([string]$siteUrl)
if ($upm.UserExists($u) -eq $false)
{
    $upm.CreateUserProfile($u)
 
$upm.GetUserProfile($u)
}
 
################################################################
 
# Create function
function Update-UserProfileProperty()
{
	PARAM
	(
		[string] $siteUrl = $( throw "You must provide a Site Collection Url e.g. 'http://moss/'"),
		[string] $userName = $( throw "You must provide a User Name e.g. 'DOMAIN\USERNAME'"),
		[string] $propName = $( throw "You must provide a User Profile Property Name e.g. 'WorkPhone'"),
		[string] $propValue = $( throw "You must provide a User Profile Property Value e.g. '0400 767 022'")
	)
	END
	{
		if ($propValue -eq "NULL" -or $propValue -eq "" -or $propValue -eq "None")
		{
			Write-Host "Property '$propName' is not set ('$propValue')"
		}
		else
		{
			$cm = get-userprofileconfigmanager $siteUrl
			$spm = Get-SPProfileManager $siteUrl
			if ($spm.UserExists($userName))
			{
				$userProfile = $spm.GetUserProfile($userName);
				$tempProp = $spm.Properties.GetPropertyByName($propName);
				if ($tempProp -eq $null)
				{
					throw "User Profile Property '$propName' does not exist!";
				}
				else
				{
					$userProfile[$propName].Value = $propValue;
					$userProfile.Commit();
				}
				write-host -foregroundcolor green "'$propName' User Profile Property updated to '$propValue' for '$userName'"
				Write-Output "'$propName' User Profile Property updated to '$propValue' for '$userName'"
			}
			else
			{
				Write-Host -ForegroundColor red  "User '$userName' does not exist in User Profiles!"
				Write-output "User '$userName' does not exist in User Profiles!";
			}
		}
	}
}
 
################################################################
 
function MySiteProUpdate{
$username = "IB\Admin", "IB\Guest", "IB\PowerShell"
 
# Set MySite URL
$siteUrl = "http://mysites:3000"
 
# Notifies
Write-Host "Working... Please Wait"
Write-Output " "
 
foreach($u in $username){
# Executes command for all users in this script
Write-Output "Executing this command :  Update-UserProfileProperty $siteUrl $u ActiveEmployee true"
Update-UserProfileProperty $siteUrl "$u" "ActiveEmployee" "true"
}
# Dump Console
$textFileName = "C:\IBLogs\ConsoleDump.txt"
Get-ConsoleAsText | out-file $textFileName -encoding ascii
#$null = [System.Diagnostics.Process]::Start("$textFileName")
pause
}
################################################################
 
MySiteProUpdate | out-File C:\IBLogs\Progress.txt
  • Share/Bookmark

Posted by Isaac Blum at 20 October 2009

Category: Business, For The Greater Good

Tags: , ,

Looks like it has great potential for dev,test,prod!!!

sharegate compares and synchronizes your SharePoint sites in just three easy steps.

http://www.share-gate.com/

  • Share/Bookmark

Day Two was hugely better in my opinion.

 

Designing a SharePoint Infrastructure for The Cloud “Windows Azure” —  ITP227

·         Way Way too intro, great if you didn’t know about Azure.

·         Check this out  https://connect.microsoft.com/site/sitehome.aspx?SiteID=642 Learn it, know it!!!

 

Managing the Very Large Database: Best practices for administrators managing 1TB or more — DBA424

·         GREAT!!!!

·         Just did a bang up job. Went into the weeds and showed you what was going on.

·         Something I didn’t know: He spend a bit of time to explain Standard vs. enterprise edition, and made a statement, if you have a 1TB DB get enterprise. Since “he” says, Microsoft might not admit it, but it seems like the standard code is throttled. P.S. I’m sure I’m taking this out of context or didn’t remember it right, but the take away from this is to do more research on standard and enterprise.

·         To many indexes can hurt performance

·         Heaps load faster than clustered indexes

·         Index maintenance is a must and should be done regularly

·         SQL RAM guidance: 4gb per core, quad core = 16gb

·         “Quest Light Speed” http://www.quest.com/litespeed-for-sql-server/ for table level Backup and Restore

·         Lots of details into indexes and partitioning of databases. I can almost a guarantee this information will be used in the future.

·         I will do a follow-up posting with the good slides.

·         Randy THANK YOU!!!

Performance Monitoring Best Practices for SQL Server — DBA331

·         At Aspenware I do a lot of performance monitoring / testing reviews for our customers. And after this meet up, our customers are only going to get even more value for their money. I say this only because Andrew has more than 20+ years of SQL work, and it shows!!!!

·         Did lots of talking on how and where to store trace/perf mon statics. Use of a binary file a must.

·         Never load trace or perf data into tables when doing SQL performance monitoring

·         PAL – Codeplex

·         Log parser –MS

·         Relog & Logman – MS

·         Did you know?? SQL profiler will cause SQL to throttle back and may even drop events if it cannot get the information to the client. Meaning if you were to run SQL Profiler form a client computer to a SQL server and you had a slow network connection, you could actually cause the SQL server to preform worse than it would if you weren’t connected. This is also a caution to 3rd party apps for perf mon.

·         Also went into Wait Stats vs. File Stats. Great detail and Visual.

·         Xevents to replace profiler in 2010…

·         I will do a follow-up posting with the good slides.

·         Andrew THANK YOU!!!

SQL Server Consolidation and Virtualization Recommendations and Best Practices —  DBA336

·         WOW!!

·         Biggest thing I left with was SQL in a virtual environment. May acutely become a viable option in production!!

·         Next Generation HyperV processors with SLAT (Second Level Address Translation) technology. Going to be expensive cause latest tech, but will be very much worth the investment. And as always the prices will drop..

·         The following applies to Server 2008 R2 with HyperV:

o   %Processor Time – no longer works use HyperV Logical Processor in virtual server instance

o   Can now hot swap data devices. Ex: hard drives from one server to another.

o   Microsoft has a use case that says 6 to 1. 6 physical servers to every one physical virtual host. I always said 4 physical per virtual host, cause I thought MS Virtual Server software was not in the same league as VMware ESX. But looks like the hardware and their software has improved!!

o   If your application needs more than 4 processors, virtualization is not an option, since currently only 4 processors can be assigned to any one virtual instance.

·         I will do a follow-up posting with the good slides.

·         Lindsey THANK YOU!!!

Storage Best Practices for SharePoint Server – Part 1 —  ITP248

Storage Best Practices for SharePoint Server – Part 2 — ITP255

·         Never meet just a DISK guy before. And man he knows his stuff…. I think… Don’t have anything to compare to…

·         Highlights

o   SATA-3 coming soon 6 GBits

o   Super Speed USB coming 5 GBits

§  This technology is all to drive SSD stuff hitting the market.

·         The real benefits to his talk were his slides, he did a great job, and will post them soon.

·         He also spoke about  http://www.storagepoint.com/ And I can tell you right now, I’m going to be blogging more about this so hold on!!!

·         Just a ton of information about where the SSD market is going and how it effects the enterprise.

·         Know the difference between SSD: NAND-Flash SLC or MLC

·         Fastest performance at the moment is SSD: DRAM, but if it loses power you lose all your data. So many of these drives have batteries. Batteries fail so some even have SATA drives or Spinning drives of some sort to handle backup.

·         Some really interesting stuff about TEMPDB in SQL. He recommends moving just this DB to SSD, will help overall performance of SQL server.

·         The SAN market is about to change, so if you’re about to purchase one you may hold off bit. Many companies say they will be support all SSD drives but currently no one does, mainly the HD controllers are too slow. The manufactures are rushing to resolve issue. At the moment you can only find mix scenarios Ex: SSD, SAS or SSD, SAS, SATA.

·         Also look into FCoE.

  • Share/Bookmark

Posted by Isaac Blum at 8 May 2009

Category: Business, For The Greater Good, SharePoint

Tags: , , , , , , , ,

** be forewarned this is a ramble and I may or may not come back and fix this…..

 

 

I have two domain controllers that are Windows Server 2008, A WSS Farm. One web front end (application server, search, Sites) and a SQL server. I have been convinced for months that I had Kerberos setup correctly in my environment. And I couldn’t find any errors anywhere, and fiddler http://www.fiddler2.com/fiddler2/  showed that I was getting Kerberos tickets. However every time I opened an office 2007 document I would get another password challenge. I have spent days working on this issue. Thinking that my AD was broke so, plenty of trial and error attempts, then thinking it was an SPN issue, so again a billion more attempts there, Then I thought oh it’s the Web front, a billion and one attempts there.

 

Finally I was requested to do some desktop support, this user has XP. (some background) Since I had broke and re-broke our group policies, mainly to use a blank one to see if that was the trick. This cause out trusted sites to get messed up.) I thought well let me see if this is an Vista issue. And sure enough it work correctly in XP. So I started to do some research and finally came across this link. http://support.microsoft.com/?id=943280 not sure if this is just a hack to the system or not, but it works. Throw me a line if you need help with it. Thanks

 

 

Search phrases:

I broke my keyboard trying to figure this out.

Double authentication prompt office

Double authentication prompt office 2007 vista

Kerberos enabled but office prompts for password

Kerberos enabled office double prompts

Double authentication prompt office wss

Double authentication prompt office 2007 vista wss

Kerberos enabled but office prompts for password wss

Kerberos enabled office double prompts wss

Double authentication prompt office moss

Double authentication prompt office 2007 vista moss

Kerberos enabled but office prompts for password moss

Kerberos enabled office double prompts moss

  • Share/Bookmark

This was the code i used.
(This one is used on the OOB, SharePoint Login Page)

1
2
3
4
5
6
7
8
 <tr style="display:none">
            <td colSpan=2><asp:CheckBox id=RememberMe text="<%$SPHtmlEncodedResources:wss,login_pageRememberMe%>" runat=server /></td>
        </tr>
        </table>
  <script type="text/javascript">
  document.getElementById("ctl00_PlaceHolderMain_login_RememberMe").checked=true;
  </script>
    </layouttemplate>

(This one is used for a login page with the CKS login webpart. This webpart can be found http://www.codeplex.com/CKS/Release/ProjectReleases.aspx?ReleaseId=17901 )

1
2
3
4
5
<script type="text/javascript">
  document.getElementById("ctl00_m_g_806a3820_932f_4356_bd73_13f19bbbec42_ctl00_RememberMe").checked=true;
var row = document.getElementById("ctl00_m_g_806a3820_932f_4356_bd73_13f19bbbec42_ctl00_RememberMe");
row.style.display = 'none';
</script>
  • Share/Bookmark
  • Archives

  • Pages

  • Tags

  • More

Get Adobe Flash playerPlugin by wpburn.com wordpress themes