Friday, September 23, 2011

Manipulating FrontPage 2002 Server Extensions in Windows 2008 Server

My recent task was to help move FrontPage 2002 websites from a Windows 2000 server utilizing IIS 5.0 to a new Windows 2008 R1 server with IIS 7.0.  Microsoft stopped supporting FrontPage Server Extensions (FPSE) in IIS 7 so a third party company named Ready-to-Run created a solution.  Beware though, for Windows 2008 R1, there is no need for a separate license server.  But, for 2008 R2, which is IIS 7.5, the FPSE add-on requires a separate license server if Windows 2008 is hosted on a virtual machine.  This requires at least 5 ports to be opened in your firewall plus having a dependency on a another (physical) computer to host the license file and associated program/service.


Adding the FPSE software is relatively easy.  IIS.Net has great information about this process. Warning:  logon as the Administrator and perform all duties as the Administrator, no matter what your user permissions are.  UAC creates unusual and unexpected results if you don't run as Administrator -- especially if running from the PowerShell or Command line.  Another note, ASP from IIS 5.0 uses .Net 2.0 and IIS 7.x uses .Net 3.0 (integrated).


FPSE comes with a powerful command line executable you may want to use if you have several websites, subwebs, and/or users and permissions to populate.  Combined with PowerShell, you can create some simple CSV files, input your information, and build your web environment without having to the use SharePoint Designer GUI in a painstakingly slow building process.


Using IIS, create a parent website that will host the subwebs.  Assign it's IP, port, etc. Use the SharePoint Admin web interface to extend the website with FPSE.  Once created and extended, click on IIS/Sites locate your new websites ID number.  That will be important for the scripts.


Creating subwebs using PowerShell and OWSADM:
The FPSE executable OWSADM.EXE is located in "%systemdrive%\program files (x86)\common files\microsoft shared\Web Server Extensions\50\bin".  Open a cmd.exe window and CD your way to the owsadm.exe location.  This is the syntax for creating a subweb:
owsadm.exe -o create -w /Subwebname -m YourParentSiteID -u InitialSubwebAdmn -pw (don't have to use)
Example:
owsadm -o create -w /TestSubWeb -m 4 -u Administrator -pw MyPa$$w0rd


Once your subsite is created, you can add users and roles.  To do so, follow this syntax:
owsadm -o roleusers -w /Subwebname -c add -u user1,user2,user3 -n Browser -m YourParentSideID
Example:
owsadm -o roleusers -w /TestSubWeb -c add -u Bob,Tom,Wilma -n Browser -m 4
(no spaces between users and commas and for Advanced author use Advauthor)


If you have several websites, subsites, and users, it might be worth your while to create CSV files to import into a couple of PowerShell scripts.  PowerShell is powerful and requires you to run it as Administrator.  Also, you have to turn on scripting for PS via the "set-executionpolicy Unrestricted."  Default is Restricted.  I mention how to change it in a previous blog post.  


Create a CSV for your Subwebs:



ParentWeb,Subweb,Admin,Password
4,2014,dbadmin,password

4,TestSubweb,Admin,password



Save this file as Subwebs.csv in the same folder as you'll run your PowerShell script from (I suggest from the owsadm.exe folder)


Create a PowerShell script:



import-csv Subwebs.csv|foreach {
$parent = $_.ParentWeb
$subweb = $_.Subweb
$admin = $_.Admin
$password = $_.Password
.\owsadm.exe -o create -w /$subweb -m $parent -u $admin
}


In this script I left out the password portion as the user accounts were already created and I ddn't want to jeopardize them.  You can add and use -pw and input the data from column four of the Subwebs.csv, just remember to add -pw $password to the owsadm line.


Once the subwebs are created, you can work on inputting your users and their subweb roles.  Create Webperms.csv and add users and roles:



Subweb,User,Perm
2014,brad,Browser
2014,anslo,advauthor


Save to the owsadm.exe folder then create a PowerShell script:



import-csv Webperms.csv|foreach {
$perm = $_.Perm
$user = $_.User
$subweb = $_.Subweb
.\owsadm.exe -o roleusers -w /$subweb -c add -u $user -n $perm -m 4
}

Now you can consult with your webmaster to get all the information about moving sites over to a new server.  Update the CSV files with the appropriate information and run the PowerShell scripts when you're finished dotting your I's and crossing your T's.  Both owsadm.exe and PowerShell are syntax picky so ensure there's no extra spaces, quotes, or other extraneous marks in your commands or CSV files.


Please leave comments if this article helped you or you need more information.  I wrote it with the assumption that you are well-versed in server administration and some scripting knowledge.  Enjoy!


References:
http://technet.microsoft.com/en-us/library/cc768032.aspx
http://support.microsoft.com/kb/272945
http://support.microsoft.com/kb/838684
http://learn.iis.net/page.aspx/134/installing-the-frontpage-server-extensions-on-iis-7/

No comments: