SharePoint Powershell for Solution Deployment (WSP)
[ 2 ] August 8, 2010 | Michal Pisarek
So we have covered a couple of areas with PowerShell but on of the most used, especially for those of use that like to play around with SharePoint, is the addition of solutions and features to our farms.
Now that we have PowerShell available in SharePoint 2010 you should really be using this to add your solutions, even though you can still do this with stsadm (but come on who wants to)
MOSS Solution Commands
In the 2007 days there were essentially 5 different commands used for dealing with solutions:
We added solutions using the addsolution command to the Farm:
1
stsadm –o addsolution –filename "C:\Deployment\MySharePointSolutionPackage.wsp"
To deploy the solution we used the deploysolution command:
1
stsadm –o deploysolution –name MySharePointSolutionPackage.wsp –url http://webapplication –allowgacdeployment –immediate
To upgrade a solution we used the upgradesolution command:
1
stsadm –o upgradesolution –name MySharePointSolutionPackage.wsp –filename "C:\Deployment\MySharePointSolutionPackage.wsp" –immediate
To retract and remove a solution we used the retractsolution and removesolution commands respectively:
1
stsadm –o retractsolution –name MySharePointSolutionPackage.wsp –url http://webapplication –immediate
2
stsadm –o deletesolution –name MySharePointSolutionPackage.wsp
Powershell Solution Cmdlets
Adding
To add a solution to the Farm solution store use the Add-SPSolution cmdlet:
1
Add-SPSolution –LiteralPath "C:\Deployment\MySharePointSolutionPackage.wsp"
To add a Sandboxed solution use the Add-SPUserSolution cmdlet:
1
Add-SPUserSolution –LiteralPath "C:\Deployment\MySharePointSolutionPackage.wsp" –Site http://webapplication/sitecollection
Installing
To install ( commonly known as deploy) a Farm Solution we use the Install-SPSolution cmdlet:
1
Install-SPSolution –Identity MySharePointSolutionPackage.wsp –WebApplication http://webapplication –GACDeployment
To install ( commonly known as deploy) a Sandboxed Solution we use the Install-SPUserSolution cmdlet:
1
Install-SPUserSolution –Identity MySharePointSolutionPackage.wsp –Site http://webapplication/sitecollection
Updating
To update (know as upgrade in stsadm) a Farm solution use the Update-SPSolution cmdlet:
1
Update-SPSolution –Identity MySharePointSolution.wsp –LiteralPath “C:\Deployment\MySharePointSolutionPackage.wsp” –GacDeployment
To update (know as upgrade in stsadm) a Sandbox solution use the Update-SPUserSolution cmdlet:
1
Update-SPUserSolution –Identity MySharePointSolution.wsp –Site http://webapplication/site –ToSolution MySharePointSolutionPackage.wsp
Removing
To uninstall and remove FARM level solutions use the Uninstall-SPSolution and Remove-SPSolution cmdlets:
1
Uninstall-SPSolution –Identity MySharePointSolution.wsp –WebApplication http://webapplication
2
Remove-SPSolution –Identity MySharePointSolution.wsp
To uninstall and remove Sandbox solutions use the Uninstall-SPSolution and Remove-SPSolution cmdlets:
1
Uninstall-SPUserSolution –Identity MySharePointSolution.wsp –Site http://webapplication/sitecollection
2
Remove-SPUserSolution –Identity MySharePointSolution.wsp –Site http://webapplication/sitecollection
To get a list of all of the powershell cmdlets that deal with solutions use:
1
Get-Command –noun *SPSolution*
To run all of the Administrative jobs that are queued:
1
Start-SPAdminJob
So that’s it, next time let’s looks at some basic feature powershell cmdlets as well
Search This Blog
Wednesday, December 21, 2011
Working with Solutions
Working with Solutions
In the ‘old’ days (let us not forget that the stsadm is still there and we have a lot of SharePoint 2007 installations across the globe), the following stsadm command could be used to add a SharePoint solution to SharePoint:
stsadm –o addsolution –filename “D:\Deploy\MySharePointSolution.wsp“
We used the following command to deploy the solution once installed to a specific web application:
stsadm –o deploysolution –name MySharePointSolution.wsp –url http://myspwebappp –allowgacdeployment –immediate
If we would upgrade an existing solution, we would use the following:
stsadm –o upgradesolution –name MySharePointSolution.wsp –filename “D:\Deploy\MySharePointSolution.wsp” -immediate
And finally, we used the following commands to retract and delete a specific solution from the web application:
stsadm –o retractsolution –name MySharePointSolution.wsp –url http://myspwebapp –immediate
stsadm –o deletesolution –name MySharePointSolution.wsp
Now, let us see how we could do above operations with PowerShell. For this, we use the following PowerShell commands:
Add-SPSolution “D:\Deploy\MySharePointSolution.wsp“
Install-SPSolution –Identity MySharePointSolution.wsp –WebApplication http://myspwebapp –GACDeployment
If you would like to add the solution as sandboxed, you would use the Install-SPUserSolution command instead. To upgrade a solution, we specify which solution is to be updated and with which new solution file:
Update-SPSolution –Identity MySharePointSolution.wsp –LiteralPath “D:\Deploy\MySharePointSolution.wsp” –GacDeployment
To retract and remove a solution, we use the following commands:
Uninstall-SPSolution –Identity MySharePointSolution.wsp –WebApplication http://myspwebapp
Remove-SPSolution–Identity MySharePointSolution.wsp
Working with features
Similarly, commands exist for working with features. The stsadm equivalents:
stsadm –o activatefeature –name MyFeatureName –url http://myspwebapp
stsadm –o deactivatefeature –name MyFeatureName –url http://myspwebapp
Needless to say, there are easy equivalents in PowerShell:
Enable-SPFeature –Identity MyFeatureNameOrGuid –url http://myspwebapp
Disable-SPFeature –Identity MyFeatureNameOrGuid –url http://myspwebapp
As you can see, PowerShell will completely replace stsadm as the administrative command line tool for SharePoint. Better to start using it as the next version of SharePoint will not have a stsadm command line tool I suspect. To conclude, let us take a look at a script that enables a certain feature across all site collections and sites in a farm. As an example, I have taken the SharePoint Server Enterprise Site Features feature with ID 0806d127-06e6-447a-980e-2e90b03101b8.
Add-PSSnapin Microsoft.SharePoint.PowerShell
$WebApplications = Get-SPWebApplication
foreach ($webapp in $WebApplications) {
$Id = $webapp.Id
Write-Host “Processing web application $Id …”
$sites = $webapp.Sites
foreach ($site in $sites) {
Write-Host Processing site $site.Id
$webs = $site.AllWebs
foreach ($web in $webs) {
Write-Host Processing web $web.Title
if ($web.Features["0806d127-06e6-447a-980e-2e90b03101b8"] -eq $null) {
Enable-SPFeature -Identity 0806d127-06e6-447a-980e-2e90b03101b8 -url $web.Url -Confirm:$false
} else {
Disable-SPFeature -Identity 0806d127-06e6-447a-980e-2e90b03101b8 -url $web.Url -Confirm:$false
}
}
}
}
Please note though that above script will work for small site collections. But for larger object hierarchies, you will need to include proper memory management (SPAssignment) to ensure proper release of memory.
===================================================
Note:
The STSADM command line application worked well with previous versions of SharePoint. But the world is progressing and PowerShell will be the new administrative tool for SharePoint. In previous articles, I already showed some amazing powerful scripts that otherwise would require more lines of code. PowerShell offers some great advantages in large farms, as they can be run remotely on target machines, can be signed and therefore be controlled. Building up a repository of scripts or cmdlets to execute common tasks would be worthwhile in the long run.
First off an important thing to note here that this will only work with SharePoint 2010. There are no PowerShell snapins available for 2007, although you could create your own off course. And when run from a SharePoint 2010 Management Shell, the snapins are loaded automatically. But what if you just use the ‘normal’ console? Well, then you would have to register the snapin yourself. Fortunately, MS has already created the PowerShell script that is needed, located at:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Config\PowerShell\Registration\SharePoint.ps1.
You could include this script in your scripts to be run first, or just include the command that registers the snapin:
Add-PSSnapin Microsoft.SharePoint.PowerShell
This article covers one of the most basic tasks one would do when administrating SharePoint: Deploy SharePoint solutions (WSP) and enable/disable features.
http://myspexp.com/category/sharepoint-or-custom-development/
http://myspexp.com/category/sharepoint-or-custom-development/
Deploying a WSP solution to SharePoint 2010
Set up your path in your environmental table…
SET PATH=%PATH%;C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\BIN
Locate Your DEBUG or RELEASE folder
CD\DEPLOY
Add your solution
stsadm -o addsolution -filename YESPrep_Redirection.wsp
Deploy your solution
stsadm -o deploysolution -name YESPrep_Redirection.wsp -url http://nav-test.yesprep.local -allowgacdeployment -immediate
pause
——————
To Remove it before deploying another solution follow the steps below:
Set up your path in your environmental table…
SET PATH=%PATH%;C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\BIN
Locate Your DEBUG or RELEASE folder
CD\DEPLOY
Remove your solution
stsadm -o retractsolution -name YESPrep_Redirection.wsp -URL http://cssp02-staging -immediate
Remove your solution
stsadm -o deletesolution -name YESPrep_Redirection.wsp
Lastly make sure that you add the web part into the gallery (upload the *.webpart file)
Using PowerShell to deploy SharePoint Solutions (WSP)
Using PowerShell to deploy SharePoint Solutions (WSP)
Posted by Patrick Boom on May 31, 2010
The STSADM command line application worked well with previous versions of SharePoint. But the world is progressing and PowerShell will be the new administrative tool for SharePoint. In previous articles, I already showed some amazing powerful scripts that otherwise would require more lines of code. PowerShell offers some great advantages in large farms, as they can be run remotely on target machines, can be signed and therefore be controlled. Building up a repository of scripts or cmdlets to execute common tasks would be worthwhile in the long run.
First off an important thing to note here that this will only work with SharePoint 2010. There are no PowerShell snapins available for 2007, although you could create your own off course. And when run from a SharePoint 2010 Management Shell, the snapins are loaded automatically. But what if you just use the ‘normal’ console? Well, then you would have to register the snapin yourself. Fortunately, MS has already created the PowerShell script that is needed, located at:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Config\PowerShell\Registration\SharePoint.ps1.
You could include this script in your scripts to be run first, or just include the command that registers the snapin:
Add-PSSnapin Microsoft.SharePoint.PowerShell
This article covers one of the most basic tasks one would do when administrating SharePoint: Deploy SharePoint solutions (WSP) and enable/disable features.
Working with Solutions
In the ‘old’ days (let us not forget that the stsadm is still there and we have a lot of SharePoint 2007 installations across the globe), the following stsadm command could be used to add a SharePoint solution to SharePoint:
stsadm –o addsolution –filename “D:\Deploy\MySharePointSolution.wsp“
We used the following command to deploy the solution once installed to a specific web application:
stsadm –o deploysolution –name MySharePointSolution.wsp –url http://myspwebappp –allowgacdeployment –immediate
If we would upgrade an existing solution, we would use the following:
stsadm –o upgradesolution –name MySharePointSolution.wsp –filename “D:\Deploy\MySharePointSolution.wsp” -immediate
And finally, we used the following commands to retract and delete a specific solution from the web application:
stsadm –o retractsolution –name MySharePointSolution.wsp –url http://myspwebapp –immediate
stsadm –o deletesolution –name MySharePointSolution.wsp
Now, let us see how we could do above operations with PowerShell. For this, we use the following PowerShell commands:
Add-SPSolution “D:\Deploy\MySharePointSolution.wsp“
Install-SPSolution –Identity MySharePointSolution.wsp –WebApplication http://myspwebapp –GACDeployment
If you would like to add the solution as sandboxed, you would use the Install-SPUserSolution command instead. To upgrade a solution, we specify which solution is to be updated and with which new solution file:
Update-SPSolution –Identity MySharePointSolution.wsp –LiteralPath “D:\Deploy\MySharePointSolution.wsp” –GacDeployment
To retract and remove a solution, we use the following commands:
Uninstall-SPSolution –Identity MySharePointSolution.wsp –WebApplication http://myspwebapp
Remove-SPSolution–Identity MySharePointSolution.wsp
Working with features
Similarly, commands exist for working with features. The stsadm equivalents:
stsadm –o activatefeature –name MyFeatureName –url http://myspwebapp
stsadm –o deactivatefeature –name MyFeatureName –url http://myspwebapp
Needless to say, there are easy equivalents in PowerShell:
Enable-SPFeature –Identity MyFeatureNameOrGuid –url http://myspwebapp
Disable-SPFeature –Identity MyFeatureNameOrGuid –url http://myspwebapp
As you can see, PowerShell will completely replace stsadm as the administrative command line tool for SharePoint. Better to start using it as the next version of SharePoint will not have a stsadm command line tool I suspect. To conclude, let us take a look at a script that enables a certain feature across all site collections and sites in a farm. As an example, I have taken the SharePoint Server Enterprise Site Features feature with ID 0806d127-06e6-447a-980e-2e90b03101b8.
Add-PSSnapin Microsoft.SharePoint.PowerShell
$WebApplications = Get-SPWebApplication
foreach ($webapp in $WebApplications) {
$Id = $webapp.Id
Write-Host “Processing web application $Id …”
$sites = $webapp.Sites
foreach ($site in $sites) {
Write-Host Processing site $site.Id
$webs = $site.AllWebs
foreach ($web in $webs) {
Write-Host Processing web $web.Title
if ($web.Features["0806d127-06e6-447a-980e-2e90b03101b8"] -eq $null) {
Enable-SPFeature -Identity 0806d127-06e6-447a-980e-2e90b03101b8 -url $web.Url -Confirm:$false
} else {
Disable-SPFeature -Identity 0806d127-06e6-447a-980e-2e90b03101b8 -url $web.Url -Confirm:$false
}
}
}
}
Please note though that above script will work for small site collections. But for larger object hierarchies, you will need to include proper memory management (SPAssignment) to ensure proper release of memory.
As always, have fun coding.
How To – Deploy a SharePoint 2010 Visual Web Part
How To – Deploy a SharePoint 2010 Visual Web Part
Build the solution from Visual Studio 2010.
Package the solution.
Go to the Build menu and select Package.
Deploy solution to SharePoint server.
Browse to the directory which contains your webpart.wsp file. Copy this file to a local directory on the SharePoint server.
Log on to the SharePoint server and open the SharePoint 2010 Mangement Shell.
Run the following command: Add-SPSolution –LiteralPath .
Deploy solution to your SharePoint site.
Open SharePoint 2010 Central Administration
Browse to System Settings -> Manage farm solutions.
Click your webpart.wsp.
Click Deploy Solution.
Select the appropriate options and click OK.
Add the solution to the Web Part Gallery.
Browse to http://Server/_layouts/newdwp.aspx.
Select the checkbox next to your solution.
Click Populate Gallery.
Your web part should now show in the Gallery and be available for use on site pages.
Friday, October 21, 2011
Installing Active Directory on Windows Server 2008
Installing Active Directory on Windows Server 2008
by Daniel Petri - January 8, 2009
Printer Friendly Version
Microsoft Active Directory provides the structure to centralize the network management and store information about network resources across the entire domain. Active Directory uses Domain Controllers to keep this centralized storage available to network users. In order to configure a Windows Server 2008 machine to act as Domain Controller, several considerations and prerequisites should be taken into account, and several steps should be performed. In this article I will guide you through these prerequisites and steps of creating a new Windows Server 2008 Domain Controller for a new Active Directory domain in a new forest.
Monitor VMware with Microsoft System Center
Find out how you can get scalable, fault tolerant and agentless VMware monitoring directly in System Center with the Veeam nworks Management Pack™.
• Protect your investments in Microsoft System Center
• Manage physical and virtual from one console
• Eliminate the costs of an additional monitoring framework
Learn more about the nworks Management Pack™ here
Considerations when Installing a new Windows Server 2008 forest
When you install AD to create the first domain controller in a new Windows Server 2008 forest, you must keep the following considerations in mind:
* You must make forest and domain functional level decisions that determine whether your forest and domain can contain domain controllers that run Windows 2000 Server, Windows Server 2003, or both. To read more about forest and domain functional levels please refer to the links below.
* Domain controllers running the Microsoft Windows NT Server 4.0 operating system are NOT supported with Windows Server 2008.
* Servers running Windows NT Server 4.0 are NOT supported by domain controllers that are running Windows Server 2008, meaning you MUST have additional DCs running Windows 2000/2003 to support older NT 4.0 servers.
* The first Windows Server 2008 domain controller in a forest must be a global catalog server and it cannot be an RODC.
Considerations when Installing a new Windows Server 2008 domain in an existing Windows 2000/2003 forest
When you install AD to create the first domain controller in a new Windows Server 2008 domain, you must keep the following considerations in mind:
* Before you create a new Windows Server 2008 domain in a Windows 2000/2003 forest, you must prepare the forest for Windows Server 2008 by extending the schema (that is, by running ADPREP /forestprep). To read more about ADPREP please refer to the links below or my "Windows Server 2008 ADPREP" article.
* You must make domain functional level decisions that determine whether your domain can contain domain controllers that run Windows 2000 Server, Windows Server 2003, or both. To read more about forest and domain functional levels please refer to the links below.
* I recommend that you host the PDC emulator operations master role in the forest root domain on a domain controller that runs Windows Server 2008. For more information about FSMO Roles, please read my "Understanding FSMO Roles in Active Directory" and "Transferring FSMO Roles" articles.
General considerations
Make sure you read and follow the requirements described in my "Active Directory on Windows Server 2008 Requirements" article.
Installing Active Directory Domain Services (AD-DS)
In Windows Server 2008, unlike previous server operating Systems, there is an additional step that needs to be taken before running DCPROMO to promote the server to Domain Controller and installing Active Directory on it. This step is the installation of Active Directory Domain Services (AD-DS) role on the server. In fact, the AD-DS role is what enables the server to act as a Domain Controller, but you will still need to run DCPROMO the regular way.
AD-DS can be installed in one of 3 methods:
Method 1 – Server Manager/Initial Configuration Tasks
Roles can and should be added from Server Manager (but they can also be initiated from the Initial Configuration Tasks wizard that auto-opens the first time you log on to the server).
1. Open Server Manager by clicking the icon in the Quick Launch toolbar, or from the Administrative Tools folder.
2. Wait till it finishes loading, then click on Roles > Add Roles link.
3. In the Before you begin window, click Next.
4. In the Select Server Roles window, click to select Active Directory Domain Services, and then click Next.
5. In the Active Directory Domain Services window read the provided information if you want to, and then click Next.
6. In the Confirm Installation Selections, read the provided information if you want to, and then click Next.
7. Wait till the process completes.
8. When it ends, click Close.
9. Going back to Server Manager, click on the Active Directory Domain Services link, and note that there's no information linked to it, because the DCPROMO command has not been run yet.
10. Now you can click on the DCPROMO link, or read on.
1. To run DCPROMO, enter the command in the Run command, or click on the DCPROMO link from Server Manager > Roles > Active Directory Domain Services.
2. Depending upon the question if AD-DS was previously installed or not, the Active Directory Domain Services Installation Wizard will appear immediately or after a short while. Click Next.
Note: The Advanced features of DCPROMO will be discussed in a future article.
Also see » Active
3. In the Operating System Compatibility window, read the provided information and click Next.
4. In the Choosing Deployment Configuration window, click on "Create a new domain in a new forest" and click Next.
5. Enter an appropriate name for the new domain. Make sure you pick the right domain name, as renaming domains is a task you will not wish to perform on a daily basis. Click Next.
Note: Do NOT use single label domain names such as "mydomain" or similar. You MUST pick a full domain name such as "mydomain.local" or "mydomain.com" and so on.
The wizard will perform checks to see if the domain name is not already in use on the local network.
6. Pick the right forest function level. Windows 2000 mode is the default, and it allows the addition of Windows 2000, Windows Server 2003 and Windows Server 2008 Domain Controllers to the forest you're creating. Read my "Understanding Windows Server 2008 Active Directory Domain and Forest Functional Levels" article for more information on that.
7. Pick the right domain function level. Windows 2000 Native mode is the default, and it allows the addition of Windows 2000, Windows Server 2003 and Windows Server 2008 Domain Controllers to the domain you're creating.
Note: If you select "Windows Server 2008" for the forest function level, you will Not be prompted to pick a domain function level. Read more about domain and forest function levels on my "Understanding Windows Server 2008 Active Directory Domain and Forest Functional Levels" article.
8. The wizard will perform checks to see if DNS is properly configured on the local network. In this case, no DNS server has been configured, therefore, the wizard will offer to automatically install DNS on this server.
Note: The first DCs must also be a Global Catalog. Also, the first DCs in a forest cannot be a Read Only Domain controller.
9. It's most likely that you'll get a warning telling you that the server has one or more dynamic IP Addresses. Running IPCONFIG /all will show that this is not the case, because as you can clearly see, I have given the server a static IP Address. So, where did this come from? The answer is IPv6. I did not manually configure the IPv6 Address, hence the warning. In a network where IPv6 is not used, you can safely ignore this warning.
10. You'll probably get a warning about DNS delegation. Since no DNS has been configured yet, you can ignore the message and click Yes.
11. Next, change the paths for the AD database, log files and SYSVOL folder. For large deployments, carefully plan your DC configuration to get the maximum performance. When satisfied, click Next.
12. Enter the password for the Active Directory Recovery Mode. This password must be kept confidential, and because it stays constant while regular domain user passwords expire (based upon the password policy configured for the domain, the default is 42 days), it does not. This password should be complex and at least 7 characters long. I strongly suggest that you do NOT use the regular administrator's password, and that you write it down and securely store it. Click Next.
13. In the Summary window review your selections, and if required, save them to an unattend answer file. When satisfied, click Next.
14. The wizard will begin creating the Active Directory domain, and when finished, you will need to press Finish and reboot your computer.
Note: You can automate the rebooting process by checking the Reboot on Completion checkbox.
To automate domain controller installations, you can use an answer file or you can specify unattended installation parameters at the command line. More on that in my "Creating an Unattend Installation File for DCPROMO in Windows Server 2008" article.
Note: As written in my "Installing Active Directory on Windows 2008 Server Core" article, configuring a Windows Server 2008 Server Core machine REQUIRES you to perform an automated installation of Active Directory on that server, as there is NOT DCPROMO GUI on Server Core.
Your server now acts as a Domain Controller. Make sure you properly back it up. You can test functionality by using AD management tools such as Active Directory Users and Computers, examine the Event Logs, services and folders and shares that have been created.
Links
AD DS Installation and Removal Step-by-Step Guide
Method 2 – Servermanagercmd.exe
Servermanagercmd.exe is the command prompt equivalent of the Add Roles and Add Features wizards in Server Manager. Through the use of various command line options, you can quickly and easily add or remove features and roles to or from your server, including the AD-DS role.
To install AD-DS by using Servermanagercmd.exe, simply enter the following command in the Command Prompt window:
Servermanagercmd.exe –I ADDS-Domain-Controller
Let the command run and when it finishes, AD-DS will be installed on the server.
Method 3 – Letting DCPROMO do the job
Oh yes. If you forget to install AD-DS or simply want to skip clicking on some windows, you can run DCPROMO from the Run command and before it is executed, the server will check to see if the AD-DS binaries are installed. Since they are not, they will auto-install.
After you complete the Add Roles Wizard, either click the link to start the Active Directory Domain Services Installation Wizard, or close Server Manager and manually run DCPROMO from the Run command.
Running DCPROMO
After installing the AD-DS role, we need to run DCPROMO to perform the actual Active Directory database and function installation.
Note: This guide assumes this is the first Domain controller in the forest, thus creating a new domain in a new forest. For a guide on how to add additional Domain Controllers to existing domains, please read my upcoming "Installing Additional Windows Server 2008 Domain Controllers in your Existing Active Directory Domain" article.
by Daniel Petri - January 8, 2009
Printer Friendly Version
Microsoft Active Directory provides the structure to centralize the network management and store information about network resources across the entire domain. Active Directory uses Domain Controllers to keep this centralized storage available to network users. In order to configure a Windows Server 2008 machine to act as Domain Controller, several considerations and prerequisites should be taken into account, and several steps should be performed. In this article I will guide you through these prerequisites and steps of creating a new Windows Server 2008 Domain Controller for a new Active Directory domain in a new forest.
Monitor VMware with Microsoft System Center
Find out how you can get scalable, fault tolerant and agentless VMware monitoring directly in System Center with the Veeam nworks Management Pack™.
• Protect your investments in Microsoft System Center
• Manage physical and virtual from one console
• Eliminate the costs of an additional monitoring framework
Learn more about the nworks Management Pack™ here
Considerations when Installing a new Windows Server 2008 forest
When you install AD to create the first domain controller in a new Windows Server 2008 forest, you must keep the following considerations in mind:
* You must make forest and domain functional level decisions that determine whether your forest and domain can contain domain controllers that run Windows 2000 Server, Windows Server 2003, or both. To read more about forest and domain functional levels please refer to the links below.
* Domain controllers running the Microsoft Windows NT Server 4.0 operating system are NOT supported with Windows Server 2008.
* Servers running Windows NT Server 4.0 are NOT supported by domain controllers that are running Windows Server 2008, meaning you MUST have additional DCs running Windows 2000/2003 to support older NT 4.0 servers.
* The first Windows Server 2008 domain controller in a forest must be a global catalog server and it cannot be an RODC.
Considerations when Installing a new Windows Server 2008 domain in an existing Windows 2000/2003 forest
When you install AD to create the first domain controller in a new Windows Server 2008 domain, you must keep the following considerations in mind:
* Before you create a new Windows Server 2008 domain in a Windows 2000/2003 forest, you must prepare the forest for Windows Server 2008 by extending the schema (that is, by running ADPREP /forestprep). To read more about ADPREP please refer to the links below or my "Windows Server 2008 ADPREP" article.
* You must make domain functional level decisions that determine whether your domain can contain domain controllers that run Windows 2000 Server, Windows Server 2003, or both. To read more about forest and domain functional levels please refer to the links below.
* I recommend that you host the PDC emulator operations master role in the forest root domain on a domain controller that runs Windows Server 2008. For more information about FSMO Roles, please read my "Understanding FSMO Roles in Active Directory" and "Transferring FSMO Roles" articles.
General considerations
Make sure you read and follow the requirements described in my "Active Directory on Windows Server 2008 Requirements" article.
Installing Active Directory Domain Services (AD-DS)
In Windows Server 2008, unlike previous server operating Systems, there is an additional step that needs to be taken before running DCPROMO to promote the server to Domain Controller and installing Active Directory on it. This step is the installation of Active Directory Domain Services (AD-DS) role on the server. In fact, the AD-DS role is what enables the server to act as a Domain Controller, but you will still need to run DCPROMO the regular way.
AD-DS can be installed in one of 3 methods:
Method 1 – Server Manager/Initial Configuration Tasks
Roles can and should be added from Server Manager (but they can also be initiated from the Initial Configuration Tasks wizard that auto-opens the first time you log on to the server).
1. Open Server Manager by clicking the icon in the Quick Launch toolbar, or from the Administrative Tools folder.
2. Wait till it finishes loading, then click on Roles > Add Roles link.
3. In the Before you begin window, click Next.
4. In the Select Server Roles window, click to select Active Directory Domain Services, and then click Next.
5. In the Active Directory Domain Services window read the provided information if you want to, and then click Next.
6. In the Confirm Installation Selections, read the provided information if you want to, and then click Next.
7. Wait till the process completes.
8. When it ends, click Close.
9. Going back to Server Manager, click on the Active Directory Domain Services link, and note that there's no information linked to it, because the DCPROMO command has not been run yet.
10. Now you can click on the DCPROMO link, or read on.
1. To run DCPROMO, enter the command in the Run command, or click on the DCPROMO link from Server Manager > Roles > Active Directory Domain Services.
2. Depending upon the question if AD-DS was previously installed or not, the Active Directory Domain Services Installation Wizard will appear immediately or after a short while. Click Next.
Note: The Advanced features of DCPROMO will be discussed in a future article.
Also see » Active
3. In the Operating System Compatibility window, read the provided information and click Next.
4. In the Choosing Deployment Configuration window, click on "Create a new domain in a new forest" and click Next.
5. Enter an appropriate name for the new domain. Make sure you pick the right domain name, as renaming domains is a task you will not wish to perform on a daily basis. Click Next.
Note: Do NOT use single label domain names such as "mydomain" or similar. You MUST pick a full domain name such as "mydomain.local" or "mydomain.com" and so on.
The wizard will perform checks to see if the domain name is not already in use on the local network.
6. Pick the right forest function level. Windows 2000 mode is the default, and it allows the addition of Windows 2000, Windows Server 2003 and Windows Server 2008 Domain Controllers to the forest you're creating. Read my "Understanding Windows Server 2008 Active Directory Domain and Forest Functional Levels" article for more information on that.
7. Pick the right domain function level. Windows 2000 Native mode is the default, and it allows the addition of Windows 2000, Windows Server 2003 and Windows Server 2008 Domain Controllers to the domain you're creating.
Note: If you select "Windows Server 2008" for the forest function level, you will Not be prompted to pick a domain function level. Read more about domain and forest function levels on my "Understanding Windows Server 2008 Active Directory Domain and Forest Functional Levels" article.
8. The wizard will perform checks to see if DNS is properly configured on the local network. In this case, no DNS server has been configured, therefore, the wizard will offer to automatically install DNS on this server.
Note: The first DCs must also be a Global Catalog. Also, the first DCs in a forest cannot be a Read Only Domain controller.
9. It's most likely that you'll get a warning telling you that the server has one or more dynamic IP Addresses. Running IPCONFIG /all will show that this is not the case, because as you can clearly see, I have given the server a static IP Address. So, where did this come from? The answer is IPv6. I did not manually configure the IPv6 Address, hence the warning. In a network where IPv6 is not used, you can safely ignore this warning.
10. You'll probably get a warning about DNS delegation. Since no DNS has been configured yet, you can ignore the message and click Yes.
11. Next, change the paths for the AD database, log files and SYSVOL folder. For large deployments, carefully plan your DC configuration to get the maximum performance. When satisfied, click Next.
12. Enter the password for the Active Directory Recovery Mode. This password must be kept confidential, and because it stays constant while regular domain user passwords expire (based upon the password policy configured for the domain, the default is 42 days), it does not. This password should be complex and at least 7 characters long. I strongly suggest that you do NOT use the regular administrator's password, and that you write it down and securely store it. Click Next.
13. In the Summary window review your selections, and if required, save them to an unattend answer file. When satisfied, click Next.
14. The wizard will begin creating the Active Directory domain, and when finished, you will need to press Finish and reboot your computer.
Note: You can automate the rebooting process by checking the Reboot on Completion checkbox.
To automate domain controller installations, you can use an answer file or you can specify unattended installation parameters at the command line. More on that in my "Creating an Unattend Installation File for DCPROMO in Windows Server 2008" article.
Note: As written in my "Installing Active Directory on Windows 2008 Server Core" article, configuring a Windows Server 2008 Server Core machine REQUIRES you to perform an automated installation of Active Directory on that server, as there is NOT DCPROMO GUI on Server Core.
Your server now acts as a Domain Controller. Make sure you properly back it up. You can test functionality by using AD management tools such as Active Directory Users and Computers, examine the Event Logs, services and folders and shares that have been created.
Links
AD DS Installation and Removal Step-by-Step Guide
Method 2 – Servermanagercmd.exe
Servermanagercmd.exe is the command prompt equivalent of the Add Roles and Add Features wizards in Server Manager. Through the use of various command line options, you can quickly and easily add or remove features and roles to or from your server, including the AD-DS role.
To install AD-DS by using Servermanagercmd.exe, simply enter the following command in the Command Prompt window:
Servermanagercmd.exe –I ADDS-Domain-Controller
Let the command run and when it finishes, AD-DS will be installed on the server.
Method 3 – Letting DCPROMO do the job
Oh yes. If you forget to install AD-DS or simply want to skip clicking on some windows, you can run DCPROMO from the Run command and before it is executed, the server will check to see if the AD-DS binaries are installed. Since they are not, they will auto-install.
After you complete the Add Roles Wizard, either click the link to start the Active Directory Domain Services Installation Wizard, or close Server Manager and manually run DCPROMO from the Run command.
Running DCPROMO
After installing the AD-DS role, we need to run DCPROMO to perform the actual Active Directory database and function installation.
Note: This guide assumes this is the first Domain controller in the forest, thus creating a new domain in a new forest. For a guide on how to add additional Domain Controllers to existing domains, please read my upcoming "Installing Additional Windows Server 2008 Domain Controllers in your Existing Active Directory Domain" article.
Imp Keys
Microsoft SharePoint Server 2010 Enterprise Standard Product Key
Posted on | June 14, 2011 | 2 Comments
Office Professional Plus 2010 Product Key:
6QFDX-PYH2G-PPYFD-C7RJM-BBKQ8
BDD3G-XM7FB-BD2HM-YK63V-VQFDK
Office Professional Plus 2010 (VL)Product Key
MKCGC-FBXRX-BMJX6-F3Q8C-2QC6P
VYBBJ-TRJPB-QFQRF-QFT4D-H3GVB
SharePoint Server 2010 Enterprise Product Key
6VCWT-QBQVD-HG7KD-8BW8C-PBX7T
SharePoint Server 2010 Standard Product Key
HQ937-PP69X-8K3KR-VYY2F-RPHB3
windows server 2008 r2
Standard:2T88R-MBH2C-M7V97-9HVDW-VXTGF
Enterpirse:TFGPQ-J9267-T3R9G-99P7B-HXG47
Datacenter:GQJJW-4RPC9-VGW22-6VTKV-7MCC6
Web:GT8BY-FRKHB-7PB8W-GQ7YF-3DXJ6
:CQ936-9K2T8-6GPRX-3JR9T-JF4CJ
Developer: PTTFM-X467G-P7RH2-3Q6CG-4DMYB
Posted on | June 14, 2011 | 2 Comments
Office Professional Plus 2010 Product Key:
6QFDX-PYH2G-PPYFD-C7RJM-BBKQ8
BDD3G-XM7FB-BD2HM-YK63V-VQFDK
Office Professional Plus 2010 (VL)Product Key
MKCGC-FBXRX-BMJX6-F3Q8C-2QC6P
VYBBJ-TRJPB-QFQRF-QFT4D-H3GVB
SharePoint Server 2010 Enterprise Product Key
6VCWT-QBQVD-HG7KD-8BW8C-PBX7T
SharePoint Server 2010 Standard Product Key
HQ937-PP69X-8K3KR-VYY2F-RPHB3
windows server 2008 r2
Standard:2T88R-MBH2C-M7V97-9HVDW-VXTGF
Enterpirse:TFGPQ-J9267-T3R9G-99P7B-HXG47
Datacenter:GQJJW-4RPC9-VGW22-6VTKV-7MCC6
Web:GT8BY-FRKHB-7PB8W-GQ7YF-3DXJ6
:CQ936-9K2T8-6GPRX-3JR9T-JF4CJ
Developer: PTTFM-X467G-P7RH2-3Q6CG-4DMYB
Saturday, February 12, 2011
return unique values for your distinct columns and will the first (min) value of your non distinct columns
--SP_VTMS_TL_CW_UPDATE '20110210','20110212',null,'TL1'
--SP_VTMS_TL_CW_UPDATE NULL,NULL,NULL,'TL1'
alter proc [SP_VTMS_TL_CW_UPDATE]
@fromdt varchar(12)=NULL,
@todt varchar(12)=NULL,
@empid varchar(12)=NULL,
@TL varchar(50)
as
begin
declare
@fromdate datetime,
@todate datetime,
@wkstartdate datetime,
@wkenddate datetime,
@nkwkstartdate datetime,
@nkwkenddate datetime,
@cntr int ,
@count int,
@count1 int,
@count2 int
if (@fromdt IS NULL)
set @fromdt = CONVERT(VARCHAR(18),GETDATE(),102)
if (@todt IS NULL)
set @todt = CONVERT(VARCHAR(18),GETDATE(),102)
print cast(@fromdt as varchar) +'suresh1'
print cast(@todt as varchar) +'suresh'
/*---------------------------Current Week*-----------------------------------------*/
--set @wkstartdate = convert(varchar(18),(select DATEADD(DD, 1 - DATEPART(DW, getdate()),getdate())) ,102)
--set @wkenddate = convert(varchar(18),(select DATEADD(DD, 1 - DATEPART(DW, getdate()),getdate())+6) ,102)
select vh.TranID,vh.empid,vh.empname,'PADAGA' as project_name,vh.process,ve.team,vh.teamLead,
convert(varchar(12),vh.time_in,108)Time_IN,convert(varchar(12),vh.time_out,108)Time_OUT ,
convert(varchar(12),vh.fromdate,106)[Fromdate],convert(varchar(12),@todt,106)[ToDate],case vh.active_status when '1' then 'true' else 'false' end [Active_status]
from vtms_header vh inner join vtms_empregistration ve on vh.empid=ve.empid
where ((vh.fromdate >=convert(varchar(18),@fromdt,112) and vh.fromdate <=convert(varchar(18),@todt,112))) and vh.empid like '%'+ coalesce (@empid,'') +'%' and ve.registered=1 and vh.tranid IN (SELECT Min(x.tranid) FROM vtms_header x where x.fromdate >=convert(varchar(18),@fromdt,112)
and x.fromdate <=convert(varchar(18),@todt,112) GROUP by x.empid,x.empname,x.process,x.teamLead,x.time_in,x.time_out) order by cast(vh.empid as int),vh.fromdate -- --select vh.TranID,ve.empid,ve.empname,'PADAGA' as project_name,ve.process,ve.team,ve.teamLead, --convert(varchar(12),vh.time_in,108)Time_IN,convert(varchar(12),vh.time_out,108)Time_OUT, --convert(varchar(12),vh.fromdate,106)[Fromdate],convert(varchar(12),@todt,106)[ToDate],case vh.active_status when '1' then 'true' else 'false' end [Active_status] --from vtms_header vh inner join vtms_empregistration ve on vh.empid=ve.empid --where ((vh.fromdate >=convert(varchar(18),@fromdt,112) and vh.fromdate <=convert(varchar(18),@todt,112)))
--and ve.empid like '%'+ coalesce (@empid,'') +'%'
--and ve.registered=1
--order by cast(ve.empid as int),vh.fromdate
end
--SP_VTMS_TL_CW_UPDATE NULL,NULL,NULL,'TL1'
alter proc [SP_VTMS_TL_CW_UPDATE]
@fromdt varchar(12)=NULL,
@todt varchar(12)=NULL,
@empid varchar(12)=NULL,
@TL varchar(50)
as
begin
declare
@fromdate datetime,
@todate datetime,
@wkstartdate datetime,
@wkenddate datetime,
@nkwkstartdate datetime,
@nkwkenddate datetime,
@cntr int ,
@count int,
@count1 int,
@count2 int
if (@fromdt IS NULL)
set @fromdt = CONVERT(VARCHAR(18),GETDATE(),102)
if (@todt IS NULL)
set @todt = CONVERT(VARCHAR(18),GETDATE(),102)
print cast(@fromdt as varchar) +'suresh1'
print cast(@todt as varchar) +'suresh'
/*---------------------------Current Week*-----------------------------------------*/
--set @wkstartdate = convert(varchar(18),(select DATEADD(DD, 1 - DATEPART(DW, getdate()),getdate())) ,102)
--set @wkenddate = convert(varchar(18),(select DATEADD(DD, 1 - DATEPART(DW, getdate()),getdate())+6) ,102)
select vh.TranID,vh.empid,vh.empname,'PADAGA' as project_name,vh.process,ve.team,vh.teamLead,
convert(varchar(12),vh.time_in,108)Time_IN,convert(varchar(12),vh.time_out,108)Time_OUT ,
convert(varchar(12),vh.fromdate,106)[Fromdate],convert(varchar(12),@todt,106)[ToDate],case vh.active_status when '1' then 'true' else 'false' end [Active_status]
from vtms_header vh inner join vtms_empregistration ve on vh.empid=ve.empid
where ((vh.fromdate >=convert(varchar(18),@fromdt,112) and vh.fromdate <=convert(varchar(18),@todt,112))) and vh.empid like '%'+ coalesce (@empid,'') +'%' and ve.registered=1 and vh.tranid IN (SELECT Min(x.tranid) FROM vtms_header x where x.fromdate >=convert(varchar(18),@fromdt,112)
and x.fromdate <=convert(varchar(18),@todt,112) GROUP by x.empid,x.empname,x.process,x.teamLead,x.time_in,x.time_out) order by cast(vh.empid as int),vh.fromdate -- --select vh.TranID,ve.empid,ve.empname,'PADAGA' as project_name,ve.process,ve.team,ve.teamLead, --convert(varchar(12),vh.time_in,108)Time_IN,convert(varchar(12),vh.time_out,108)Time_OUT, --convert(varchar(12),vh.fromdate,106)[Fromdate],convert(varchar(12),@todt,106)[ToDate],case vh.active_status when '1' then 'true' else 'false' end [Active_status] --from vtms_header vh inner join vtms_empregistration ve on vh.empid=ve.empid --where ((vh.fromdate >=convert(varchar(18),@fromdt,112) and vh.fromdate <=convert(varchar(18),@todt,112)))
--and ve.empid like '%'+ coalesce (@empid,'') +'%'
--and ve.registered=1
--order by cast(ve.empid as int),vh.fromdate
end
Tuesday, February 8, 2011
LIist all days between two days
WITH date_range (calc_date) AS (
SELECT DATEADD(DAY, DATEDIFF(DAY, 0, '20110101') , 0)
UNION ALL SELECT DATEADD(DAY, 1, calc_date)
FROM date_range
WHERE DATEADD(DAY, 1, calc_date) <= '20110103')
SELECT calc_date
FROM date_range;
SELECT DATEADD(DAY, DATEDIFF(DAY, 0, '20110101') , 0)
UNION ALL SELECT DATEADD(DAY, 1, calc_date)
FROM date_range
WHERE DATEADD(DAY, 1, calc_date) <= '20110103')
SELECT calc_date
FROM date_range;
Monday, January 10, 2011
Get min parent id or anciant id
--create table MenuItems(id int,parent_id int)
select *from menuitems
insert into menuitems values(1,null)
insert into menuitems values(2,null)
insert into menuitems values(3,2)
insert into menuitems values(4,3)
insert into menuitems values(5,4)
insert into menuitems values(6,3)
insert into menuitems values(7,6)
insert into menuitems values(8,7)
insert into menuitems values(9,5)
insert into menuitems values(10,1)
insert into menuitems values(11,10)
insert into menuitems values(12,11)
insert into menuitems values(13,12)
insert into menuitems values(14,13)
select *,dbo.getminparent(id) from menuitems
--select dbo.GetMinparent(12)
alter function GetMinparent(@id int)
returns int
begin
declare @pid int
set @pid=@id
while (@pid is not null)
begin
select @pid=parent_id from menuitems where id=@id
--print @pid
if(@pid is not null)
set @id=@pid
end
return @id
end
select *from menuitems
insert into menuitems values(1,null)
insert into menuitems values(2,null)
insert into menuitems values(3,2)
insert into menuitems values(4,3)
insert into menuitems values(5,4)
insert into menuitems values(6,3)
insert into menuitems values(7,6)
insert into menuitems values(8,7)
insert into menuitems values(9,5)
insert into menuitems values(10,1)
insert into menuitems values(11,10)
insert into menuitems values(12,11)
insert into menuitems values(13,12)
insert into menuitems values(14,13)
select *,dbo.getminparent(id) from menuitems
--select dbo.GetMinparent(12)
alter function GetMinparent(@id int)
returns int
begin
declare @pid int
set @pid=@id
while (@pid is not null)
begin
select @pid=parent_id from menuitems where id=@id
--print @pid
if(@pid is not null)
set @id=@pid
end
return @id
end
Subscribe to:
Posts (Atom)