<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Isaac&#039;s Blog &#187; MOSS 2007</title>
	<atom:link href="http://blog.isaacblum.com/category/sharepoint/moss-2007/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.isaacblum.com</link>
	<description>So Many Rambles So Little Time....</description>
	<lastBuildDate>Fri, 14 May 2010 20:26:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>PowerShell &#8211; Bulk Update MOSS Profile</title>
		<link>http://blog.isaacblum.com/2010/01/21/powershell-bulk-update-moss-profile/</link>
		<comments>http://blog.isaacblum.com/2010/01/21/powershell-bulk-update-moss-profile/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 15:33:47 +0000</pubDate>
		<dc:creator>Isaac Blum</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[For The Greater Good]]></category>
		<category><![CDATA[Free Help]]></category>
		<category><![CDATA[MOSS 2007]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Bulk]]></category>
		<category><![CDATA[MOSS]]></category>
		<category><![CDATA[Profile]]></category>
		<category><![CDATA[SSP]]></category>
		<category><![CDATA[Update]]></category>

		<guid isPermaLink="false">http://blog.isaacblum.com/?p=257</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<p>The below links were used to create this script. Thanks</p>
<p>http://blogs.msdn.com/powershell/archive/2009/01/10/capture-console-screen.aspx</p>
<p>http://www.sharepointdevwiki.com/display/public/Updating+User+Profiles+in+SharePoint+SSP+using+PowerShell</p>
<p>http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,a332015d-c5dc-4433-a0f3-247fd37b0b04.aspx</p>
<p>Download the file <a href="http://isaacblum.com/wp-content/uploads/2010/01/Bulk-Update-MOSS-profiles.ps1">here</a></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>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
</pre></td><td class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #000000;">&#91;</span>void<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>reflection.assembly<span style="color: #000000;">&#93;</span>::<span style="color: #800000;">Load</span>withpartialname<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;Microsoft.SharePoint&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">out-null</span>
<span style="color: #000000;">&#91;</span>void<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>reflection.assembly<span style="color: #000000;">&#93;</span>::<span style="color: #800000;">Load</span>withpartialname<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;Microsoft.Office.Server.Search&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">out-null</span>
<span style="color: #000000;">&#91;</span>void<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>reflection.assembly<span style="color: #000000;">&#93;</span>::<span style="color: #800000;">Load</span>withpartialname<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;Microsoft.Office.Server&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">out-null</span>
&nbsp;
<span style="color: #008000;">#################################################################################################################</span>
<span style="color: #008000;"># Get-ConsoleAsText.ps1</span>
<span style="color: #008000;"># Thanks to http://blogs.msdn.com/powershell/archive/2009/01/10/capture-console-screen.aspx for Get-ConsoleAsText.ps1</span>
<span style="color: #008000;"># The script captures console screen buffer up to the current cursor position and returns it in plain text format.</span>
<span style="color: #008000;">#</span>
<span style="color: #008000;"># Returns: ASCII-encoded string.</span>
<span style="color: #008000;">#</span>
<span style="color: #008000;"># Example:</span>
<span style="color: #008000;">#</span>
<span style="color: #008000;"># $textFileName = &quot;$env:temp\ConsoleBuffer.txt&quot;</span>
<span style="color: #008000;"># .\Get-ConsoleAsText | out-file $textFileName -encoding ascii</span>
<span style="color: #008000;"># $null = [System.Diagnostics.Process]::Start(&quot;$textFileName&quot;)</span>
<span style="color: #008000;">#################################################################################################################</span>
<span style="color: #0000FF;">function</span> Get<span style="color: pink;">-</span>ConsoleAsText<span style="color: #000000;">&#123;</span>
<span style="color: #008000;"># Check the host name and exit if the host is not the Windows PowerShell console host.</span>
<span style="color: #0000FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$host</span>.Name <span style="color: #FF0000;">-ne</span> <span style="color: #800000;">'ConsoleHost'</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
  <span style="color: #008080; font-weight: bold;">write-host</span> <span style="color: #008080; font-style: italic;">-ForegroundColor</span> Red <span style="color: #800000;">&quot;This script runs only in the console host. You cannot run this script in $($host.Name).&quot;</span>
  exit <span style="color: pink;">-</span><span style="color: #000000;">1</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #008000;"># Initialize string builder.</span>
