Showing posts with label window 2008. Show all posts
Showing posts with label window 2008. Show all posts

Jun 14, 2010

Create a persistent alias in PowerShell

Often times, I need to query sharepoint cmdlets as I am starting to use Powershell, normally i wrote something like this:

 get-command where {$_.name -like "get-sp*"}

It works, but would it be nice to have this defined as an alias as I need to run it very often. Sure you can do this by using set-alias cmdlet, but it won;t survive another session, in other words, after you close powershell, it is gone.

the workaround is to define a function or alias in profile:

  •  Open Powershell ISE from Programs>Accessories>PowerShell folder
  •  Run the following code from the immediate window in ISE to create a new profile for all users
if (!(test-path $profile.AllUsersAllHosts)) {new-item -type file -path $profile.AllUsersAllHosts-force}

  •  Run the following code to edit the new profile
           psEdit $profile.AllUsersAllHosts


  •  When profile1.ps1 opens, add the following code:
           function getspcmd { get-command where {$_.name -like "get-sp*"}}
  • save and exit ISE
  • relaunch ISE and type "getspcmd"

Jun 3, 2010

Logon restriction on service accounts

Lately I ran into the same problem several times, so I decide to blog this to save someone else a couple, if not more, frustrating hours.

The problem is, during sharepoint or sql server installation we need to enter several service account and their passwords, and even though I use those passwords many times without any problem, I keep getting an error saying "invalid password or username", or sql service (or any other window service) can't start with the password  I enter. Someone must change the password without letting anyone else know?!

Not really, generally for those service accounts, network or server guys like to impose a log on restriction:


