<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Remove SharePoint users programmatically part 1</title>
	<atom:link href="http://mysharepointofview.com/2009/02/remove-sharepoint-users-programmatically-part-1/feed/" rel="self" type="application/rss+xml" />
	<link>http://mysharepointofview.com/2009/02/remove-sharepoint-users-programmatically-part-1/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=remove-sharepoint-users-programmatically-part-1</link>
	<description>Thoughs from the field in SharePoint land</description>
	<lastBuildDate>Tue, 29 Mar 2011 11:20:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Ankur Sharma</title>
		<link>http://mysharepointofview.com/2009/02/remove-sharepoint-users-programmatically-part-1/#comment-253</link>
		<dc:creator>Ankur Sharma</dc:creator>
		<pubDate>Thu, 29 Oct 2009 05:33:32 +0000</pubDate>
		<guid isPermaLink="false">http://mysharepointofview.com/?p=169#comment-253</guid>
		<description>I am trying to write a webpart in c# asp.net to delete a sharepint user from a specific group.
Can you help me in this?

this is how i am trying to do----

SPSecurity.RunWithElevatedPrivileges(delegate
              {
                  using (SPWeb oWeb = SPControl.GetContextWeb(HttpContext.Current))
                  {
                      try
                      {
                          oWeb.AllowUnsafeUpdates = true;

                          oWeb.BreakRoleInheritance(true);

                          int ID = oWeb.Users[UserName].ID;

                          oWeb.Users.RemoveByID(ID);
                          

                          oWeb.Update();
                      }  
                      finally
                      {
                          oWeb.AllowUnsafeUpdates = false;
                      }
                  }

              });</description>
		<content:encoded><![CDATA[<p>I am trying to write a webpart in c# asp.net to delete a sharepint user from a specific group.<br />
Can you help me in this?</p>
<p>this is how i am trying to do&#8212;-</p>
<p>SPSecurity.RunWithElevatedPrivileges(delegate<br />
              {<br />
                  using (SPWeb oWeb = SPControl.GetContextWeb(HttpContext.Current))<br />
                  {<br />
                      try<br />
                      {<br />
                          oWeb.AllowUnsafeUpdates = true;</p>
<p>                          oWeb.BreakRoleInheritance(true);</p>
<p>                          int ID = oWeb.Users[UserName].ID;</p>
<p>                          oWeb.Users.RemoveByID(ID);</p>
<p>                          oWeb.Update();<br />
                      }<br />
                      finally<br />
                      {<br />
                          oWeb.AllowUnsafeUpdates = false;<br />
                      }<br />
                  }</p>
<p>              });</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PowerShell.nu &#187; Blog Archive &#187; Remove Sharepoint Users Programmatically Part 2</title>
		<link>http://mysharepointofview.com/2009/02/remove-sharepoint-users-programmatically-part-1/#comment-251</link>
		<dc:creator>PowerShell.nu &#187; Blog Archive &#187; Remove Sharepoint Users Programmatically Part 2</dc:creator>
		<pubDate>Tue, 24 Feb 2009 20:22:55 +0000</pubDate>
		<guid isPermaLink="false">http://mysharepointofview.com/?p=169#comment-251</guid>
		<description>[...] Mattias Described the Scenario in part 1 of this post [...] </description>
		<content:encoded><![CDATA[<p>[...] Mattias Described the Scenario in part 1 of this post [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Export a list with all the Sites in a Site Collection part 1 &#171; My SharePoint of view</title>
		<link>http://mysharepointofview.com/2009/02/remove-sharepoint-users-programmatically-part-1/#comment-252</link>
		<dc:creator>Export a list with all the Sites in a Site Collection part 1 &#171; My SharePoint of view</dc:creator>
		<pubDate>Mon, 23 Feb 2009 20:59:16 +0000</pubDate>
		<guid isPermaLink="false">http://mysharepointofview.com/?p=169#comment-252</guid>
		<description>[...] sites. For instance you could use it in our previous post where we removed old users from a site (found here). So, let&#8217;s take a look at the script and get an explanation of how it&#8217;s done and what [...] </description>
		<content:encoded><![CDATA[<p>[...] sites. For instance you could use it in our previous post where we removed old users from a site (found here). So, let&#8217;s take a look at the script and get an explanation of how it&#8217;s done and what [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

