Thursday, March 15, 2007

Enable Anonymous Access in SharePoint

On an Internet facing SharePoint site you want to enable anonymous access so your visitors do not need to authenticate against your membership provider.

Solution

There are two things you need to do to enable anonymous access on a SharePoint site. Firstly you have to configure your membership provider via SharePoint Central Administration then you enable anonymous access on the site.
Here are the steps and screen shots:
1. Enable anonymous access on the membership provider for your web application in Central Administration
1. Browse to SharePoint Central Administration
2. Click the Application Management tab
3. Click Authentication Providers under the Application Security section
SharePoint Authentication Providers
SharePoint Authentication Providers
4. Click the Zone for the Membership Provider you want to change (more on this in a feature tip)
Enable SharePoint Anonymous Access
Tick Enable anonymous access
5. Tick the Enable anonymous access checkbox and click Save at the bottom of the page
2. Now you need to allow anonymous access on your site
1. Browse to your site, select Site Actions -> Site Settings -> Advanced Permissions
Select Advanced Permissions
Select Advanced Permissions
2. Click Settings and select the new option in the menu, Anonymous Access
Select Anonymous Access
Select Anonymous Access
3. Select your required setting, probably Entire Site and click OK
Select your anonymous access setting
Select your anonymous access setting
Your SharePoint site will now allow anonymous access and not prompt for authentication.

Tuesday, March 13, 2007

Creating Customized SharePoint Permissions

Problem

SharePoint is widely used for storing and maintaining content. Different groups of users access SharePoint, but what if an organization wants to provide granular customized access rights like read, write or delete for different users? SharePoint does provide some permission levels like Full Control, Design, Contribute, Read, Limited Access and others. The problem with these permission levels is that they are predefined. Sometimes these predefined permission sets do not satisfy the business needs. For instance, if you want to provide a set of users read and add permissions, without being able to delete items. This wouldn't be possible with the predefined SharePoint levels as it provides you add, edit and delete access all together.

Solution

SharePoint facilitates the ability for administrators to create user defined permission levels (i.e. one can create custom permission levels with the desired permissions). Here we will create a custom permission level which will allow users only to view and add list items. The user will not be able to perform other operations on list items like edit and delete.

Creating a custom permission level

First, we will create a custom permission level. To create a custom permission level, go to Site Actions->Site Settings. Under the "Users and Permissions" category, click on "Advanced permissions".



Now click on Settings->Permission Levels



Click on "Add a Permission Level"



Provide a unique name and description to the Permission Level. Permission Levels are divided into three levels
  • List
  • Site
  • Personal
Each set contains different kind of permission selections like add, edit, delete, open, etc.... In our case we need to update List and Site permissions in order to allow users to access sites and perform operations on a list. So in the "Permissions" category, under the "List Permissions" section, select the below three permissions:
  • Add Items - Add items to lists, add documents to document libraries, and add Web discussion comments.
  • View Items - View items in lists, documents in document libraries, and view Web discussion comments.
  • View Application Pages - View forms, views, and application pages. Enumerate lists.


Under the "Site Permissions" section, select the permissions below:
  • View Pages - View pages in a Web site.
  • Open - Allows users to open a Web site, list, or folder in order to access items inside that container.


Click on "Create" and now you can see the custom permission level listed in site permission levels.

Msiexec (command-line options)

 Installing a file of msi type through command prompt


msiexec /i A:\Example.msi


To install or configure a product

Syntax
msiexec /i {Package | ProductCode}
Parameters

/i
Installs or configures a product.
Package
Specifies the name of the Windows Installer package file.
ProductCode
Specifies the globally unique identifier (GUID) of the Windows Installer package.
Remarks
  • Windows Installer command-line options are not case-sensitive.
  • For more information about the Windows Installer command-line options, see Related Topics.
Examples
To install a product from A:\Example.msi, type:
msiexec /i A:\Example.msi

To use the administrative installation option

Syntax
msiexec /a Package
Parameters

/a
Applies the administrative installation option.
Package
The name of the Windows Installer package file.
Remarks
  • Windows Installer command-line options are not case-sensitive.
  • For more information about the Windows Installer command-line options, see Related Topics.

To repair a product

Syntax
msiexec /f [p][o][e][d][c][a][u][m][s][v]{Package | ProductCode}
Parameters

/f
Enables one or more of the command-line options listed in the following table.

 

Command Description
pReinstalls only if file is missing.
oReinstalls if file is missing or if an older version is installed.
eReinstalls if file is missing or an equal or older version is installed.
dReinstalls if file is missing or a different version is installed.
cReinstalls if file is missing or the stored checksum does not match the calculated value.
aForces all files to be reinstalled.
uRewrite all required user-specific registry entries.
mRewrites all required computer-specific registry entries.
sOverwrites all existing shortcuts.
vRuns from source and re-caches the local package.
Package
Name of the Windows Installer package file.
ProductCode
Globally unique identifier (GUID) of the Windows Installer package.
Remarks
  • This option ignores any property values that you type at the command line.
  • The default parameter for this command-line option is /fpecms.
  • Windows Installer command-line options are not case-sensitive.
  • For more information about the Windows Installer command-line options, see Related Topics.
Examples
To repair the installation package, type:
msiexec /fpecms Example.msi

To uninstall a product

Syntax
msiexec /x {Package | ProductCode}
Parameters

/x
uninstalls a product.
Package
Name of the Windows Installer package file.
ProductCode
Globally unique identifier (GUID) of the Windows Installer package.
Remarks
  • Windows Installer command-line options are not case-sensitive.
  • For more information about the Windows Installer command-line options, see Related Topics.
Examples
To remove or uninstall a package, type:
msiexec /x Example.msi