make sure your new server is in the list! and check the spell (no typo. windows don't check that for you).

Jun 1, 2010

another error when configuring sharepoint 2007 integration with Reporting Service

when I try to configure "Grant database access" of reporting service in Sharepoint Central Administration, I keep getting the following error:

Unable to connect to the Report Server WMI provider.

As I was able to do this for another Report Server where SSRS 2008 R2 is installed, so the first thing I was thinking of is to upgrade  SSRS 2008 SP1 with CU#5, but it made no difference.

The 2 servers are in the same domain, and can ping each other. Then i found the interesting thing is, i got the same error no matter what credential i put in, which lead me to think it might be a window firewall issue. I went to check the RS server's window firewall, it is ON! I turned it off, the problem went away immediately.

It turns out the following exception should be made: Window Management Instrument (WMI).  Sharepoint did give out a very useful error message! Don't blame SharePoint.

Apr 28, 2010

Install SharePoint 2010 RTM with a named sql Instance

I am installing a sharepiont 2010 farm with its configuration database in a remote sql server, and am using a named sql instance for its configuration database. During  running SharePoint Product Configuration Wizard, I keep getting the following clueless error message:

Cannot connect to database master at SQL server at ..... The database might not exist, or the current user does not have permission to connect to it.
This happened even after I opened firewall exceptions for sqlservr.exe or whatever port the named instance is running at! As that was what I did to the default instance and I never had problem connecting to the default instance. So what is the issue with the named instance?

In SQL server, I run sql profile and found no connection even being attempted from the sharepoint wizard, so it seems most likely a firewall issue.  As a testing, I turned off window firewall, and it works immediately!

But I can't leave the firewall off, so I have to find out what else I need to open in the firewall. After some googling, I understand how sql named instance works differently from default instance: the named instances need handshaking when a connection is requested (as client requests normally don;t include port number, but just instance name), and it is SQL Browse Service which helps client find port number at which the named instance is running at. The service name is sqlbrowser.exe and it is running at UDP port 1434.

With that, opening firewall for either .exe or UDP port 1434, the problem goes away, and I got a first look at SharePoint 2010 RTM after so many months with Beta. It is so exciting!

Mar 19, 2010

Window Server, .Net Framwork and Visual Studio

Recently my coworker install Ajax Extension 1.0 on Window Server 2008 R2. As we know, Ajax 1.0 is an add-on only for .Net 2.0 framework, and Ajax support in .Net 3.5 is native. This installation doesn't make senses, however, the installation did fix issues for sharepoint content deployment. The story is, even though .Net Framework 3 is shipped, you still need to install it, otherwise, you only get .Net 2.0



As developer, most of us get .Net framework from the development tool we use: Visual Studio,


So it is important to know what .Net version on your deployment target server.

As a SharePoint developer, we know what .Net framework SharePoint is built on:

  • SharePoint 2010 .Net 3.5
  • SharePoint 2007 .Net 2.0
  • SharePoint 2003 .Net 1.0
If you want your sharepoint 2007 to run .Net 3.5 framework ( maybe  because you develop in VS 2008 and use some features such as LinQ), you need to modify the web.config as below:

<sharepoint >
  < system.web >
     <compilation >
        < assembly >
           < add assembly="System.Core, Version=3.5.0.0, Culture=neutral, publicKeyToken = B77A5C561934E089" >

 
Running SharePoint 2007 on a Window 2008 server doesn't mean SharePoint can run .Net 3.5 features such as SilverLight, Ajax and LinQ etc. see this article for more details.

Jan 27, 2010

Using SharePoint PowerShell with intellisense

With thousands of cmdlets in SharePoint PowerShell, it is almost impracticable to use PowerShell without intellisense, for this reason, I posted the question on how to get intellisense for SharePoint PowerShell on Twitter, LinkedIn SP groups, MindSharp Mailing list, but didn't get response back. Turns out it is not that difficult, but in case someone needs a quick reference, here is the things you need to do:


First Download Window PowerShell V2.o to install PowerShell ISE (UPDATE:  ISE is installed in  window 2k8 R2, just need to activate as feature You will find it in All Programs -> Accessories ->Windows PowerShell)



Follow this post to load SharePoint snap-in into Window PowerShell ISE

Use intellisense by entering Tab key


One twist is, after using index, such as Lists["shared documents"], intellisense stop working, as a workaround, $list=$siteCollection.RootWeb.Lists["shared documents"], intellisense will work after $list.

Nov 17, 2009

RSS Viewer web part bug

If you want to use RSS Viewer web part for private/authenticated feed, you need enable Sharepoint Kerberos authentication. Otherwise you get error: "The RSS webpart does not support authenticated feeds" even the feed from its own site.(update 03/31/2010:
  • on window 2008, it can view authenticated feeds from its own site, but it is win2k8 only. on both window 2003 and window 2008 R2, it requires SPN registration (delegation not necessary) and Kerberos in order to view authenticated feeds;
  • if both feeds and RSS Viewer on the same server, only consuming web application (RSS Viewer host) needs Kerberos even if feeds are from other web application with different application pool;(on window 2008, it only requires IIS kerberos setting, no SPN needed)
  • the above apply for both moss and sharepoint 2010;

When you view a private feed, you may also get the following error:

"An unexpected error occured processing your request. Check the logs for details and correct the problem."


It happens when you use a non-default zone URL for sharepoint site: (update 03/31/2010: this appears not to happen on sharepoint 2010 beta2)



With AAM setting like this:






It works if using the default zone URL:
(update 03/31/2010) Reference: SharePoint 2010 and Kerberos by Spence Harbar

Jul 25, 2009

Configure and Test SharePoint Incoming Email in Window Server 2008

I have built a Win2k8 based sharepoint 2007 farm (1 WFE, 1 Index and 1 SQL), and have its incoming email configured as follows:

1.install SMTP in both WFE( for incoming email) and Application Server (for outgoing email);

2.check services in CA to make sure WFE is running "incoming email service" and Application Server is running "outgoing email service";

3. Create a DNS MX record such as:
(same as parent folder) MX [10] spweb.sp.local or
moss MX [10]spweb.sp.local
this essentially tells spweb.sp.local is the mail server for the domain of sp.local or subdomain moss.sp.local. read here for more details.

4. Configure mail server's SMTP domain list to include an alias of sp.local (for normal user email address, used to test SMTP extension/pop3) and an alias of moss.sp.local for sharepoint email enabled lists:
5. Configure "incoming setting" in CA
  • allow farm to receive email
  • specify email address such as moss.sp.local
6. Configure list setting to allow list get emails
  • specify email address for a sharepoint list, such as sharedDoc@moss.sp.local
  • check "yes" on "Save original e-mail"
7. Configure an email client (outlook).
  • install SMTP extension (pop3). This is a necessary (and hard) part since Win2k8 doesn't have POP3 built in.
  • open window firewall at port 110 (for pop3)
  • create an outlook account for testing:
    * Email address ends with one of SMTP domain alias list such as admin@sp.local
    * setting smtp server (not confused with sp outgoing eamil server) and pop3 server (iP address, not Netbios)
    * user password to logon to pop3 server (defined in smtp extension's configure.xml located in "c:\ProgramData\ppedv\visendosmtpextender")
8) Test first if sending and receiving email work okay in outlook by sending some email to itself, and then test sending email to a sharepoint list such as shareddoc@moss.sp.local.

Overall, the very simiplied picuture is: mail client asks its local SMTP to send an eamil to shareddoc@moss.sp.local)-> outlook's local SMTP server ask DNS,who is mail server for remote domain sp.local ? -> find MX record from DNS ->logon to remote mail server SMTP-> check for mail domain moss.sp.local: if it doesn't exisit, mail sending fails there. If it does exist, mail goes to SMTP's drop folder and stay there waiting for SharePoint Timer Job to pick up and put into the assocaited list. For regular user email, mail client using POP3 will do the pickup job, and the only difference is regular user email has its individual subfolder under the drop folder root.

Jul 23, 2009

Moss 2007 and Server 2008 window firewall

I have installed MOSS 2007 on a farm of 3 window 2008 servers:
There are serveral problems all related with window firewall:
  • can't browse Central Admin from anywhere other than Application server

Window Firewall only open Http at port 80. open an exception at CA port in App server to fix this problem.

  • Office Search Service or SSP can't be configured

Sharepoint SSP use web service call at port 56737. open exceptions on both WEF and App servers to fix this problem. If no query server is specified, configuration "looks like" it can go through, but "check service enabled in farm" disclose problems. Be sure to check it.

  • Index Propagation fails

Sharepoint use SMB (File Shareing) protocol to push index from Index to Query server (WFE in this case). Open "File and Printer SharePoint" exception to fix this problem.

reference: http://blogs.msdn.com/joelo/archive/2007/02/13/protocols-ports-and-firewall-rules.aspx

http://blogs.msdn.com/uksharepoint/archive/2009/01/05/sharepoint-ports-proxies-and-protocols-an-overview-of-farm-communications.aspx

http://support.microsoft.com/kb/962928/en-us

Jul 19, 2009

Window Server 2008, Hyper-V and Wireless Connection

In preparation for SharePoint 2010, I need to convert a 64-bit Vista Workstation into a server runing window 2008 and then run Hyper-V to create a farm of 3 servers: a Domain Controller, a SQL server, and one Web server. My another goal is to setup all wireless network connection for all VMs and my physical server. Here are the outlines on some major steps:

1) Convert Vista to Win2k8.
Booting with Win2k8 CD. There are choices of either formating disk or replacing Vista. I chose the latter since I don't need to install drivers again.


