Posts Tagged ‘MOSS’

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 22 December 2009

Category: Business, For The Greater Good, Microsoft, SharePoint, WSS 3.0

Tags: , , ,

Thanks to http://blogs.msdn.com/sharepoint/archive/2007/03/02/be-wary-when-removing-or-replacing-the-my-site-link.aspx and http://suguk.org/forums/thread/6898.aspx.

I needed a way of adding a link back to the portal site, when in my MySite. I went to “Personalization site links”. Added a link but every time it would add the http://%yoururl%/default.aspx?MySiteView=1 . Made me crazy. Anyway thanks to the folks that bloged about it first.

  • Share/Bookmark

Thanks goes to the following people/sites: http://blogs.msdn.com/dansellers/archive/2005/11/09/491152.aspx & http://windowsitpro.com/Web/article/articleid/9738/extending-the-user-class-in-the-ad-schema.html 

Enable Password Question and Password Reset:

When these attributes are set to true in the web config file as seen below, the user is required to provide an answer to a Password Question when the password is first created.  When the user resets their password, they will also be required to provider the answer they supplied to the Password Question when the password was first created. 

<membership defaultProvider=”ADAMProvider”>
  <providers>
    <add
      connectionStringName=”ADCnString”
      connectionUsername=”CN=ADAdmin,OU=Users,O=ADAuth”
      connectionPassword=Pass@word1
      connectionProtection=”None”
      requiresQuestionAndAnswer=”true”
      enablePasswordReset=”true” …

Mapping Password Question and Answer Attributes:

Both the Password Question and the Answer will be saved in the SQL Server, Active Directory, or the Active Directory Application Mode (ADAM) depending upon the provider you are using. However, if you are using the Active Directory Provider you will be required to modify the schema of either the Active Directory or ADAM to store the Password Question and Password Answer.  Then in the web config file you will need map the Password Question and Answer’s attributes to the modified schema as shown below:

<membership defaultProvider=”ADAMProvider”>
   <providers>
      <add
         connectionStringName=”ADCnString”
         connectionUsername=”CN=ADAdmin,OU=Users,O=ADAuth”
         connectionPassword=Pass@word1
         connectionProtection=”None”
         requiresQuestionAndAnswer=”true”
         enablePasswordReset=”true”
         attributeMapPasswordQuestion=”PwdQuestion”
         attributeMapPasswordAnswer=”PwdAnswer” …
 

Example Schema Modification:

Creating the PwdQuestion and PwdAnswer attribute as defined above is not difficult in the ADAM ADSI Edit tool under the Schema configuration, but initially it takes a while to figure out what values required by the attribute schema wizard.  Below is an example of the values that you can use in your Active Directory or ADAM directory.

    cn:  PwdQuestion
    OMSyntax: 64 (for Unicode string)
    lDAPDisplayName: PwdQuestion
    isSingleValued: TRUE
    AttributeSyntax: 2.5.5.12 (Active Directory syntax type of Unicode)
    AttributeID: 1.2.840.113556.1.6.1.1.6221 (Unique Object Identifiers (OIDs))

    cn:  PwdAnswer
    OMSyntax: 64 (for Unicode string)
    lDAPDisplayName: PwdAnswer
    isSingleValued: TRUE
    AttributeSyntax: 2.5.5.12
    AttributeID: 1.2.840.113556.1.6.1.1.6222

Schema modifications:
Creating the Failed Password Count, Failed Password Answer Time and Failed Password Locked Out Time attributes–as defined below–is not difficult in the ADAM ADSI Edit tool under the Schema configuration, but initially it takes a while to figure out what values are required by the attribute schema wizard. Below is an example of the values that you can use in your Active Directory or ADAM directory.

cn: FailedPwdCount
OMSyntax: 2 (for type integer)
lDAPDisplayName: FailedPwdCount
isSingleValued: TRUE
AttributeSyntax: 2.5.5.9 (Active Directory syntax type of Unicode)
AttributeID: 1.2.840.113556.1.6.1.1.6223 (Unique Object Identifiers (OIDs))