To advertise a product

Syntax
msiexec /j [{u | m}] Package
msiexec {u | m} Package /t TransformList
msiexec {u | m} Package /g LanguageID
Parameters

/j
Advertises a product.
u
Advertises to the current user.
m
Advertises to all users of the computer.
Package
Specifies the Windows Installer package file.
/g LanguageID
Identifies the language.
/t TransformList
Applies transform to advertised package.
Remarks
  • This option ignores any property values that you type at the command line.
  • If you want to install the application with elevated privileges, use /jm.
  • Windows Installer command-line options are not case-sensitive.
  • For more information about the Windows Installer command-line options, see Related Topics.
Examples
To advertise a package to all users of this computer, type:
msiexec /jm Example.msi

To set logging level

Syntax
msiexec /L [i][w][e][a][r][u][c][m][p][v][+][!]LogFile.txt
Parameters

/L
Specifies the path to the log file.
i
Logs status messages.
w
Logs nonfatal warnings.
e
Logs all error messages.
a
Logs startup of actions.
r
Logs action-specific records.
u
Logs user requests.
c
Logs initial user interface parameters.
m
Logs out-of-memory.
p
Logs terminal properties.
v
Logs verbose output. To use v, specify /L*v.
+
Appends to existing file.
!
Flushes each line to the log.
*
Logs all information except for the v option. This is a wildcard.
LogFile .txt
Name and path of the text log file.
Remarks
  • Windows Installer command-line options are not case-sensitive.
  • To include the v option in a log file using the wildcard flag, type /L*v at the command prompt.
  • The Windows Installer log file options can also be used with the uninstall and repair processes.
  • For more information about the Windows Installer command-line options, see Related Topics.
Examples
To install a package and create a log file that contains the information related to the status, out-of-memory, and error messages, type:
msiexec /i Example.msi /Lime logfile.txt

To apply an update

Syntax
msiexec /p UpdatePackage
Parameters

/p
Applies an update.
UpdatePackage
Specific update.
Remarks
  • To apply an update to an administrative installation package, use the following syntax:

    msiexec/pUpdatePackage/aExample.msi
  • Windows Installer command-line options are not case-sensitive.
  • For more information about the Windows Installer command-line options, see Related Topics.

To install a transform using the command line

Syntax
msiexec /i Package TRANSFORMS=TransformList
Parameters

/i
Installs or configures a product.
Package
Specifies the Windows Installer package file.
TRANSFORMS=
Property that is used to specify what transform (.mst) files should be applied to the package.
TransformList
List of paths separated by semicolons.
Remarks
  • Windows Installer command-line options are not case-sensitive.
  • For more information about the Windows Installer command-line options, see Related Topics.

To install and advertise a product using a transform with the command line

Syntax
msiexec /i Package /j[u][m] /tTransformList
Parameters

/i
Installs or configures a product.
Package
Name of the Windows Installer package file.
/j
Advertises a product. This option ignores any property values entered on the command line.
u
Advertises to the current user.
m
Advertises to all users of this computer.
/t
Applies transform to advertised package.
TransformList
List of paths separated by semicolons.
Remarks
  • Windows Installer command-line options are not case-sensitive.
  • For more information about the Windows Installer command-line options, see Related Topics.

To set the user interface level

Syntax
msiexec /q{n | b | r | f | n+ | b+ | b-}
Parameters

/qn
Displays no user interface.
/qb
Displays a basic user interface.
/qr
Displays a reduced user interface with a modal dialog box displayed at the end of the installation.
/qf
Displays the full user interface with a modal dialog box displayed at the end.
/qn+
Displays no user interface, except for a modal dialog box displayed at the end.
/qb+
Displays a basic user interface with a modal dialog box displayed at the end.
/qb-
Displays a basic user interface with no modal dialog boxes.
Remarks
  • /qb+- is not a supported user interface level. The modal box is not displayed if the user cancels the installation.
  • Windows Installer command-line options are not case-sensitive.
  • For more information about the Windows Installer command-line options, see Related Topics.
Examples
To display the basic user interface options during the package installation of Example.msi, type:
msiexec /qb Example.msi

To display copyright information for the Windows Installer

Syntax
msiexec {/? | /h}
Parameters

{ /?| /h}
Displays the Windows Installer version and copyright information.
Remarks
  • Windows Installer command-line options are not case-sensitive.
  • For more information about the Windows Installer command-line options, see Related Topics.

To call the system API DllRegisterServer to self-register modules passed on the command line

Syntax
msiexec /y Module
Parameters

/y
Calls the system API DllRegisterServer to self-register modules passed on the command line.
Module
Specifies the file name of module.
Caution
  • Incorrectly editing the registry may severely damage your system. Before making changes to the registry, you should back up any valued data on the computer.
Remarks
  • This option is used only for registry information that cannot be added using the registry tables of the .msi file.
  • Windows Installer command-line options are not case-sensitive.
  • For more information about the Windows Installer command-line options, see Related Topics.
Examples
The following example shows how you can use the msiexec /y command:
msiexec /y my_file.dll

To call the system API DllUnRegisterServer to unregister modules passed on the command line

Syntax
msiexec /z Module
Parameters

/z
Calls the system API DllUnRegisterServer to unregister modules passed on the command line.
Module
File name of module.
Remarks
  • This option is used only for registry information that cannot be added using the registry tables of the .msi file.
  • Windows Installer command-line options are not case-sensitive.
  • For more information about the Windows Installer command-line options, see Related Topics.
Examples
The following example shows how you can use the msiexec /z command:
msiexec /z my_file.dll

A sales engineer is someone who promise you a bridge, even when there's no river.