2) Setup wireless connection
First need to enable wireless feature for win2k8:
Secondly need to update wireless driver: no Window 2k8 wireless driver availabe, but I can use Vista's driver: the win2k8 installation process save all vista drivers in Windows.old folder. I use "Update Driver" option in Device Manager:
3) enable RDP.
Since I build this as my work platform, I need to access anywher via RDP:
  • need to Change "Remote" Option: Computer->Properties->Remote Setting->Remote
3) setup Hyper-V
4) Create VMs
First time when I created VMs, they don't have any network connection even if I have wireless connection for my phsical server. It turns out Hyper-V doesn't support wireless adapters. The workaround is:
  • create a virtaul network in Hyper-V's Virtual Network Manager and then bridge it with wireless connection (details).
  • Then run Hyper-V to create VMs with the virtual network connection created above.
For DC vm I chose mini requirement: 512MB memory and 32G disk.
Since I also want to RDP from my phsical server to VMs ( I can certainly connect to them, but if I RDP to my server first and then connect to VMs, window key combination can't go through to VMs) , I enabled RDP as I did to my physical server. But to my surprise that only allows me to use IP address! When i use VM BIOS, it said it can't find the server! I looked at my router's DNS, the VM BIOS name is not there. and I can't add it (get "entry already exist" error) for some reasons. As a workaround I open Window FireWall for PING (see here on how to ping), and I can then RDP its BIOS name.
5) promote Domain Controller
  • run dcpromo.exe (detail)
  • disable IP6 for DC vm's connection and configure IP4:
    • since my server is From DHCP, DC vm need a static IP address and its DNS server should point to itself details
            6) join other VMs to Domain
            I have create other 2 VMs also runing Win2k8, and need to join them to the Domain I just created. To do so, the only trick is to set each VM's DNS server to DC/DNS VM IP(otherwise it will go to my home router's DNS instead), and then change WorkGroup to Domain just like changing computer's BIOS name. DC will add VM server into AD once it is joined, and DNS server will dynamically add VM's name into dns table once VM is connected.

            by now I have a farm of 3 virtual servers running on a sub domain (or virtual sub net). It was a long weekend, but I am so happy about Hyper-V. It really rocks!