<span style="color: #800080;">$textBuilder</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">new-object</span> system.text.stringbuilder
&nbsp;
<span style="color: #008000;"># Grab the console screen buffer contents using the Host console API.</span>
<span style="color: #800080;">$bufferWidth</span> <span style="color: pink;">=</span> <span style="color: #800080;">$host</span>.ui.rawui.BufferSize.Width
<span style="color: #800080;">$bufferHeight</span> <span style="color: pink;">=</span> <span style="color: #800080;">$host</span>.ui.rawui.CursorPosition.Y
<span style="color: #800080;">$rec</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">new-object</span> System.Management.Automation.Host.Rectangle <span style="color: #000000;">0</span><span style="color: pink;">,</span><span style="color: #000000;">0</span><span style="color: pink;">,</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$bufferWidth</span> <span style="color: pink;">-</span> <span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><span style="color: pink;">,</span><span style="color: #800080;">$bufferHeight</span>
<span style="color: #800080;">$buffer</span> <span style="color: pink;">=</span> <span style="color: #800080;">$host</span>.ui.rawui.GetBufferContents<span style="color: #000000;">&#40;</span><span style="color: #800080;">$rec</span><span style="color: #000000;">&#41;</span>
&nbsp;
<span style="color: #008000;"># Iterate through the lines in the console buffer.</span>
<span style="color: #0000FF;">for</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$i</span> <span style="color: pink;">=</span> <span style="color: #000000;">0</span>; <span style="color: #800080;">$i</span> <span style="color: #FF0000;">-lt</span> <span style="color: #800080;">$bufferHeight</span>; <span style="color: #800080;">$i</span><span style="color: pink;">++</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
  <span style="color: #0000FF;">for</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$j</span> <span style="color: pink;">=</span> <span style="color: #000000;">0</span>; <span style="color: #800080;">$j</span> <span style="color: #FF0000;">-lt</span> <span style="color: #800080;">$bufferWidth</span>; <span style="color: #800080;">$j</span><span style="color: pink;">++</span><span style="color: #000000;">&#41;</span>
  <span style="color: #000000;">&#123;</span>
    <span style="color: #800080;">$cell</span> <span style="color: pink;">=</span> <span style="color: #800080;">$buffer</span><span style="color: #000000;">&#91;</span><span style="color: #800080;">$i</span><span style="color: pink;">,</span><span style="color: #800080;">$j</span><span style="color: #000000;">&#93;</span>
    <span style="color: #800080;">$null</span> <span style="color: pink;">=</span> <span style="color: #800080;">$textBuilder</span>.Append<span style="color: #000000;">&#40;</span><span style="color: #800080;">$cell</span>.Character<span style="color: #000000;">&#41;</span>
  <span style="color: #000000;">&#125;</span>
  <span style="color: #800080;">$null</span> <span style="color: pink;">=</span> <span style="color: #800080;">$textBuilder</span>.Append<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;<span style="color: #008080; font-weight: bold;">`r</span><span style="color: #008080; font-weight: bold;">`n</span>&quot;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #0000FF;">return</span> <span style="color: #800080;">$textBuilder</span>.ToString<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #008000;">################################################################</span>
