Removing a user from a WSS 2.0 server (not just a site)

Yeah, I know, they’re still running WSS 2.0 at my employer. I’m just here to help, not judge. = )

So I get the request (and I got it before and forgot how I did it) from
a site admin that they can’t add a user to their new website they created. It
says they already exist when clearly they do not in the Manage Users screen.
This is generally because the SID of the existing user account doesn’t match the
SID of the new account you’re trying to add. The solution? Well documented in this Microsoft KB article.

The quick solution? If it’s a WSS site that is hosted on the portal
site, go here:

http://ServerName/Sites/SiteName/_layouts/1033/Siteusrs.aspx

Otherwise go here:

http://ServerName/_layouts/1033/Siteusrs.aspx

Obviously replacing “servername” with your server and “sitename” with the parent site
you’re trying to add the user to. Locate the user in the list, check the box and
at the top click the “Remove Selected Users” link. Once gone you can now safely
add this person to the parent and/or child sites without issue.

Eric

Eric Oszakiewski is a professional software developer based in Scottsdale, AZ with over 35 years of IT experience, and 19 years Native American Gaming experience. He is currently working as a Sr .Net/SharePoint Developer for General Motors, and also as a consultant.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube

Get first occurance of a character in SQL

When I need to know the first (or any)
occurrence of a character, I’m used to saying something like InStr() for VB or
ASP, or String.IndexOf() in .Net, but when I tried to do something like this
today (Sept 2009) in SQL for a substring portion of a query I was creating, those obviously
aren’t available. Well, in Oracle InStr is available I understand, but we`re
talking about SQL.
To get the first
occurrence of a character in a TEXT field (emphasis mine, because it must be a
text compliant field) you use the PATINDEX() function. PATINDEX looks for the
first occurrence of a specified pattern in a text field. Meaning, the field can
be a text, nvarchar, char, etc. It cannot be an image or int, for example.
PATINDEX, I learned, is typically used in BLOBs (Binary Large
OBjects).

Let’s say you are
querying a table called MYTABLE, looking for the pattern “forest” in the field
STORY_DESCRIPTION. Your query would look like this:

SELECT PATINDEX('%,forest%', STORY_DESCRIPTION)
FROM MYTABLE

The result would be the
char position of the first occurrence of the pattern “forest”. This helped me
when I was trying to put together something like this:

SELECT SUBSTRING(CN, 3, PATINDEX('%CN=', CN)-3)
FROM AD_TABLE

Where in this case I
was querying an Active Directory results table and the CN field always started
with “CN=”, but I wanted just the value from each row. This worked perfectly.
Although those of you who are SQL experts know of a much simpler method, I’m
sure, this one worked for me!

Eric

Eric Oszakiewski is a professional software developer based in Scottsdale, AZ with over 35 years of IT experience, and 19 years Native American Gaming experience. He is currently working as a Sr .Net/SharePoint Developer for General Motors, and also as a consultant.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube

Clear out old selections from “Choose a Dataset” in ReportBuilder 3

While working with ReportBuilder 3 there are times when we will move datasets around in SSRS, and old choices made when users connect to those datasets while using ReportBuilder 3 are invalid or just not there.  But the choices remain in ReportBuilder 3!  When you want to connect to these datasets, which may have the same name but just be in a different place, it’s frustrating for both the user and you.  Here’s how to remove those old dataset pointers/shortcuts from the “Choose a DataSet” window:

  • Navigate to C:users<username>AppDataLocalMicrosoftReport Builder10.50.0.0
  • Locate the user.config file and open in notepad.
  • About halfway down you will find the <RecentItem> elements under <RecentDataSets>.  Remove the entire element you don’t want in there anymore.  Note the path under the ItemPath attribute in each element to make sure you remove the correct ones.
  • Save the file and restart ReportBuilder 3

Enjoy!

Eric

Eric Oszakiewski is a professional software developer based in Scottsdale, AZ with over 35 years of IT experience, and 19 years Native American Gaming experience. He is currently working as a Sr .Net/SharePoint Developer for General Motors, and also as a consultant.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube

Restore detached content DB list data to another SP 2010 instance

Had quite a scare today, when one of our business users asked why he couldn’t get to his SharePoint 2010 library.  It’s because we blew away that box due to configuration issues, and didn’t realize he was using it.  Oops!

Fortunately, our Sr. Network Admin (also the DBA) was smart enough to detach the DB (not drop it).  I looked at the content in SSMS and sure enough, that was where his data was.  Here’s what I did to restore his libraries:

  • Open Central Admin for the target SP 2010 instance.
  • Click on Backup and Restore
  • Under Granular Backup, choose Recover data from an unattached content database
  • Enter the name of the DB server and the unattached content DB name.  Leave WIA selected and leave Browse content selected.  Click Next.
  • Leave the site collection the way it is, click Site and select the path you want to restore from (it’s reading from the unattached content DB at this point).  Then do the same for the List (select which List or Library you’re restoring).
  • Select Export site or list and click Next.
  • Enter the path to your target SP2010 instance where you want the export to be saved to (ex: C:backupexport.cmp).  Check Export full security if you want to preserve author names, original creation dates, permissions, etc.
  • Click Start Export
  • When it’s finished (assuming there are no errors), open the SP2010 Management Shell and type the following:

[powershell]import-SPWeb http://site/path/path_to_.cmp_file[/powershell]

That’s it. When it’s done your list/library will be restored!  Careful, though, it will overwrite whatever’s in the target location, so be sure to back up or copy anything that’s already there before importing, so you can restore those items afterwards.

Eric

Eric Oszakiewski is a professional software developer based in Scottsdale, AZ with over 35 years of IT experience, and 19 years Native American Gaming experience. He is currently working as a Sr .Net/SharePoint Developer for General Motors, and also as a consultant.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube

Save Site as Template not available in SharePoint 2010

For some reason or another I’ve been able to creat a new site then save it as a template in both SP2010 and SP Designer 2010…except all of a sudden.  Not sure why, but when I exported an existing site from another farm (identical SP2010 installation), then imported it into another SP2010 farm the option is gone.  This also happened when I tried uninstalling the template from the Solution Gallery then redeploying it into the same farm.  Fortunately, I happened to find a solution that worked for me here.

Basically, navigate to the website in question (the one you want to save as a template) and append the following url (in bold):

http://server/site/_layouts/savetmpl.aspx

Here’s the caveat-DO NOT do this for Publishing sites!  It’ll work with a Publishing site, but when you try to create a new site out of it, it’ll break.  This is because the site template expects a normal URL structure, but the Publishing site puts pages inside of a pages library.

To deactivate, modify or delete other site templates, go to http://server/_catalogs/solutions/Forms/AllItems.aspx

Hope this helps!

Eric

Eric Oszakiewski is a professional software developer based in Scottsdale, AZ with over 35 years of IT experience, and 19 years Native American Gaming experience. He is currently working as a Sr .Net/SharePoint Developer for General Motors, and also as a consultant.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube