Tuesday, June 30, 2015

Cannot connect to WMI provider - SQL Server Configuration Manager



Error: “Cannot connect to WMI provider. You do not have permission or the server is unreachable. Note that you can only manage SQL Server 2005 and later servers with SQL Server Configuration Manager.”














Resolution:

Open command prompt, navigate following path:
C:\Program Files <x86>\Microsoft SQL Server\110\Shared

The value of number depends on the version of SQL Server

Microsoft SQL Server 2012
110
Microsoft SQL Server 2008 R2
100
Microsoft SQL Server 2008
100
Microsoft SQL Server 2005
90

 
Type next command, and then press ENTER:

mofcomp sqlmgmproviderxpsp2up.mof











After you run the Mofcomp tool, make sure to restart the WMI service for the changes to take effect.

Event ID 5586, Cannot generate SSPI context


Event Viewer:

Unknown SQL Exception 0 occurred. Additional error information from SQL Server is included below.The target principal name is incorrect.  Cannot generate SSPI context.

 

Solution:

Logon to the SQL server using Domain Admin rights.

Start command prompt as Administrator:
setspn -L MyDomain\MyUserName
Registered ServicePrincipleNames for CN=MyUserName Service Account, OU=Service Accounts, DC=MyDomain,DC=com: mssqlsvc/MyServer1.MyDomain.com:MyPort mssqlsvc/MyServer2.MyDomain.com:MyPort mssqlsvc/MyServer3.MyDomain.com:MyPort

Note: MyUserName will be SharePoint Timer Service account, this is SharePoint Farm account

If you are getting the error (Cannot generate SSPI context), you will not find the SQL server name in the list displayed by the command.

To Register your SQL server type the following command.
setspn -A MSSQLSvc/MyServer.MyDomain.com:1433 MyDomain\MyAccount
Note:- MyServer will be the SQL server name to which you are not able to connect.

Again run the
setspn -L MyDomain\MyUserName command, you should find your SQL servers FQDN registered.


 

Tuesday, June 23, 2015

Deploy desktop shortcut and Icon using a Group Policy

You can easily to add desktop shortcuts using Group Policy with just a few clicks.

Open Group Policy Management

Click on "Create a GPO in this domain, and Link it here..."






















Type Name of GPO.















Right click on GPO, Edit.









Then will be open Group Policy Management Editor.
Navigate to User Configuration, Windows Settings, Shortcuts.




















Right click, New, Shortcut.



















Configure Properties.

























"Gpupdate /force" in PowerShell on user machine, or restart.




Enable email notification in task list in SharePoint

How to send a email notifications in SharePoint task list to persons who have been assigned list items?

Run SharePoint Management Shell as Administrator

$site=Get-SPWeb "http://SiteURL"
$list=$site.Lists.TryGetList("List Name")
if($list -ne $null)
{
   $list.EnableAssignToEmail =$true
   $list.Update()
}




Tasks in SharePoint MySite - "Last updated" every minute


How to reduce the refresh time for Tasks in SharePoint My Site?


Start SharePoint Management Shell as Administrator

$wmservice = Get-SPServiceApplication -Name "Work Management Service Application"

$refreshTime = New-Timespan -Minutes 1

Set-SPWorkManagementServiceApplication -Identity $wmservice -MinimumTimeBetweenProviderRefreshes $refreshTime