&nbsp;
<span style="color: #008000;"># Pause Script</span>
<span style="color: #0000FF;">function</span> Pause <span style="color: #000000;">&#40;</span><span style="color: #800080;">$Message</span><span style="color: pink;">=</span><span style="color: #800000;">&quot;Script Complete. Press any key to continue...&quot;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #008080; font-style: italic;">-NoNewLine</span> <span style="color: #800080;">$Message</span>
<span style="color: #800080;">$null</span> <span style="color: pink;">=</span> <span style="color: #000080;">$Host</span>.UI.RawUI.ReadKey<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;NoEcho,IncludeKeyDown&quot;</span><span style="color: #000000;">&#41;</span>
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;&quot;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #008000;">################################################################</span>
&nbsp;
<span style="color: #0000FF;">function</span> Get<span style="color: pink;">-</span>UserProfileConfigManager<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span><span style="color: #800080;">$siteUrl</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #008000;"># Need to get a PortalContext object</span>
<span style="color: #008000;"># as we do not have a HttpContext we need to source one the hard way</span>
<span style="color: #800080;">$site</span><span style="color: pink;">=</span><span style="color: #008080; font-weight: bold;">new-object</span> Microsoft.SharePoint.SPSite<span style="color: #000000;">&#40;</span><span style="color: #800080;">$siteUrl</span><span style="color: #000000;">&#41;</span>
<span style="color: #800080;">$servercontext</span><span style="color: pink;">=</span><span style="color: #000000;">&#91;</span>Microsoft.Office.Server.ServerContext<span style="color: #000000;">&#93;</span>::GetContext<span style="color: #000000;">&#40;</span><span style="color: #800080;">$site</span><span style="color: #000000;">&#41;</span>
<span style="color: #800080;">$site</span>.Dispose<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;"># clean up</span>
&nbsp;
<span style="color: #008000;">################################################################</span>
&nbsp;
<span style="color: #008000;"># Return the UserProfileConfigManager</span>
<span style="color: #008080; font-weight: bold;">new-object</span> Microsoft.Office.Server.UserProfiles.UserProfileConfigmanager<span style="color: #000000;">&#40;</span><span style="color: #800080;">$servercontext</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #0000FF;">function</span> Get<span style="color: pink;">-</span>SPProfileManager<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span><span style="color: #800080;">$siteUrl</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #008000;"># Need to get a PortalContext object</span>
<span style="color: #008000;"># as we do not have a HttpContext we need to source one the hard way</span>
<span style="color: #800080;">$site</span><span style="color: pink;">=</span><span style="color: #008080; font-weight: bold;">new-object</span> Microsoft.SharePoint.SPSite<span style="color: #000000;">&#40;</span><span style="color: #800080;">$siteUrl</span><span style="color: #000000;">&#41;</span>
<span style="color: #800080;">$servercontext</span><span style="color: pink;">=</span><span style="color: #000000;">&#91;</span>Microsoft.Office.Server.ServerContext<span style="color: #000000;">&#93;</span>::GetContext<span style="color: #000000;">&#40;</span><span style="color: #800080;">$site</span><span style="color: #000000;">&#41;</span>
<span style="color: #800080;">$site</span>.Dispose<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;"># clean up</span>
&nbsp;
<span style="color: #008000;">################################################################</span>
&nbsp;
<span style="color: #008000;"># Return the UserProfileManager</span>
<span style="color: #008080; font-weight: bold;">new-object</span> Microsoft.Office.Server.UserProfiles.UserProfileManager<span style="color: #000000;">&#40;</span><span style="color: #800080;">$servercontext</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #0000FF;">function</span> Get<span style="color: pink;">-</span>SPUserProfile<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span><span style="color: #800080;">$siteUrl</span><span style="color: pink;">,</span> <span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$u</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #800080;">$upm</span><span style="color: pink;">=</span> Get<span style="color: pink;">-</span>SPProfileManager<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span><span style="color: #800080;">$siteUrl</span><span style="color: #000000;">&#41;</span>
<span style="color: #0000FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$upm</span>.UserExists<span style="color: #000000;">&#40;</span><span style="color: #800080;">$u</span><span style="color: #000000;">&#41;</span> <span style="color: #FF0000;">-eq</span> <span style="color: #800080;">$false</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #800080;">$upm</span>.CreateUserProfile<span style="color: #000000;">&#40;</span><span style="color: #800080;">$u</span><span style="color: #000000;">&#41;</span>
&nbsp;
<span style="color: #800080;">$upm</span>.GetUserProfile<span style="color: #000000;">&#40;</span><span style="color: #800080;">$u</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #008000;">################################################################</span>
&nbsp;
<span style="color: #008000;"># Create function</span>
<span style="color: #0000FF;">function</span> Update<span style="color: pink;">-</span>UserProfileProperty<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #0000FF;">PARAM</span>
	<span style="color: #000000;">&#40;</span>
		<span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$siteUrl</span> <span style="color: pink;">=</span> $<span style="color: #000000;">&#40;</span> <span style="color: #0000FF;">throw</span> <span style="color: #800000;">&quot;You must provide a Site Collection Url e.g. 'http://moss/'&quot;</span><span style="color: #000000;">&#41;</span><span style="color: pink;">,</span>
		<span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$userName</span> <span style="color: pink;">=</span> $<span style="color: #000000;">&#40;</span> <span style="color: #0000FF;">throw</span> <span style="color: #800000;">&quot;You must provide a User Name e.g. 'DOMAIN\USERNAME'&quot;</span><span style="color: #000000;">&#41;</span><span style="color: pink;">,</span>
		<span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$propName</span> <span style="color: pink;">=</span> $<span style="color: #000000;">&#40;</span> <span style="color: #0000FF;">throw</span> <span style="color: #800000;">&quot;You must provide a User Profile Property Name e.g. 'WorkPhone'&quot;</span><span style="color: #000000;">&#41;</span><span style="color: pink;">,</span>
		<span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$propValue</span> <span style="color: pink;">=</span> $<span style="color: #000000;">&#40;</span> <span style="color: #0000FF;">throw</span> <span style="color: #800000;">&quot;You must provide a User Profile Property Value e.g. '0400 767 022'&quot;</span><span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#41;</span>
	END
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0000FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$propValue</span> <span style="color: #FF0000;">-eq</span> <span style="color: #800000;">&quot;NULL&quot;</span> <span style="color: #FF0000;">-or</span> <span style="color: #800080;">$propValue</span> <span style="color: #FF0000;">-eq</span> <span style="color: #800000;">&quot;&quot;</span> <span style="color: #FF0000;">-or</span> <span style="color: #800080;">$propValue</span> <span style="color: #FF0000;">-eq</span> <span style="color: #800000;">&quot;None&quot;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;Property '$propName' is not set ('$propValue')&quot;</span>
		<span style="color: #000000;">&#125;</span>
		<span style="color: #0000FF;">else</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #800080;">$cm</span> <span style="color: pink;">=</span> get<span style="color: pink;">-</span>userprofileconfigmanager <span style="color: #800080;">$siteUrl</span>
			<span style="color: #800080;">$spm</span> <span style="color: pink;">=</span> Get<span style="color: pink;">-</span>SPProfileManager <span style="color: #800080;">$siteUrl</span>
			<span style="color: #0000FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$spm</span>.UserExists<span style="color: #000000;">&#40;</span><span style="color: #800080;">$userName</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #800080;">$userProfile</span> <span style="color: pink;">=</span> <span style="color: #800080;">$spm</span>.GetUserProfile<span style="color: #000000;">&#40;</span><span style="color: #800080;">$userName</span><span style="color: #000000;">&#41;</span>;
				<span style="color: #800080;">$tempProp</span> <span style="color: pink;">=</span> <span style="color: #800080;">$spm</span>.Properties.GetPropertyByName<span style="color: #000000;">&#40;</span><span style="color: #800080;">$propName</span><span style="color: #000000;">&#41;</span>;
				<span style="color: #0000FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$tempProp</span> <span style="color: #FF0000;">-eq</span> <span style="color: #800080;">$null</span><span style="color: #000000;">&#41;</span>
				<span style="color: #000000;">&#123;</span>
					<span style="color: #0000FF;">throw</span> <span style="color: #800000;">&quot;User Profile Property '$propName' does not exist!&quot;</span>;
				<span style="color: #000000;">&#125;</span>
				<span style="color: #0000FF;">else</span>
				<span style="color: #000000;">&#123;</span>
					<span style="color: #800080;">$userProfile</span><span style="color: #000000;">&#91;</span><span style="color: #800080;">$propName</span><span style="color: #000000;">&#93;</span>.Value <span style="color: pink;">=</span> <span style="color: #800080;">$propValue</span>;
					<span style="color: #800080;">$userProfile</span>.Commit<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
				<span style="color: #000000;">&#125;</span>
				<span style="color: #008080; font-weight: bold;">write-host</span> <span style="color: #008080; font-style: italic;">-foregroundcolor</span> green <span style="color: #800000;">&quot;'$propName' User Profile Property updated to '$propValue' for '$userName'&quot;</span>
				<span style="color: #008080; font-weight: bold;">Write-Output</span> <span style="color: #800000;">&quot;'$propName' User Profile Property updated to '$propValue' for '$userName'&quot;</span>
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0000FF;">else</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #008080; font-style: italic;">-ForegroundColor</span> red  <span style="color: #800000;">&quot;User '$userName' does not exist in User Profiles!&quot;</span>
				<span style="color: #008080; font-weight: bold;">Write-output</span> <span style="color: #800000;">&quot;User '$userName' does not exist in User Profiles!&quot;</span>;
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #008000;">################################################################</span>
&nbsp;
<span style="color: #0000FF;">function</span> MySiteProUpdate<span style="color: #000000;">&#123;</span>
<span style="color: #800080;">$username</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;IB\Admin&quot;</span><span style="color: pink;">,</span> <span style="color: #800000;">&quot;IB\Guest&quot;</span><span style="color: pink;">,</span> <span style="color: #800000;">&quot;IB\PowerShell&quot;</span>
&nbsp;
<span style="color: #008000;"># Set MySite URL</span>
<span style="color: #800080;">$siteUrl</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;http://mysites:3000&quot;</span>
&nbsp;
<span style="color: #008000;"># Notifies</span>
<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;Working... Please Wait&quot;</span>
<span style="color: #008080; font-weight: bold;">Write-Output</span> <span style="color: #800000;">&quot; &quot;</span>
&nbsp;
<span style="color: #0000FF;">foreach</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$u</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$username</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>
<span style="color: #008000;"># Executes command for all users in this script</span>
<span style="color: #008080; font-weight: bold;">Write-Output</span> <span style="color: #800000;">&quot;Executing this command :  Update-UserProfileProperty $siteUrl $u ActiveEmployee true&quot;</span>
Update<span style="color: pink;">-</span>UserProfileProperty <span style="color: #800080;">$siteUrl</span> <span style="color: #800000;">&quot;$u&quot;</span> <span style="color: #800000;">&quot;ActiveEmployee&quot;</span> <span style="color: #800000;">&quot;true&quot;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #008000;"># Dump Console</span>
<span style="color: #800080;">$textFileName</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;C:\IBLogs\ConsoleDump.txt&quot;</span>
Get<span style="color: pink;">-</span>ConsoleAsText <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">out-file</span> <span style="color: #800080;">$textFileName</span> <span style="color: #008080; font-style: italic;">-encoding</span> ascii
<span style="color: #008000;">#$null = [System.Diagnostics.Process]::Start(&quot;$textFileName&quot;)</span>
pause
<span style="color: #000000;">&#125;</span>
<span style="color: #008000;">################################################################</span>
&nbsp;
MySiteProUpdate <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">out-File</span> C:\IBLogs\Progress.txt</pre></td></tr></table></div>