cn: FailedPwdAnswerTime
OMSyntax: 65 (for Large integer/Interval)
lDAPDisplayName: FailedPwdAnswerTime
isSingleValued: TRUE
AttributeSyntax: 2.5.5.16
AttributeID: 1.2.840.113556.1.6.1.1.6224

cn: FailedPwdLockOutTime
OMSyntax: 65 (for Large integer/Interval)
lDAPDisplayName: FailedPwdLockOutTime
isSingleValued: TRUE
AttributeSyntax: 2.5.5.16
AttributeID: 1.2.840.113556.1.6.1.1.6225

Modify Web Config File:
When using the Active Directory Provider you will be required to modify the Web config to map the Failed Password Answer Count, Failed Password Answer Time and Failed Password Answer Lockout Time attributes to the appropriate User’s properties (as created above) in either your Active Directory or ADAM.

<membership defaultProvider=”ADAMProvider”>
   <providers>
      <add

connectionStringName=”ADCnString”
connectionUsername=”CN=ADAdmin,OU=Users,O=ADAuth”
connectionPassword=Pass@word1
connectionProtection=”None”
requiresQuestionAndAnswer=”true”
enablePasswordReset=”true”
attributeMapPasswordQuestion=”PwdQuestion”
attributeMapPasswordAnswer=”PwdAnswer”
attributeMapFailedPasswordAnswerCount=”FailedPwdCount” attributeMapFailedPasswordAnswerTime=”FailedPwdAnswerTime”
attributeMapFailedPasswordAnswerLockoutTime=”FailedPwdLockOutTime”

(Adding the attributes to the user clasee)

From the Schema Console, click the Class folder. Scroll down to the User class, right-click it, and select Properties. On the user Properties dialog box, click the Attributes tab, which Figure 7 shows. Click Add, then choose the Gender attribute. Click OK twice, and you’ve successfully added the Gender attribute to the User class.

  • Share/Bookmark

Posted by Isaac Blum at 29 October 2009

Category: Business, For The Greater Good, Free Help, MOSS 2007, Microsoft, SharePoint, WSS 3.0

Tags: , , , , , , ,

Out of the box neither WSS 3 nor MOSS 2007 will index content located in Acrobat PDF files, so you need to set up the IFilter.  I’ve also found that that PDF files loaded prior to the installation of the filter won’t be re-crawled automatically, so to be on the safe side you might want to kick off a full crawl.

Here is what I’ve found works for WSS 3.0:

  1. First, you need to download the Adobe PDF IFilter 6.0, which you can find at this URL.  You should also get hold of a suitable Icon to use with PDFs, so that when they are listed in a document library they are easily recognisable.  There is a 17 x 17 one available on the Adobe web site here.
  2. Once you’ve downloaded the IFilter, install it on your WSS 3.0 server, and then follow the instructions on registry settings in Microsoft KB Article 927675.  I’ve always found that providing the Adobe IFilter installed properly, the only setting I need to add is the Search Extensions one listed in step 2.  Also note step 5 re stopping and re-starting the search service.
  3. Now you need to set up the Icon file.  If you downloaded the icon file in step 1 above, you will have a file called pdficon_small.gif.  You need to copy this onto your WSS 3.0 server, into drive:\Program Files\Common FIles\Microsoft Shared\Web Server extensions\12\TEMPLATE\IMAGES.
  4. Next you need to edit the XML file which WSS uses to link file extensions to icons.  This file is called DOCICON.XML and is located at drive:\Program Files\Common FIles\Microsoft Shared\Web Server extensions\12\TEMPLATE\XML.  Navigate to that folder and locate the file.  I would suggest making a backup copy first, then opening the file in NotePad.  You need to add a mapping key for PDFs at the bottom of the file, above the </ByExtension> closing tag.  The new key will be <Mapping Key=”pdf” Value=”pdficon_small.gif” OpenControl=”"/>  (note that XML is case sensitive so make sure you use same case as previous entries).  Then save the file.
  5. That’s pretty much it, but if you already have PDFs uploaded to your WSS server I would recommend starting a full crawl.  You can do the with STSAdm, the command syntax is Stsadm -o spsearch -action fullcrawlstart .  More on this on TechNet here.
  • 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

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