When you are installing SharePoint and SQL Server on the same machine, than you don't have to bother with this kind of problems, but if you want to install SharePoint on one server and SQL Server (which will hold SharePoint's databases) on the other server, than you need to join these two servers to the same domain for them to work together.
Procedure for doing this is very simple. This is what you need to do on each server:
1. Open Windows Explorer and go to path:
c:\Windows\System32\driver\etc
and open hosts.txt file in Notepad.
2. At the end of that file add your domain's IP address and name. For example:
192.168.1.10 mydomain.com
NOTE: You need to be able to ping this IP address from each of your servers.
3. On the each server go to:
Start - Control Panel - Network Connections - right mouse click on your Network Adpter and select "Properties" - select "Internet Protocol Version 4 (TCP/IPv4)" and click on button "Properties" - on the next screen select option "Use the following DNS server addresses" and write your domain server's IP address and save settings.
4. Go to:
My Computer - Properties - Advanced - Computer name and click on button "Change".
Now, instead of "WORKGROUP", write your domain's name, which you wrote in the hosts.txt file in step 2 (for example: mydomain.com).
If you did this procedure on each server, now they both should be in the same domain.
Thursday, May 1, 2014
Tuesday, April 29, 2014
SharePoint - Error occurred in deployment step 'Activate Features': Operation is not valid due to the current state of the object
This error can appear when you try to deploy your SharePoint solution, but this message has no detailed data so it is not obvious how to solve it.
There are few things you can do to remove this error:
1. If you changed namespace or assembly name or class name in your solution, you have to check that you have the same namespace and assembly and class name in your Elements.xml file. This is the most common error. Check out Sue Hernandez's blog for more details on this:
http://suehernandez.wordpress.com/2011/03/31/error-occurred-in-deployment-step-activate-features-operation-is-not-valid-due-to-the-current-state-of-the-object/
2. If you still have the same error after step one try restarting SharePoint Timer Service and do an IISRESET.
3. If step 2 didn't resolve your error, check if your deployment target is set to "WebApplication". It needs to be set to "Global AssemblyCache" instead.
3.1. Click on you project name in your solution.
3.2. In Properties window, set "Assembly Deployment Target" option to "GlobalAssemblyCache".
3.3. Close Visual Studio.
3.4. Restart server.
After your server restarts, you should be able to deploy solution without any errors.
There are few things you can do to remove this error:
1. If you changed namespace or assembly name or class name in your solution, you have to check that you have the same namespace and assembly and class name in your Elements.xml file. This is the most common error. Check out Sue Hernandez's blog for more details on this:
http://suehernandez.wordpress.com/2011/03/31/error-occurred-in-deployment-step-activate-features-operation-is-not-valid-due-to-the-current-state-of-the-object/
2. If you still have the same error after step one try restarting SharePoint Timer Service and do an IISRESET.
3. If step 2 didn't resolve your error, check if your deployment target is set to "WebApplication". It needs to be set to "Global AssemblyCache" instead.
3.1. Click on you project name in your solution.
3.2. In Properties window, set "Assembly Deployment Target" option to "GlobalAssemblyCache".
3.3. Close Visual Studio.
3.4. Restart server.
After your server restarts, you should be able to deploy solution without any errors.
Saturday, March 1, 2014
Powershell - The execution of scripts is disabled on this system
I tried to run some scripts in Powershell yesterday on my new SharePoint server, but was unable to do so and I got this message: "The execution is disabled on this system".
The solution to this problem is very simple. Just write the following command:
Set-ExecutionPolicy Unrestricted
Now you will be able to run your ps1 scripts in Powershell.
The solution to this problem is very simple. Just write the following command:
Set-ExecutionPolicy Unrestricted
Now you will be able to run your ps1 scripts in Powershell.
Tuesday, February 11, 2014
Project Server - Are you sure you want to navigate away from this page
When creating or editing project in project Server, it implies that you change lots of field values in Project Detail Pages.
After every change on Project Detail Page, you need to click on Save button in Ribbon for changed to be saved. If you don't do that (and you try to navigate away from that page without saving), you will be prompted with the following message: "Are you sure you want to navigate away from this page?"
This is perfectly normal behavior of Project Server.
The problem starts when this message appears when you haven't made any changes on the Project Detail Page. For example: You have made changes on your Project Detail Page and then click on the Save button. But, when you try to navigate away from that page, you get this message. I was confused because I didn't know did Project Server really saved my changes or not.
This seems to be a bug in Project Server this happens when you have more than one multiline text box fields on the page.
I have found one one solution for this problem.
NOTE: This solution changes default scripts of Project Server. It is not recommended by Microsoft to customize this scripts. Actually, it is not allowed and all changes you make to this scripts can cause unexpected behaviour of Project Server.
Now, after you have been properly warned, this is the solution:
1. Go to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\INC\PWA\LIBRARY
2. Find script called "ProjectServerScripts.debug.js" and make a backup of that script (we are going to change the existing script so it is good to have a backup).
3. Open script "ProjectServerScripts.debug.js" and in it find following code:
handleSaveCommand:function(command, properties, sequenceNumber){ULSBk9:;
eval('PDPButton.SaveData(null);');
return true;
},
4. Add one line (marked red) to that method and save changes:
handleSaveCommand:function(command, properties, sequenceNumber){ULSBk9:;
eval('PDPButton.SaveData(null);');
window.onbeforeunload = function(e){}
return true;
},
After every change on Project Detail Page, you need to click on Save button in Ribbon for changed to be saved. If you don't do that (and you try to navigate away from that page without saving), you will be prompted with the following message: "Are you sure you want to navigate away from this page?"
![]() |
| Prompt window for saving changes in Project Server |
This is perfectly normal behavior of Project Server.
The problem starts when this message appears when you haven't made any changes on the Project Detail Page. For example: You have made changes on your Project Detail Page and then click on the Save button. But, when you try to navigate away from that page, you get this message. I was confused because I didn't know did Project Server really saved my changes or not.
This seems to be a bug in Project Server this happens when you have more than one multiline text box fields on the page.
I have found one one solution for this problem.
NOTE: This solution changes default scripts of Project Server. It is not recommended by Microsoft to customize this scripts. Actually, it is not allowed and all changes you make to this scripts can cause unexpected behaviour of Project Server.
Now, after you have been properly warned, this is the solution:
1. Go to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\INC\PWA\LIBRARY
2. Find script called "ProjectServerScripts.debug.js" and make a backup of that script (we are going to change the existing script so it is good to have a backup).
3. Open script "ProjectServerScripts.debug.js" and in it find following code:
handleSaveCommand:function(command, properties, sequenceNumber){ULSBk9:;
eval('PDPButton.SaveData(null);');
return true;
},
4. Add one line (marked red) to that method and save changes:
handleSaveCommand:function(command, properties, sequenceNumber){ULSBk9:;
eval('PDPButton.SaveData(null);');
window.onbeforeunload = function(e){}
return true;
},
Monday, December 30, 2013
Project Server - check if project is approved
This is my new post in my Project Server series. In this post, I've written short c# code (using PSI) on how to check if project in Project Server is already approved.
This short code comes in handy when you need to do some action only after the project is approved.
Other posts regarding Project Server PSI functions: how to use PSI in Project Server in simple way, how to get values from Custom Fields from code with PSI, how to restart workflow from code using PSI, get members of Project Server group using PSI, change EPT using PSI and how to update Custom Field using PSI.
This is the C# code:
This short code comes in handy when you need to do some action only after the project is approved.
Other posts regarding Project Server PSI functions: how to use PSI in Project Server in simple way, how to get values from Custom Fields from code with PSI, how to restart workflow from code using PSI, get members of Project Server group using PSI, change EPT using PSI and how to update Custom Field using PSI.
This is the C# code:
public static bool IsProjectApproved(Guid
projectUid)
{
var logService = new LogService();
var sessionService = new
PSSessionService()
{
HostName = "serverName", // your PWA host name
SiteName = "pwa" // your PWA site name
};
// we need this user for LoginContext (it can be read from app settings)
string _user = "Username";
string _userPwd = "Pass";
string _userDomain = "Domain";
using (var _loginCtx
= new LoginContext(_userDomain
+ "\\" + _user, _userPwd,
sessionService))
{
try
{
PsiContextService
psiContextService = new PsiContextService();
PSISvcsFactory psiSvcsFactory = new PSISvcsFactory(sessionService,
psiContextService);
Workflow _wfSvc =
psiSvcsFactory.CreateSvcClient<Workflow>();
WorkflowDataSet dtWf = _wfSvc.ReadWorkflowStatus(projectUid, true);
// _max is the last ORDER of the Status in DB
int _max = -1;
bool _status = false;
foreach (var
item in dtWf.WorkflowStatus)
{
if (item.STAGE_ORDER > _max)
{
_max =
item.STAGE_ORDER;
if (item.STAGE_INFO.ToLower().Contains("project approved"))
_status = true;
else
_status = false;
}
}
return _status;
}
catch (Exception)
{
return
false;
}
}
}
Subscribe to:
Posts (Atom)