<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.isaacblum.com%2F2010%2F01%2F21%2Fpowershell-bulk-update-moss-profile%2F&amp;linkname=PowerShell%20%26%238211%3B%20Bulk%20Update%20MOSS%20Profile"><img src="http://blog.isaacblum.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.isaacblum.com/2010/01/21/powershell-bulk-update-moss-profile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SharePoint Rambles around FBA and Active Directory.</title>
		<link>http://blog.isaacblum.com/2009/11/09/sharepoint-rambles-around-fba-and-active-directory/</link>
		<comments>http://blog.isaacblum.com/2009/11/09/sharepoint-rambles-around-fba-and-active-directory/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 15:17:29 +0000</pubDate>
		<dc:creator>Isaac Blum</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[For The Greater Good]]></category>
		<category><![CDATA[Free Help]]></category>
		<category><![CDATA[MOSS 2007]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Active Directory Schema]]></category>
		<category><![CDATA[AD]]></category>
		<category><![CDATA[Attributes]]></category>
		<category><![CDATA[FBA]]></category>
		<category><![CDATA[Forms Based Authentication]]></category>
		<category><![CDATA[MOSS]]></category>
		<category><![CDATA[Password Question]]></category>
		<category><![CDATA[Password Reset]]></category>
		<category><![CDATA[schema]]></category>
		<category><![CDATA[Schema Modification]]></category>
		<category><![CDATA[SharePoint 2007]]></category>
		<category><![CDATA[web.config]]></category>
		<category><![CDATA[WSS]]></category>
		<category><![CDATA[WSS 3.0]]></category>

		<guid isPermaLink="false">http://blog.isaacblum.com/?p=201</guid>
		<description><![CDATA[Thanks goes to the following people/sites: http://blogs.msdn.com/dansellers/archive/2005/11/09/491152.aspx &#38; 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 [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks goes to the following people/sites: <a href="http://blogs.msdn.com/dansellers/archive/2005/11/09/491152.aspx">http://blogs.msdn.com/dansellers/archive/2005/11/09/491152.aspx</a> &amp; <a href="http://windowsitpro.com/Web/article/articleid/9738/extending-the-user-class-in-the-ad-schema.html">http://windowsitpro.com/Web/article/articleid/9738/extending-the-user-class-in-the-ad-schema.html</a> </p>
<p>Enable Password Question and Password Reset:</p>
<p>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. </p>
<p>&lt;membership defaultProvider=&#8221;ADAMProvider&#8221;&gt;<br />
  &lt;providers&gt;<br />
    &lt;add<br />
      connectionStringName=&#8221;ADCnString&#8221;<br />
      connectionUsername=&#8221;CN=ADAdmin,OU=Users,O=ADAuth&#8221;<br />
      <a href="mailto:connectionPassword=Pass@word1">connectionPassword=Pass@word1</a><br />
      connectionProtection=&#8221;None&#8221;<br />
      requiresQuestionAndAnswer=&#8221;true&#8221;<br />
      enablePasswordReset=&#8221;true&#8221; &#8230;</p>
<p>Mapping Password Question and Answer Attributes:</p>
<p>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:</p>
<p>&lt;membership defaultProvider=&#8221;ADAMProvider&#8221;&gt;<br />
   &lt;providers&gt;<br />
      &lt;add<br />
         connectionStringName=&#8221;ADCnString&#8221;<br />
         connectionUsername=&#8221;CN=ADAdmin,OU=Users,O=ADAuth&#8221;<br />
         <a href="mailto:connectionPassword=Pass@word1">connectionPassword=Pass@word1</a><br />
         connectionProtection=&#8221;None&#8221;<br />
         requiresQuestionAndAnswer=&#8221;true&#8221;<br />
         enablePasswordReset=&#8221;true&#8221;<br />
         attributeMapPasswordQuestion=&#8221;PwdQuestion&#8221;<br />
         attributeMapPasswordAnswer=&#8221;PwdAnswer&#8221; &#8230;<br />
 </p>
<p>Example Schema Modification:</p>
<p>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.</p>
<p>    cn:  PwdQuestion<br />
    OMSyntax: 64 (for Unicode string)<br />
    lDAPDisplayName: PwdQuestion<br />
    isSingleValued: TRUE<br />
    AttributeSyntax: 2.5.5.12 (Active Directory syntax type of Unicode)<br />
    AttributeID: 1.2.840.113556.1.6.1.1.6221 (Unique Object Identifiers (OIDs))</p>
<p>    cn:  PwdAnswer<br />
    OMSyntax: 64 (for Unicode string)<br />
    lDAPDisplayName: PwdAnswer<br />
    isSingleValued: TRUE<br />
    AttributeSyntax: 2.5.5.12<br />
    AttributeID: 1.2.840.113556.1.6.1.1.6222</p>
<p>Schema modifications:<br />
Creating the Failed Password Count, Failed Password Answer Time and Failed Password Locked Out Time attributes&#8211;as defined below&#8211;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.</p>
<p>cn: FailedPwdCount<br />
OMSyntax: 2 (for type integer)<br />
lDAPDisplayName: FailedPwdCount<br />
isSingleValued: TRUE<br />
AttributeSyntax: 2.5.5.9 (Active Directory syntax type of Unicode)<br />
AttributeID: 1.2.840.113556.1.6.1.1.6223 (Unique Object Identifiers (OIDs))</p>
<p>cn: FailedPwdAnswerTime<br />
OMSyntax: 65 (for Large integer/Interval)<br />
lDAPDisplayName: FailedPwdAnswerTime<br />
isSingleValued: TRUE<br />
AttributeSyntax: 2.5.5.16<br />
AttributeID: 1.2.840.113556.1.6.1.1.6224</p>
<p>cn: FailedPwdLockOutTime<br />
OMSyntax: 65 (for Large integer/Interval)<br />
lDAPDisplayName: FailedPwdLockOutTime<br />
isSingleValued: TRUE<br />
AttributeSyntax: 2.5.5.16<br />
AttributeID: 1.2.840.113556.1.6.1.1.6225</p>
<p>Modify Web Config File:<br />
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.</p>
<p>&lt;membership defaultProvider=&#8221;ADAMProvider&#8221;&gt;<br />
   &lt;providers&gt;<br />
      &lt;add</p>
<p>connectionStringName=&#8221;ADCnString&#8221;<br />
connectionUsername=&#8221;CN=ADAdmin,OU=Users,O=ADAuth&#8221;<br />
connectionPassword=Pass@word1<br />
connectionProtection=&#8221;None&#8221;<br />
requiresQuestionAndAnswer=&#8221;true&#8221;<br />
enablePasswordReset=&#8221;true&#8221;<br />
attributeMapPasswordQuestion=&#8221;PwdQuestion&#8221;<br />
attributeMapPasswordAnswer=&#8221;PwdAnswer&#8221;<br />
attributeMapFailedPasswordAnswerCount=&#8221;FailedPwdCount&#8221; attributeMapFailedPasswordAnswerTime=&#8221;FailedPwdAnswerTime&#8221;<br />
attributeMapFailedPasswordAnswerLockoutTime=&#8221;FailedPwdLockOutTime&#8221;</p>
<p>(Adding the attributes to the user clasee)</p>
<p>From the Schema Console, click the Class folder. Scroll down to the User class, right-click it, and select Properties. On the <em>user Properties</em> dialog box, click the Attributes tab, which <a href="http://windowsitpro.com/Files/11/9738/figure_07.gif">Figure 7</a> shows. Click Add, then choose the Gender attribute. Click OK twice, and you&#8217;ve successfully added the Gender attribute to the User class.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.isaacblum.com%2F2009%2F11%2F09%2Fsharepoint-rambles-around-fba-and-active-directory%2F&amp;linkname=SharePoint%20Rambles%20around%20FBA%20and%20Active%20Directory."><img src="http://blog.isaacblum.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.isaacblum.com/2009/11/09/sharepoint-rambles-around-fba-and-active-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rename your SharePoint_AdminContent_guid database with stsadm mergecontentdbs operation</title>
		<link>http://blog.isaacblum.com/2009/11/02/rename-your-sharepoint_admincontent_guid-database-with-stsadm-mergecontentdbs-operation/</link>
		<comments>http://blog.isaacblum.com/2009/11/02/rename-your-sharepoint_admincontent_guid-database-with-stsadm-mergecontentdbs-operation/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 04:33:43 +0000</pubDate>
		<dc:creator>Isaac Blum</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[For The Greater Good]]></category>
		<category><![CDATA[Free Help]]></category>
		<category><![CDATA[MOSS 2007]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[WSS 3.0]]></category>
		<category><![CDATA[Rename]]></category>
		<category><![CDATA[SharePoint_AdminContent]]></category>
		<category><![CDATA[SharePoint_AdminContent_guid]]></category>
		<category><![CDATA[stsadm]]></category>

		<guid isPermaLink="false">http://blog.isaacblum.com/?p=179</guid>
		<description><![CDATA[Here are the commands I used: stsadm -o addcontentdb -url http://moss:1000 -databasename SharePoint_AdminContent_moss stsadm -o enumsites -url http://moss:1000 &#62; output.txt stsadm -o mergecontentdbs -url http://moss:1000 -operation 2 -sourcedatabasename SharePoint_AdminContent_f58aa288-57e9-49ff-b953-9b4d53d50bfc -destinationdatabasename SharePoint_AdminContent_moss -filename output.txt iisreset stsadm -o deletecontentdb -url http://moss -databasename SharePoint_AdminContent_f58aa288-57e9-49ff-b953-9b4d53d50bfc check with stsadm -o enumcontentdbs -url http://moss:1000]]></description>
			<content:encoded><![CDATA[<p>Here are the commands I used:</p>
<p>stsadm -o addcontentdb -url http://moss:1000 -databasename SharePoint_AdminContent_moss<br />
stsadm -o enumsites -url http://moss:1000 &gt; output.txt<br />
stsadm -o mergecontentdbs -url http://moss:1000 -operation 2 -sourcedatabasename SharePoint_AdminContent_f58aa288-57e9-49ff-b953-9b4d53d50bfc -destinationdatabasename SharePoint_AdminContent_moss -filename output.txt<br />
iisreset<br />
stsadm -o deletecontentdb -url http://moss -databasename SharePoint_AdminContent_f58aa288-57e9-49ff-b953-9b4d53d50bfc<br />
check with stsadm -o enumcontentdbs -url <a href="http://moss:1000/">http://moss:1000</a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.isaacblum.com%2F2009%2F11%2F02%2Frename-your-sharepoint_admincontent_guid-database-with-stsadm-mergecontentdbs-operation%2F&amp;linkname=Rename%20your%20SharePoint_AdminContent_guid%20database%20with%20stsadm%20mergecontentdbs%20operation"><img src="http://blog.isaacblum.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.isaacblum.com/2009/11/02/rename-your-sharepoint_admincontent_guid-database-with-stsadm-mergecontentdbs-operation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configure PDF IFilter in WSS 3.0 or MOSS 2007</title>
		<link>http://blog.isaacblum.com/2009/10/29/configure-pdf-ifilter-in-wss-3-0-or-moss-2007/</link>
		<comments>http://blog.isaacblum.com/2009/10/29/configure-pdf-ifilter-in-wss-3-0-or-moss-2007/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 23:41:20 +0000</pubDate>
		<dc:creator>Isaac Blum</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[For The Greater Good]]></category>
		<category><![CDATA[Free Help]]></category>
		<category><![CDATA[MOSS 2007]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[WSS 3.0]]></category>
		<category><![CDATA[927675]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[DOCICON.XML]]></category>
		<category><![CDATA[IFilter]]></category>
		<category><![CDATA[MOSS]]></category>
		<category><![CDATA[PDF]]></category>
		<category><![CDATA[WSS]]></category>

		<guid isPermaLink="false">http://blog.isaacblum.com/?p=162</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<p>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.</p>
<p>Here is what I’ve found works for WSS 3.0:</p>
<ol>
<li>First, you need to download the Adobe PDF IFilter 6.0, which <a href="http://www.adobe.com/support/downloads/detail.jsp?ftpID=2611" target="_blank"><span style="color:#0066cc;">you can find at this URL</span></a>.  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 <a href="http://www.adobe.com/misc/linking.html" target="_blank"><span style="color:#0066cc;">on the Adobe web site here</span></a>.</li>
<li>Once you’ve downloaded the IFilter, install it on your WSS 3.0 server, and then follow the instructions on registry settings in <a href="http://support.microsoft.com/kb/927675/en-us" target="_blank"><span style="color:#0066cc;">Microsoft KB Article 927675</span></a>.  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.</li>
<li>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.</li>
<li>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 &lt;/ByExtension&gt; closing tag.  The new key will be <strong>&lt;Mapping Key=&#8221;pdf&#8221; Value=&#8221;pdficon_small.gif&#8221; OpenControl=&#8221;"/&gt;</strong>  (note that XML is case sensitive so make sure you use same case as previous entries).  Then save the file.</li>
<li>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 <strong>Stsadm -o spsearch -action fullcrawlstart</strong> .  More on this <a href="http://technet2.microsoft.com/windowsserver/WSS/en/library/bc15d0a8-b48f-4d32-a267-797f8515d1f31033.mspx?mfr=true" target="_blank"><span style="color:#0066cc;">on TechNet here</span></a>.</li>
</ol>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.isaacblum.com%2F2009%2F10%2F29%2Fconfigure-pdf-ifilter-in-wss-3-0-or-moss-2007%2F&amp;linkname=Configure%20PDF%20IFilter%20in%20WSS%203.0%20or%20MOSS%202007"><img src="http://blog.isaacblum.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.isaacblum.com/2009/10/29/configure-pdf-ifilter-in-wss-3-0-or-moss-2007/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
