• Running PowerShell on MOSS 2007

     

    1. If you are running MOSS 2007 on Windows Server 2003 the you have to download and install PowerShell from http://support.microsoft.com/kb/968930. Windows Server 2008  natively supports PowerShell.
    2. Set the  Execution Policy to 'RemoteSigned'. You can check it by running 'Get-ExecutionPolicy' cmdlet
      The default execution policy for PowerShell is “Restricted” (commands only, not scripts)
           
    # All scripts running locally are allowed
    Set-ExecutionPolicy RemoteSigned

    This means downloaded scripts must be signed by a trusted publisher before they can be run.

         3. You need to load the SharePoint assemblies with the following command

    #    Load the SharePoint assemblies
    [Void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")

    A bunch of PowerShell scripts are available at http://www.powershell.nu/2009/09/08/moss-2007-script-collection

  • Issue found with .NET Framework 3.5.1 Security update KB2756920

    After installing the update KB2756920 on a Windows Server 2008 R2/Windows 7 RTM  computer running SharePoint Server 2010 with previously installed hotfixes for .NET 3.5 SP1. on the server, the following exception is thrown when any WCF service is hosted on IIS using HTTPS

    Server Error in ‘/SecurtyTokenServiceApplication’ Application
    Method not found: ‘System.String System.ServiceModel.Activation.iis7helper.extendedprotectiondotlessspnnotenabledthrowhelper(system.object)’

    An exception occurred when trying to issue security token: The requested service, 'http://localhost:32843/SecurityTokenServiceApplication/securitytoken.svc/actas' could not be activated. See the server's diagnostic trace logs for more information..

    Exception occurred while connecting to WCF endpoint: System.ServiceModel.ServiceActivationException: The requested service, 'http://localhost:32843/SecurityTokenServiceApplication/securitytoken.svc/actas'
    could not be activated due to an exception during compilation. See the server's diagnostic trace logs for more information. Server stack trace:    
    at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory factory, WebException responseException, ChannelBinding channelBinding)

    Extended Stack Trace

    [MissingMethodException: Method not found: 'System.String System.ServiceModel.Activation.Iis7Helper.ExtendedProtectionDotlessSpnNotEnabledThrowHelper(System.Object)'.]
    System.ServiceModel.WasHosting.WebConfigurationManagerWrapper.BuildExtendedProtectionPolicy(ExtendedProtectionTokenChecking tokenChecking, ExtendedProtectionFlags flags, List`1 spnList) +0
    System.ServiceModel.WasHosting.WebConfigurationManagerWrapper.GetExtendedProtectionPolicy(ConfigurationElement element) +362
    System.ServiceModel.WasHosting.MetabaseSettingsIis7V2.ProcessWindowsAuthentication(String siteName, String virtualPath, HostedServiceTransportSettings& transportSettings) +217
       System.ServiceModel.WasHosting.MetabaseSettingsIis7V2.CreateTransportSettings(String relativeVirtualPath) +137
       System.ServiceModel.Activation.MetabaseSettingsIis.GetTransportSettings(String virtualPath) +203
       System.ServiceModel.Activation.MetabaseSettingsIis.GetAuthenticationSchemes(String virtualPath) +16
       System.ServiceModel.Channels.HttpChannelListener.ApplyHostedContext(VirtualPathExtension virtualPathExtension, Boolean isMetadataListener) +62
       System.ServiceModel.Channels.HttpTransportBindingElement.BuildChannelListener(BindingContext context) +158
       System.ServiceModel.Channels.BindingContext.BuildInnerChannelListener() +98
       System.ServiceModel.Channels.MessageEncodingBindingElement.InternalBuildChannelListener(BindingContext context) +98
       System.ServiceModel.Channels.BinaryMessageEncodingBindingElement.BuildChannelListener(BindingContext context) +70
       System.ServiceModel.Channels.BindingContext.BuildInnerChannelListener() +98
       System.ServiceModel.Channels.Binding.BuildChannelListener(Uri listenUriBaseAddress, String listenUriRelativeAddress, ListenUriMode listenUriMode, BindingParameterCollection parameters) +172
       System.ServiceModel.Description.DispatcherBuilder.MaybeCreateListener(Boolean actuallyCreate, Type[] supportedChannels, Binding binding, BindingParameterCollection parameters, Uri listenUriBaseAddress, String listenUriRelativeAddress, ListenUriMode listenUriMode, ServiceThrottle throttle, IChannelListener& result, Boolean supportContextSession) +400
       System.ServiceModel.Description.DispatcherBuilder.BuildChannelListener(StuffPerListenUriInfo stuff, ServiceHostBase serviceHost, Uri listenUri, ListenUriMode listenUriMode, Boolean supportContextSession, IChannelListener& result) +1070
       System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription description, ServiceHostBase serviceHost) +2005
       System.ServiceModel.ServiceHostBase.InitializeRuntime() +60
       Microsoft.IdentityModel.Protocols.WSTrust.WSTrustServiceHost.InitializeRuntime() +408
       System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) +63
       System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +560
       System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +141
       System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +683

    [ServiceActivationException: The service '/SecurityTokenServiceApplication/securitytoken.svc' cannot be activated due to an exception during compilation.  The exception message is: Method not found: 'System.String System.ServiceModel.Activation.Iis7Helper.ExtendedProtectionDotlessSpnNotEnabledThrowHelper(System.Object)'..]
       System.ServiceModel.AsyncResult.End(IAsyncResult result) +460
       System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +471
       System.Web.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar) +101

    The issue is limited to Windows Server 2008 R2/ Windows 7 RTM machines only.

    The issue occurs due to previously installed hotfixes and NOT the security update KB2756920 itself.

    Recommendations

    • It is recommend that you Install a newer hotfix for 3.5 SP1 like http://support.microsoft.com/kb/2637518 and then install the security update. If you have already installed the security update then simply install the above hotfix.
    • Another workaround would be to upgrade the machines from Windows Server 2008 R2/Windows 7 RTM to SP1.

    You do not have to uninstall the security update as one of the above options will suffice the need.

    MS13-004: Description of the security update for the .NET Framework 3.5.1 on Windows 7 and Windows Server 2008 R2: January 8, 2013

    UPDATE

    The issue caused by the update KB2756920 - Security update for the .NET Framework 3.5.1 on Windows 7 and Windows Server 2008 R2 RTM and its solution has been documented in KB2801728 - WCF services that are hosted on IIS on Windows 7 or Windows Server 2008 R2 may receive an exception error message after you install an update for the .NET Framework 3.5 SP1 for WCF for reference.

    The cause section of the KB has been updated with:

    This problem occurs because the computer may have some hotfixes installed that contained only "System.ServiceModel.dll" and not "System.ServiceModel.WasHosting.dll". See the "More Information" section of the KB for a list of hotfixes that are known to contain only these files.

     

    Also see http://social.technet.microsoft.com/forums/en-US/sharepointadminprevious/thread/903d0e22-6419-48c5-8669-a1191c841b76

  • Potential Issues with KB 931125

     

    The KB 931125 package that was posted to Windows Update and WSUS on December 11, 2012, was intended only for client SKUs. However, the package was also offered for server SKUs. Because some customers reported issues after they installed the package on servers, the KB 931125 updates for server SKUs were expired from Windows Update and WSUS. We recommend that you sync your WSUS server and approve the expiry.

    Symptoms include:

    • Clients cannot login to Wireless networks that use IAS or NPS to authenticate users
    • VPN users cannot connect to Microsoft VPN servers or VPN servers that authenticate to IAS or NPS servers
    • Kerberos login failures
    • Exchange or Lync server problems with TLS
    • You may see symptoms described in KB 933430 or 2464556

    If you have already applied the update on a server and are encountering issues, you should use the Fix It solution in the following article in the Microsoft Knowledge Base:

    2801679 -  SSL/TLS communication problems after you install KB 931125

  • SharePoint 2010 Management Shell does not load with Windows PowerShell 3.0

     

    Let’s say that you install PowerShell 3.0 by by installing the Windows Management Framework (WMF) 3.0 from

    However, after you install WMF 3.0 and PowerShell, you may receive one or both of the following error messages when you start SharePoint 2010 Management Shell:

    1. The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered.
    2. A PlatformNotSupportedException occurred while trying to acquire the local farm: System.PlatformNotSupportedException: Microsoft 
      SharePoint is not supported with version 4.0.30319.586 of the Microsoft .Net Runtime.
      at Microsoft.SharePoint.Administration.SPConfigurationDatabase.get_Farm() at Microsoft.SharePoint.Administration.SPFarm.FindLocal(SPFarm& farm, Boolean& isJoined)

    Cause

    .Net 4.5 comes with PowerShell 3.0 which seems to break SharePoint 2010 PowerShell administration. That is because PowerShell 3.0 loads CLR 4.5 and
    SharePoint 2010 needs CLR 3.5 (AKA 2.0).

    How do you get around it:

    • Type "PowerShell -v 2" (without quotes). This loads PowerShell version 2, and you should be able to use it for SharePoint. Just type 'Exit' to get back to PowerShell v3
    • Add '-version 2.0' parameter when executing PowerShell 3.0, and SharePoint integration should work.
    • Change the Target field value for SharePoint 2010 Management Shell to the following:

    C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe -Version 2.0 -NoExit " & ' C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\POWERSHELL\Registration\\SharePoint.ps1 ' "

    See KB 2796733

    Note: This is not an issue with Windows PowerShell. This is an issue with the SharePoint 2010 compatibility with PowerShell 3.0.