Top Questions - SharePoint Overflowmost recent 30 from http://www.sharepointoverflow.com2010-03-11T22:53:14Zhttp://www.sharepointoverflow.com/feedshttp://www.creativecommons.org/licenses/by-nc/2.5/rdfhttp://www.sharepointoverflow.com/questions/1825/custom-field-in-edit-modeCustom field in edit mode Amit2010-03-11T01:07:11Z2010-03-11T22:32:21Z
<p>I have created a custom field. I have added the field in a list and added a new item through it. Display mode also shows the value perfectly. But when I edit that item and my field is in edit mode it is rendering as if it was getting rendered in new mode.</p>
<p>I have created a filtered lookup column that is two list boxes. Any idea where I am going wrong?</p>
http://www.sharepointoverflow.com/questions/1824/when-is-visual-studio-required-for-creating-workflowsWhen is Visual Studio required for creating workflows?Spt.Geek2010-03-11T00:47:35Z2010-03-11T22:28:41Z
<p>Are there any real world scenarios where we cannot do without Visual Studio workflow? That is where default SharePoint workflows or Sharepoint Designer won't suffice?</p>
http://www.sharepointoverflow.com/questions/962/helpdesk-template-see-my-service-requests-in-my-siteHelpdesk Template - See My Service Requests in My Sitemrtrombone2009-12-31T01:35:25Z2010-03-11T22:24:45Z
<p>I have set up the Helpdesk 'fantastic 40' template on our portal and can add service requests etc.</p>
<p>I can also see that in the site's child pages I have access to a whole lot of web parts such as 'Requests assigned to me' etc.</p>
<p>What I would like to do however is make it so users can see the open requests they have raised on their MySite page. This sits on another web application.
e.g. My helpdesk template is at /sharepoint:8083/helpdesk and the mysites are at /sharepoint:8090</p>
<p>Is this possible?</p>
http://www.sharepointoverflow.com/questions/1846/cost-of-sharepoint-licensesCost of SharePoint LicensesIan2010-03-11T15:33:01Z2010-03-11T22:21:57Z
<p>I'm trying to get an understanding of how much it would cost to implement MOSS 2007.</p>
<p>I'm budgetting for an entry level server (around $7k) and using our existing SQL SAN so it is the actual SP licencing model that I am looking for.</p>
<p>To start we would be looking at around 50 users, but this could grow to 450-500 within 12-18 months.</p>
<p>How does the licencing work and what are the costs associated with it?</p>
<p>Would you recommend anything different in terms of the hardware set up?</p>
http://www.sharepointoverflow.com/questions/1837/how-can-i-upload-a-file-to-a-sharepoint-document-library-using-silverlight-and-clHow can I upload a file to a Sharepoint Document Library using Silverlight and client web-services?pclem2010-03-11T13:52:16Z2010-03-11T20:47:54Z
<p>I'm using C# in Visual Studio with a Silverlight app. I want to upload a file to a document library, but none of the web-services here <a href="http://msdn.microsoft.com/en-us/library/ms479390.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms479390.aspx</a> seem to have a way to do this.</p>
<p>I'm not using object model, only service references to the .asmx's in that link.</p>
<p>Thanks for any help/suggestions you can offer</p>
http://www.sharepointoverflow.com/questions/1628/can-jquery-intellisense-also-be-installed-used-in-sharepoint-designerCan jQuery intellisense also be installed / used in SharePoint Designer ?Stef2010-02-25T09:10:13Z2010-03-11T20:28:01Z
<p>There are some references on how to install intellisense for jQuery in VS2008SP1, is it also possible for SharePoint Designer ?</p>
http://www.sharepointoverflow.com/questions/1744/publishing-sites-search-and-the-missing-contentclasssts-sitePublishing sites, search and the missing contentclass:STS_SiteNick Hadlee2010-03-08T07:22:00Z2010-03-11T20:16:22Z
<p>This is an old issue I thought this was a bug in an specific environment after reading a couple of blogs it has made me think again...</p>
<p>The issue is that SharePoint site collections and sites are not correctly picked up by the search index. All the content is indexed but the sites themselves are not associated to the correct contentclass. Prior to SP2 the site collections (SPSite's) are listed in the index under the contentclass:STS_Site and the sites (SPWeb's) are contentclass:STS_Web. The following people seem to have come across this issue and assumed it was just a limitation. I think it was a bug introduced sometime during IU and SP2:</p>
<ul>
<li><a href="http://social.technet.microsoft.com/Forums/en-US/sharepointsearch/thread/2e8a07d6-6b4d-43bd-bd28-d5e50e5c34ab" rel="nofollow">TechNet Forum</a></li>
<li>Daniel McPherson's <a href="http://community.zevenseas.com/Blogs/Daniel/archive/2009/12/07/using-html-meta-tags-to-add-information-to-sharepoint-search.aspx" rel="nofollow">blog entry</a> is not about the issue but he mentions it in the first paragraph</li>
</ul>
<p>The situation that I have observed to exhibit this 'bug' is:</p>
<ol>
<li>a site collection or site is based on a publishing template (can be built-in e.g. collaboration portal or custom site template)</li>
<li>SharePoint 2007 with updates post Infrastructure Update - in my situation it was applying SP2 but it might have been one of the culmlative updates after IU</li>
<li>A search pre-SP2 using contentclass:STS_Site as a filter will list all site collections including those based on publishing templates, contentclass:STS_Web will list all sites based on publishing templates</li>
<li>A search post-SP2 using contentclass filtyer as above will return only site collections/sites using non-publishing templates. All other content is availble e.g. documents, lists</li>
</ol>
<p>Has anyone else come across this? </p>
http://www.sharepointoverflow.com/questions/1842/custom-list-form-webparts-not-saving-if-jquery-manipulates-the-fieldCustom List Form Webparts Not Saving if jQuery manipulates the fieldspevilgenius2010-03-11T14:56:11Z2010-03-11T18:52:08Z
<p>I have a dropdown box on a custom webpart and I am initially filling it out with server side c# code in the createchildcontrols section. I wanted to cascade the dropdown to fill out another dropdown. This works fine if I do it all in .Net except the annoying postback refresh of the entire form which the customer does not like. I know how to achieve the same effect using jQuery and attaching an onchange event. This does fill out the second dropdown without an issue. However, if I do this with jQuery my button event on the form no longer fires and I can not save the data. Has anyone else seen this or am I missing some setting that will allow this to occur?</p>
<p>UPDATE:
I have removed the server code to add the change event and I placed it all inside the aspx page in the jQuery document ready event. I am using the SPServices library to initially fill out the primary dropdown and then it's change event fills out the second dropdown. This works fine. As soon as I click the add button I receive the 'Oh So Useful' Unexpected Error has Occured. If I remove the jQuery it works fine. UUHHGG!</p>
http://www.sharepointoverflow.com/questions/1426/search-results-show-domain-account-and-masterpage-in-the-summary-fieldsSearch Results Show domain account and Masterpage in the summary fieldsEmad2010-02-08T08:47:44Z2010-03-11T16:31:42Z
<p>I have a internet publishing site using MOSS 2007 / SP1 / December updates.</p>
<p>In the search results, I get different pages using same layout/content type within the same sub site. In some pages the summary field show the domain account of the author of the page (creator) as well as the Layout used, in others (same layout/content type and same sub site) this summary shows normal content.</p>
<p>The image below shows a sample.</p>
<p><img src="http://img27.imageshack.us/img27/6002/gfsearchresults1.jpg" alt="alt text" /></p>
<p>Image in full size <a href="http://img27.imageshack.us/img27/6002/gfsearchresults1.jpg" rel="nofollow">here</a></p>
<p>My question: Why is this happening? and most importantly, how to prevent it?</p>
http://www.sharepointoverflow.com/questions/1847/troubleshooting-unexpected-search-resultsTroubleshooting unexpected search resultsMike Powell2010-03-11T15:33:15Z2010-03-11T16:22:22Z
<p>It appears that there's at least one folder in one of our crawled network shares that's not getting indexed properly, as evidenced by searching for unique words known to be in PDF documents in that folder and not getting the documents back in the search results. Documents in this folder are showing up in the crawl log as being successfully crawled, either with a "Crawled" or "Not modified" status. There are no errors or warnings in the Windows event log, and none that I can find in the SharePoint trace logs. Of the 42 PDF files in this folder, all are less than 5MB in size and most are less than 1MB.</p>
<p>Can anyone offer some tips on troubleshooting this issue?</p>
<p><strong>Update:</strong> It looks like SharePoint <em>is</em> indexing the title metadata for these PDFs, just not the content. There is text content in the PDFs -- Adobe Reader's Find command works fine within a given document. What could be causing the content not to be indexed?</p>
http://www.sharepointoverflow.com/questions/1841/contentype-updatetrue-true-and-ui-validationContentype.Update(true, true) and ui validationorl782010-03-11T14:55:10Z2010-03-11T15:16:34Z
<p>When using the sharepoint api to add field links to a content type, with code similar to the following:</p>
<pre><code>AddFieldLink(siteField, contentype);
contentype.Update(true, true);
</code></pre>
<p>I have specified true, in the update method to ensure that the field is mandatory. When I then edit an item of this content type in the UI will it ensure that this field contains a value i.e. will the field for this meta data be mandatory?</p>
<p>all the best</p>
http://www.sharepointoverflow.com/questions/1834/force-the-document-information-panel-to-show-with-code-or-featuredefinitionForce the document information panel to show with code or featuredefinitionDribbel2010-03-11T12:32:39Z2010-03-11T14:26:21Z
<p>In the UI I can drill down into a ContentType settings -> Document Information Panel settings -> and set 'Show Always' to true (marking the check box).</p>
<p>How do i set this option through code? (or in a contenttype defition in a feature)</p>
http://www.sharepointoverflow.com/questions/1708/addlist-method-in-http-postAddList method in Http Postpclem2010-03-04T18:46:23Z2010-03-11T13:44:01Z
<p>In a remote client, I'm trying to create a new list in a sharepoint site. Right now, I'm building a CAML string and sending it via http post to my sharepoint site. I've used this method to update list items and create dws folders, but I can't seem to get AddList to work. I get an error "Remove server returned error:NotFound."</p>
<p>Any ideas? I'm pretty certain it's not an authentication issue since I've used the exact same method in this same program to do the previously mentioned functions. The sharepoint site I'm adding the list to is a test site in which I have full read/write capabilities.</p>
<p>here is my CAML:</p>
<pre><code> string soapEnv =
"<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<soap:Envelope " + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance"+
"xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"" +
" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"+
"<soap:Body>" +
"<AddList xmlns=\"http://schemas.microsoft.com/sharepoint/soap\">"+
"<listName>" + listName + "</listName>" +
"<description>" + "A Test list" + "</description>" +
"<templateID>100</templateID>" +
"</AddList>" +
"</soap:Body>" +
"</soap:Envelope>";
return soapEnv;
</code></pre>
<p>I send this in an http Post with these settings:</p>
<pre><code> uri = "[my sharepoint site]/_vti_bin/lists.asmx";
WebClient client = new WebClient();
client.Headers["SOAPAction"] = "http://schemas.microsoft.com/sharepoint/soap/";
client.Headers["content-type"] = "text/xml; charset=utf-8";
client.Encoding = Encoding.UTF8;
client.UploadStringCompleted += UploadStringCompleted;
try
{
client.UploadStringAsync(new Uri(uri, UriKind.Absolute), "POST", CAML);
}
catch (Exception ex)
{
MessageBox.Show("Error in upload string async: " + ex.Message);
}
</code></pre>
http://www.sharepointoverflow.com/questions/1624/remove-column-header-on-sharepoint-2007-list-webpart-in-team-siteRemove column header on SharePoint 2007 list webpart in Team Sitechrislatta2010-02-25T01:14:43Z2010-03-11T12:23:05Z
<p>I have a list on a Team Site-based (customised site definition) site collection. I want display its contents on the front page of the site in a web part with the list title and one field only in the detail display (in a boxed view) but remove the column header. There doesn't seem to be an option to do this in the edit web part dialogue. Is there some way to get rid of the column headers other than making a custom list?</p>
http://www.sharepointoverflow.com/questions/1801/can-i-create-a-connected-web-part-using-silverlight-in-sharepoint-2007Can I create a connected web part using Silverlight in SharePoint 2007?Stuart Whiteford2010-03-10T09:30:03Z2010-03-11T11:47:54Z
<p>Currently, I have a connected web part that consumes a SharePoint list and uses the data to add locations to a Google Map control.</p>
<p>What I'd like to do is use the Bing Maps Silverlight control and use the same data to render pushpins on the map. I can create an unconnected web part and use the SharePoint web services to access the list data, loop through the rows and add the pins to the map. In terms of configuration this will mean the user will need to enter the list name (or Guid) in the properties of the web part, whereas before they could select from the available lists on the site, this seems like a step in the wrong direction.</p>
<p>So, is there a way to use the data that is provided by the connected web part and make it available to the Silverlight control?</p>
<p>Cheers,
Stuart.</p>
http://www.sharepointoverflow.com/questions/1827/accessing-workflow-history-listAccessing Workflow History ListSpt.Geek2010-03-11T03:54:23Z2010-03-11T10:03:15Z
<p>Is there an easy way to access History list, than to type URL?</p>
http://www.sharepointoverflow.com/questions/1817/remove-broken-resource-relationships-between-pages-and-page-layoutsRemove broken resource relationships between pages and page layoutsorl782010-03-10T15:57:18Z2010-03-11T09:58:06Z
<p>We have a page layout that we want to delete from a site collection but according to moss it is still referenced by some publishing pages. The pages that are apparently using the page layout are no longer in the pages library that it says they are.</p>
<p>In the manage content and structure view if I look at the resources that are using this page layout it has a number of pages with a link icon and the check boxes next to them are grayed out.</p>
<p>I'm assuming that using the api I can clean up these orphaned resource relationships.</p>
<p>Can anyone point me in the right direction?</p>
http://www.sharepointoverflow.com/questions/1813/sharepoint-search-service-is-not-workingSharePoint Search Service is not workingGeorge22010-03-10T13:32:37Z2010-03-11T09:16:03Z
<p>I am using SharePoint Server 2007 with collaboration portal template on Windows Server 2008. When I use the following function from Central Administration from Application Management -> search -> Manage Search Service, I met with the following error message, any ideas what is wrong?</p>
<p>The search service is currently offline. Visit the Services on Server page in SharePoint Central Administration to verify whether the service is enabled. This might also be because an indexer move is in progress.</p>
http://www.sharepointoverflow.com/questions/1809/site-creation-in-sharepoint-designer-2010-missing-options-quick-launch-top-naviSite creation in SharePoint designer 2010 missing options (Quick Launch, Top Navigation)Dribbel2010-03-10T12:09:37Z2010-03-11T09:06:20Z
<p>When I create a new subsite via the WebUI there are options for placement of the site on the QuickLaunch of the parent site, and if the Top Navigation bar should be inherited.</p>
<p>How do i set those options when creating a new subsite from SharePoint Designer 2010? </p>
<p>Manually adding the site to the TopNav and QuickLaunch is error prone and could lead to errors with respect to the security trimming of the Menus (Top and Quick)</p>
http://www.sharepointoverflow.com/questions/744/restoring-ssp-databases-from-sp1-to-sp2-server-farmRestoring SSP Databases from SP1 to SP2 server farmJag SRK2009-12-08T03:15:48Z2010-03-11T08:23:57Z
<p>Has anyone restored Shared Services Databases from SP1 Server Farm to a new SP2 Server farm? I don't want to loose user related information link My Links etc. </p>
<p>I followed the DB attach method as detailed here (<a href="http://technet.microsoft.com/en-us/library/cc671617.aspx" rel="nofollow">http://technet.microsoft.com/en-us/library/cc671617.aspx</a>) to restore site content from SP1 to SP2. I am little skeptical about touching the SSP dbs. </p>
<p>Can we overwrite the new SSP databases with the old databases and restore all the information? If you have done this in the past, please feel free to share any important pointers. Thanks in advance.</p>
<p>Jag </p>
http://www.sharepointoverflow.com/questions/1782/training-videos-hosted-on-sharepointTraining videos hosted on SharePoint?chrislatta2010-03-10T01:01:20Z2010-03-11T05:23:50Z
<p>Rather than drag the whole company into training when we roll out a new project, we have started developing short training videos. We'd like to host these in our SharePoint (MOSS) intranet and </p>
<ol>
<li>Track who has clicked on the video to watch it</li>
<li>If possible, track who has watched the video to the end</li>
</ol>
<p>Is this somehow possible using SharePoint?</p>
<p>I know one option might be to deploy the <a href="http://codeplex.com/pks/" rel="nofollow">Podcasting Kit for SharePoint</a>. Has anyone got any experiences to share about that?</p>
http://www.sharepointoverflow.com/questions/1074/changing-display-of-categories-in-site-directoryChanging display of Categories in Site DirectoryAlex Angas2010-01-12T00:23:21Z2010-03-11T02:24:00Z
<p>I'd like to make some changes to the category display in Site Directory. Specifically, I'd like the results to be on the same page underneath the category list.</p>
<p>I looked at the possibility of changing the links on each category so that instead of going to a new page they point back to the site directory Categories page. (If the Category Results web part was added to that page maybe it would work.) However I can't work out how to change the URL from <code>categoryresults.aspx</code> to <code>category.aspx</code>.</p>
<p>Does anyone have experience with this sort of customisation and thoughts on how to achieve this? Custom JavaScript is to be avoided if at all possible.</p>
<p>Here is a mockup screenshot of what I'd like to do:</p>
<p><img src="http://img23.imageshack.us/img23/1185/mockuph.png" alt="alt text" title="Site Directory categories mockup" /></p>
http://www.sharepointoverflow.com/questions/706/i-want-to-use-aspcompattrue-as-an-attribute-of-page-directiveI want to use ASPCOMPAT=true as an attribute of @Page directiveamar2009-12-01T17:16:24Z2010-03-11T01:24:03Z
<p>I get the following error on SharePoint pages: "aspcompat not alowed on this page" when I try to use it. Please help.</p>
http://www.sharepointoverflow.com/questions/960/blogs-wikis-and-discussion-forums-in-an-internet-publishing-siteBlogs, wikis and discussion forums in an internet publishing siteunknown (yahoo)2009-12-30T17:33:55Z2010-03-11T01:24:03Z
<p>I have blogs, wikis and discussion forums module in my SharePoint publishing site.</p>
<p>How can I use the SharePoint web parts for these modules? Should I activate the collaboration feature on this site? And if I activate the Collaboration feature will it cause a security issue? </p>
<p>Thanks in advance.</p>
http://www.sharepointoverflow.com/questions/1739/information-about-users-storeInformation about users storejoe2pro2010-03-07T22:12:26Z2010-03-10T22:00:37Z
<p>Where is information about users associated with specific SharePoint site stored?</p>
<p>I guess information is stored in relational database.</p>
<p>To be more specific i want to ask if it is possible to query this database and get list of all users which have access to site <strong>mysubdomain.mydomain.com/sites/xyz</strong> where <strong>xyz</strong> is set of sites and to complicate it more, there is also <strong>abc</strong> which represents sub-sites which have different set of <strong>members</strong> and <strong>visitors</strong> group and there is also another group with different permission level.</p>
<p>As example lets have <em>mysubdomain.mydomain.com/sites/aaa/bb</em> and than <em>mysubdomain.mydomain.com/sites/aaa/cc</em> and this two sub sites have different set of user. So to summarize my question. I want to get as result of SQL query table with username (NT\login) with information about sites/sub-site and permission level.</p>
<p>My question is: Is this possible?
Another question: Is there any method how to get this information without installing anything on server side of SharePoint farm? I have list of sites and sub-sites with URL's.</p>
<p>More details:</p>
<p>Let me describe one solution I have now. I’ve found tool Data Juggler (<a href="http://www.djuggler.com/" rel="nofollow">http://www.djuggler.com/</a>) which can automate repetitive web tasks. This means that I’ve prepared list of all sites/sub-sites in my scope. As a source I use spreadsheet with all details about sites/sub-sites input.xlsx this is only one part of process maintained manually. It was big effort to take all data together, but once this was done, it is easier to maintain, as new sites/sub-sites are created occasionally
Information in this spreadsheet are in this order:</p>
<ul>
<li>URL to Members group (users with Read/Write access)</li>
<li>URL to Visitors group (users with Read Only access)</li>
<li>REGION</li>
<li>Site/Sub-site URL</li>
<li>Site Name</li>
<li>Sub-site Name</li>
<li>Site owner</li>
</ul>
<p>Ok that’s introduction, now how it works:</p>
<ul>
<li>After loading scrip to Djuggler it pops up a window asking you to browse to input spreadsheet (input.xlsx)</li>
<li>Then it pops up window asking you for number of records in spreadsheet (this step could be possibly omitted if I will tweak the script, but I made this solution in one night learning from examples and building script)</li>
<li>After that it loads all the information from spreadsheet to Djuggler’s temporary grid and start loading values from columns to variables</li>
<li>First it loads URL to Members group and rest of columns except URL to Visitors group and uses its internal browser to load page from URL to Members group</li>
<li>Application start searching in html source of loaded site and looking for specific html tags <strong><code>account=”something”</code></strong> and <strong><code>email=”something”</code></strong> and stores something into variable, than store new row into another grid with all details Account, Email, REGION, Site/Sub-site URL, Site Name, Sub-site Name, Site owner and loops through whole html source, than it jump in loop to another URL to Members group and loops again trough html source and this continue, till loop trough URL to Members group will run for x times, where x is number of rows submitted in second step</li>
<li>After this loop jump to second column with URL to Visitors group and whole process with loops is repeated.</li>
<li>At the end application store temporary grid with results from loops into spreadsheet and opens this spreadsheet.</li>
</ul>
<p>I know that email address and NT\login is pretty the same information so email could be omitted to avoid redundancy of information. And rest of information like region, site name, sub-site name and site owner could be added in second step. For me it is more logical to have just information pulled from site
Site/sub-site URL, NT\login of user and permission level (contribute, read, …)
So for now I have some solution, but it is “<em>like scraping your head behind left ear with right hand from back of your head…</em>” I am looking for something more elegant.</p>
http://www.sharepointoverflow.com/questions/1812/remove-permissions-programmaticallyRemove permissions programmaticallyunknown (google)2010-03-10T13:23:06Z2010-03-10T21:27:41Z
<p>I am trying to programmatically remove permissions from a specific Sharepoint folder for a user or group.</p>
<p>However, when I get to the folders RoleAssignments I do not get a RoleAssignment for the user or group I am looking for.</p>
<p>I am a little confused because I do get users or groups showing in the RoleAssignments but it's never the complete list that is shown on the Sharepoint web page.</p>
<p>If you do a search for this string in my code " 'This is helpful for debugging to see the users/groups in the RoleAssignments. ", just below it I am looping through the RoleAssignments to see all users/groups that have permissions to the folder. I never seem to get the complete list. For example, if I go to the directory on Sharepoint I can see 3 users/groups that have access to a folder. However, there is only 1 users/groups returned through the RoleAssignments.</p>
<p>Here it the code:</p>
<pre><code> Function RemoveGroups(ByVal myWeb As SPWeb, ByVal arrGroupName() As String, ByVal arrFileName() As String, Optional ByVal strVerboseLog As String = "FALSE") As String()
'Dim myTopWeb As SPWeb = New SPSite(myWeb.ParentWeb.Url).OpenWeb
Dim openUrl As String = myWeb.Url & "/Documents"
Dim myTopWeb As SPWeb = New SPSite(openUrl).OpenWeb
Dim colGroups As SPGroupCollection = myTopWeb.SiteGroups
Dim strGroupOwner As String = strDataOwner
Dim oOwner As SPUser
Dim oDefaultUser As SPMember
Dim mySite As SPSite = New SPSite(destCollection)
Dim rootWeb As SPWeb = mySite.OpenWeb
'http://stackoverflow.com/questions/302279/sharepoint-how-to-programmatically-manage-spfolder-and-splistitem-permissions
'http://blogs.msdn.com/robgruen/archive/2007/11/15/how-to-programmatically-set-permissions-on-files-folders-in-a-sharepoint-document-library.aspx
Try
oOwner = myTopWeb.Users(strGroupOwner)
oDefaultUser = myTopWeb.Users(strGroupOwner)
Catch ex As Exception
Dim strError As String = "Error setting the owner and default user to " + strGroupOwner + ": " & ex.Message
writeTospLog(strError, "Error", "[RemoveGroups]", True)
End Try
For i As Integer = 0 To arrGroupName.GetUpperBound(0)
arrGroupName(i) = replaceIllegalGroupCharacters(arrGroupName(i))
Try
'Dim myGroup As SPGroup = myTopWeb.SiteGroups(arrGroupName(i))
Dim myGroup As SPGroup = colGroups(arrGroupName(i))
Dim myRoleAssignments As SPRoleAssignmentCollection = myTopWeb.RoleAssignments
Dim myRoleAssignment As SPRoleAssignment = myRoleAssignments.GetAssignmentByPrincipal(DirectCast(myGroup, SPPrincipal)) 'New SPRoleAssignment(DirectCast(myGroup, SPPrincipal))
Dim myRoleDefBindings As SPRoleDefinitionBindingCollection = myRoleAssignment.RoleDefinitionBindings
writeTospLog("Removing " + arrGroupName(i) + " as a site group and removing " + strPermissionName + " Permissions", "Message", "[RemoveGroups]", True)
Dim oSubWeb As SPWeb = rootWeb.Webs(destSite)
Dim myFolder As SPFolder = oSubWeb.Folders.Item("Documents")
Dim folders As String() = Nothing
Dim separator As Char() = "\"
folders = arrFileName(0).Split(separator, StringSplitOptions.RemoveEmptyEntries)
'Looping through the directories in the Documents library.
For Each thisFolder As SPFolder In myFolder.SubFolders
'Dim folderName As String = thisFolder.Name
Dim currentFolder As String
Dim finalFolder As SPFolder
Dim removePermissions As Boolean = False
'Check to see if first level name matches our first level name from the database.
If folders(0) = thisFolder.Name Then
'Looping through all subdirectories until we get to the directory we need to change the permissions on.
For Each currentFolder In folders
'Checking to make sure the folder exists in the parent directory.
'This is meant to handle bad paths or paths that no longer exists.
If thisFolder.Name <> currentFolder Then
finalFolder = thisFolder.SubFolders(currentFolder)
thisFolder = finalFolder
removePermissions = True
End If
Next currentFolder
End If
If removePermissions = True Then
'This is helpful for debugging to see the users/groups in the RoleAssignments.
For Each currentRole As SPRoleAssignment In finalFolder.Item.RoleAssignments
If myRoleAssignment.Member.Name = currentRole.Member.Name Then
Dim test As String = currentRole.Member.Name
End If
Dim currentID As Integer = currentRole.Member.ID
Dim currentName As String = currentRole.Member.Name
For Each role As SPRole In currentRole.Member.Roles
Dim roleName As String = role.Name
Dim roleID As Integer = role.ID
Next
Next
finalFolder.Item.BreakRoleInheritance(False)
finalFolder.Item.RoleAssignments.Remove(myRoleAssignment.Member)
finalFolder.Update()
End If
Next
Catch ex2 As Exception
Dim strError As String = "Error removing group: " & ex2.Message
writeTospLog(strError, "Error", "[RemoveGroups]", True)
End Try
'End Try
Next
myTopWeb.Dispose()
Return arrGroupName
End Function
</code></pre>
http://www.sharepointoverflow.com/questions/1793/best-practice-for-combining-two-listsBest practice for combining two listsSteffen Schindler2010-03-10T07:42:27Z2010-03-10T20:14:10Z
<p>I know it's a common SharePoint problem. I want to accumulate two SharePoint lists on MOSS 2007. One is a calendar list and the second a custom list with a date column. I want both in another list. The only function the target list must have is to show the items of both lists. There mustn't be a function for creating new items on this list. The view should be near realtime.</p>
<p>What should I use?</p>
http://www.sharepointoverflow.com/questions/839/modify-the-initialchilddata-property-of-a-sharepoint-workflow-replicatoractivityModify the InitialChildData property of a SharePoint Workflow ReplicatorActivityShaun O'Callaghan2009-12-16T12:10:17Z2010-03-10T18:23:55Z
<p>Does anybody know if it's possible to modify the InitialChildData collection of a ReplicatorActivity within SharePoint Workflow such that new instances of the activity to be replicated are spawned?</p>
http://www.sharepointoverflow.com/questions/1799/how-to-check-if-a-user-exists-in-a-groupHow to check if a user exists in a groupdoncarnage2010-03-10T09:18:43Z2010-03-10T18:11:46Z
<p>How can i check if a user (not the current user) exists in a group.
The SPGroup object allows to check if the current user is member of the group, but there is no method that checks if a SPUser given in parameter exists or not.</p>
<p>Someone has any idea ?</p>
http://www.sharepointoverflow.com/questions/1811/cannot-access-sharepoint-from-visual-studio-add-in-spfarm-local-is-nullCannot access SharePoint from Visual Studio Add-In (SPFarm.Local is null)alex350r2010-03-10T12:27:17Z2010-03-10T13:47:41Z
<p>Hi all,</p>
<p>I have a weird problem so I'm going to see if the SharePoint community can help shed some light on this.</p>
<p>I am developing a Visual Studio 2008 Add-In which creates some menu items on the 'Project' context menu within the Solution Explorer pane.</p>
<p>When clicking these buttons my code needs to interact with SharePoint - specifically it needs to get a reference to the SPFarm class. I am trying to loop through the solutions that are installed in the farm.</p>
<p>The problem I am having is that SPFarm.Local always returns null and in addition to this I cannot access SharePoint from the code at all - I have also tried the following:</p>
<pre><code>Using (SPSite site = new SPSite("http://myserver"))
{
}
SPAdministrationWebApplication webapp = SPAdministrationWebApplication.Local;
</code></pre>
<p>I have read quite a few blog posts that talk about this being an x64 and x86 issue so Ive tried recompiling for both x86 and x64 platforms and that doesn't make a difference. Ive tried downgrading the version of .NET framework from 3.5 to 3.0 and putting my SharePoint code in its own custom class in case the 'connect.cs' class provided by the add-in was causing problems.</p>
<p>I am really stuck as for where to go next with this problem - the strange thing is that I can access SPFarm.Local from a console application just not the add-in.</p>
<p>Thanks for any help in advance!</p>
<p>Cheers,</p>
<p>Alex</p>