Posts Tagged ‘Windows Server’
Once you have done a DCPROMO (promoting your server to a domain controller) on your server, Windows removes the ability to manage local administrators from the server, at least via the GUI interface. As you can see here in the following two screen shots, the “Local Users and Groups” GUI option which is normally available on a non domain controller server thus:
Is removed once the server is promoted to a domain controller thus:
How do we work around this issue then?
Bring out the good old administrative command line…
- Click through your Start menu and navigate to locate the “Command Prompt”.
- Right click the “Command Prompt” icon.
- On the popup menu, click “Run as administrator”.
In the admin window that opens, use the following syntax to add the target account to the local administrators group of the server:
net localgroup administrators /add <domain>\<user>
Where the <domain> value is the target domain and the <user> value is the target user e.g.
In the example above we added the DEV\SPADM account to the server’s local administrators group.
As we all know, SharePoint 2010 is still using the .NET Framework 3.5. That means that your servers may not have the latest .NET Framework 4.0 installed. This could cause some issues if you’re trying to use APIs from 4.0, or if you are trying to build some new tools using 4.0, like PowerShell management extensions for example. The solution is to install 4.0 on your server. Here’s the quick Step-by-Step for doing this on a Windows Server 2008 R2 x64 system with SharePoint 2010 installed.
- Begin by downloading the full version of the Framework from here:
- Once downloaded, double click the installer file named “dotnetFx40_Full_x86_x64.exe”.
- Windows may require you to confirm that you wish to launch the EXE. If it does, simply click “Run”.
- You’d have to accept the EULA. Check the “I have read and accept the license terms” check box.
- Click the “Install” button to commence the installation.
- The installer will crunch away for a while as it installs the Framework.
- Once installation complete, click the “Finish” button.
- No server restart is needed. 🙂
If you’ve ventured into the world of PowerShell extensions and modules, and more specifically, that world, targeted at SharePoint, then you have probably run into this error before.
Import-Module : Could not load file or assembly 'file:///C:\cjvandyk.SharePoint.PowerShell.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. At line:1 char:14+ import-module <<<< .\cjvandyk.SharePoint.PowerShell.dll + CategoryInfo: NotSpecified: (:) [Import-Module], BadImageFormatException + FullyQualifiedErrorId : System.BadImageFormatException,Microsoft.PowerShell.Commands.ImportModuleCommand
This error is thrown by PowerShell when you are using the Import-Module cmdlet to import a PowerShell module (redundant, isn’t it?) that was built using the .NET Framework 4.0. The ugly error looks like this:
If you’re trying to use that module on a SharePoint system, the odds are that the server does NOT have the 4.0 version of the Framework installed. You can easily confirm this by simply checking the sub folders under the C:\Windows\Microsoft.NET\Framework location.
In the above example, you can see that 1.0, 1.1, 2.0, 3.0, 3.5 and 4.0 are all installed on the server. If you find that 4.0 is NOT installed, you can quickly install it following this guide.
Once it’s installed you only have one more thing left to do. By default, PowerShell will run under the 2.0 Framework. We need to force it to default to the 4.0 Framework and only revert back to 2.0 if it doesn’t find what it’s looking for in 4.0.
That is easily done using a .config file for the PowerShell executable. Browse to the C:\Windows\System32\WindowsPowerShell\v1.0 location.
You may not have the two .config file on your system. If you don’t, you need to create them manually. Name the files exactly the same as the .exe files, but with a .config extension at the back. Create them as text files, but you will need to show extensions from your Folder Options in Windows Explorer in order to get rid of the .txt extension. The two config files should be named “PowerShell.exe.config” and “PowerShell_ise.exe.config”. The content of the two files is a simple XML snippet that simply points PowerShell to default to 4.0 and fallback to 2.0. Copy and paste the following snippet into the .config files.
Now when you restart PowerShell, attempting to load your module should yield no errors (if your module is compiled correctly and valid), and you should be able to implement the functionality from the module without any problem.
Here’s a quick list of the lastest Hyper-V Virtual Machines available for download from Microsoft. If you’re setting up a little private playground lab, this will save you tons of time and get you working out the latest and greatest software in a flash.Start by grabbing the latest IW VM loaded with Office and SharePoint 2010 goodness: