July 11th, 2009
Here we go again! Last time, we covered how to get a relatively accurate list of installed programs with PowerShell. This time around, we’re going to show you how to get a list of Windows Components and their installation states with PowerShell. Let’s begin by showing you the finished product, as a function. Then, we’ll cover how it works, piece by piece.
function Get-InstalledComponents($computer = '.') {
$components_installed = @();
$reg_paths = @('SOFTWARE\Microsoft\Windows\CurrentVersion'`
+ '\Setup\Oc Manager\Subcomponents');
$reg_paths += @('SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion'`
+ '\Setup\Oc Manager\Subcomponents');
$hkey = 'LocalMachine';
$reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey($hkey, $computer);
foreach ($reg_path in $reg_paths) {
$reg_key = $reg.OpenSubKey($reg_path);
if ($reg_key -eq $null) {
continue;
}
$names = $reg_key.GetValueNames();
foreach ($name in $names) {
$value = $reg_key.GetValue($name);
if ($value -gt 0) {
$components_installed += @($name);
}
}
$reg_key.close();
}
$reg.close();
if ($components_installed.count -lt 1) {
trap { ;
continue } $features = @(get-wmiobject -class 'Win32_ServerFeature' `
-computer $computer -erroraction 'Stop');
foreach ($feature in $features) {
$components_installed += @($feature.name);
}
}
return ($components_installed | sort);
}
As before, we take in the computer name as an argument, and if there isn’t one, we assume that the computer in question is the local machine (denoted by the “.”).
(more…)
Categories: PowerShell, Server 2003, Server 2008
Tags: PowerShell, Server 2008
June 29th, 2009
I experienced this issue the other day and went to “services” on the Windows Server (Start>Administrative Tools>Services) and found the “Windows SharePoint Services Timer”. Make sure this service is started. If it is started the stop it and restart it. This should resolve your issue. If not then you have another underlying problem to which you may have to start your install over.
Categories: MOSS, SharePoint
Tags: configuration, MOSS, SharePoint, SSP, wss
June 18th, 2009
I was trying to install the BI Dev part of SQL 2008 and kept getting that error… come to find out it was the Installer service and had NOTHING to do with SQL files. The fix is as follows…
Here’s the easy steps:
1. Go to a Windows machine that is running the same OS as you, that has the Windows
Installer service running correctly and run regedit(Start-Run-Regedit)
2. Go to the location
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\msiserver
3. Right click on this key and select “Export” and save the key to a Flash
Drive or some place that you can get to it from broken machine.
4. Run sfc /scannow on the damaged Windows computer - you won’t need the
install disk as it goes to backup files on your HD. Do NOT reboot when
complete
5. Double click saved .reg file from working machine and import registry
settings into damaged Windows computer.
6. Now reboot and try to install/uninstall again. Should resolve the issue.
Categories: Installer Service
May 27th, 2009
So had an issue a few weeks back getting multiple sharepoint sites on SSL using port 443. Thought host headers would do it but I was wrong. Found out the hard way that you have to use the command line to bind them to the host header/port. So what do you do? See below:
First get a Wildcard Certificate www.techmumbojumbo.com
Next, install the cert on one of the sites… export it, the import it to the other site.
From there we start binding- Open command prompt and navigate to: C:\inetpub\adminscripts (You will need to find out what the identifier is for each site)
[Open IIS, click on "Web Sites"... the identifers will show up in the window to the right]
Now in the command prompt type: cscript.exe adsutil.vbs set /w3svc/<site identifier>/SecureBindings “:443:<host header>”
Example: cscript.exe adsutil.vbs set /w3svc/1589652/SecureBindings “:443:<host header>”
Do this for each site you want to use port 443.
Categories: Uncategorized
Tags: IIS, MOSS, SharePoint, SSL, wss
April 1st, 2009
I looked for a while to find something that would give me a reason to use a G1 phone but I needed exchange support. Google made it clear that they were not going to do it so I looked on the market place. I found all kinds of software that synced with calendars but not email, email but not calendar, etc, etc, etc… Finally I almost gave up and found this… http://www.nitrodesk.com/index.aspx . This group has created the first full activesync app for the Android/G1. The best part is when/if I have an issue I send an email to support and get responses rather quick… sometimes within a couple of minutes. The issues I am facing are with contacts… based on logs it looks like an exchange issue on my side. We tried a new release that they are working on and viola! It fixed my issue. Now I am in no way associated with Nitro Desk but I am SUPER EXCITED that this app has arrived because I tired of using windows mobile phones with crappy web browsers and no 3G. Thank you Nitro Desk for not sucking and creating a quality app!
I am so excited that these people exist that I added a link to them in my BlogRoll…
Categories: Active Sync, Android, Exchange, G1, Google, T-Mobile
February 25th, 2009
Recently we were trying to show a pivot table within SharePoint excel services and when we would try to drill down we would get errors… but only when we would try to drill into the report. We found that is was the dreaded “Double Hop” issue. I searched for a resolution and after reading several blogs and calling Microsoft we resolved the issue. I will attempt to recreate the steps for that process. The best instruction I found was THIS BLOG POST and THIS ONE AS WELL with only 1 detail missing. So here are the steps:
First you have to make sure service principal names are setup… If they are not you will have to set them up manually. This can be done from any domain machine logged in as a DOMAIN ADMIN. Here is the tool you need.
Setting SPN’s can break things so please be aware of that!
- Also, Make sure your Analysis Services Database permissions are setup correctly.
Commands you will need:
SHAREPOINT SERVICES
setspn -A HTTP/server domain\user
setspn -A HTTP/server.domain.internal domain\user
SQL SERVICES
setspn -A MSSQLSvc/server domain\user
setspn -A MSSQLSvc/server.domain.internal domain\user
ANALYSIS SERVICES
setspn -A MSOLAPSvc.3/server domain\user
setspn -A MSOLAPSvc.3/server.domain.internal domain\user
STEP1
You will need to run the setspn command for the following:
Sharepoint: Farm Account, SSP Service, Application Pools (intranet, ssp, mysites), excel services, content access, user profile and properties content access
SQL: SQL service and analysis services
See the above blog links for demonstration of how this works.
Step 1-a (more…)
Categories: Active Sync, Policies, T-Mobile, Uncategorized
Tags: analysis services, Double hop, Excel Services, Kerberos, MOSS, SharePoint, sql, wss
December 24th, 2008
If you need to delete an SSP there are two ways to do it.
1. Via “Central Administration” but there is no link, you have to type the link manually.
http://servername:port/_admin/deletessp.aspx?sspId=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
2. From the stsadmin command line…
stsadm -o deletessp -title <sspname>
(If you want to delete associated databases you need to add “-deletedatabases”)
Categories: MOSS, SharePoint
Tags: MOSS, SharePoint, SSP, stsadmin
December 24th, 2008
If you needing to allow ASP.net 2.0 in IIS and it does not appear in the list make sure that first you have .net framework 2.x installed.
If it still does not show then you need to run the following command from the framework directory (Normally here: c:\windows\microsoft.net\framework\v2.x.x)
Run this command from that directory: aspnet_regiis -i -enable
It should now show up in IIS and be allowed already as well.
Categories: .net FrameWork, IIS
Tags: .net, IIS
December 16th, 2008
Had an issue the other today that I could not send email from my sharepoint dev server and was getting the strangest error. Turns out when the server was setup that the wrong email server was put in in the outgoing server list and was added to the list of servers in the farm. This server is a real server but it is the mailbox server not the hub/cas which is what you use for relay. So we changed it to the new server. The issue turned out to be that the mailbox server was still listed as a server in the farm and once we removed it the error went away and the emails started flowing out of sharepoint.
Other solutions here… http://www.sharepointblogs.com/johnwpowell/archive/2007/07/10/alerts-failing-cannot-connect-to-smtp-host.aspx
Categories: MOSS, SharePoint
Tags: error, MOSS, SharePoint, SMTP, wss
December 14th, 2008
As an alternative to using WMI, another way of retrieving a list of installed programs on a remote machine is to use the [Microsoft.Win32.RegistryKey] class.
function Get-InstalledPrograms($computer = '.') {
$programs_installed = @{};
$error_action = 'Stop';
$reg_uninstall_paths = @('Software\Microsoft\Windows'`
+ '\CurrentVersion\Uninstall');
$reg_uninstall_paths += @('Software\Wow6432Node\Microsoft'`
+ '\Windows\CurrentVersion\Uninstall');
$pattern_valid_name = '^{[\w\W}]+\Z';
trap { ;
continue } $wmi_output = @(get-wmiobject -class 'Win32_Product'`
-computer $computer -ErrorAction $error_action);
if ($?) {
foreach ($product in $wmi_output) {
$name = $product.Name;
$version = $product.Version;
if ($name -ne $null) {
$programs_installed.$name = $version;
}
}
}
else {
$hkey = 'LocalMachine';
$registry = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey($hkey, $computer);
foreach ($reg_uninstall_path in $reg_uninstall_paths) {
$reg_uninstall_key = $registry.OpenSubKey($reg_uninstall_path);
if ($reg_uninstall_key -eq $null) {
continue;
}
$key_names = $reg_uninstall_key.GetSubKeyNames();
foreach ($key_name in $key_names) {
$key_properties = $reg_uninstall_key.OpenSubKey($key_name);
$name = $key_properties.GetValue('DisplayName');
$version = $key_properties.GetValue('DisplayVersion');
if (($key_name -imatch $pattern_valid_name) `
-and ($name -ne $null)) {
$programs_installed.$name = $version;
}
$key_properties.close();
}
$reg_uninstall_key.close();
}
$registry.close();
}
return $programs_installed;
}
We start with the original function shell, and add error checking that allows it to fall through to check the remote registry if the WMI call fails. Here’s an overview of the additions:
$reg_uninstall_paths = @('Software\Microsoft\Windows'`
+ '\CurrentVersion\Uninstall');
$reg_uninstall_paths += @('Software\Wow6432Node\Microsoft'`
+ '\Windows\CurrentVersion\Uninstall');
$pattern_valid_name = '^{[\w\W}]+\Z';
First, we set our registry paths to look in with the array $reg_uninstall_paths. The ‘Wow6432Node’ key is present on 64-bit boxes, and I’ve found that you need to check both locations in order to get an accurate view of everything that’s installed on a 64-bit machine.
After that, we set up a regular expression as $pattern_valid_name, which will be used to limit which keys under the Uninstall key that we use to compile our list from. Our requirements for the regex are that we need a pattern that begins with an open-brace, followed by mutiple word and non-word characters, as well as a closing brace. We also have to consider that the closing-brace may not be the last character of the key name, as names that end in expressions like “}_is1″ are quite common.
$hkey = 'LocalMachine';
$registry = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey($hkey, $computer);
foreach ($reg_uninstall_path in $reg_uninstall_paths) {
$reg_uninstall_key = $registry.OpenSubKey($reg_uninstall_path);
if ($reg_uninstall_key -eq $null) {
continue;
}
$key_names = $reg_uninstall_key.GetSubKeyNames();
foreach ($key_name in $key_names) {
$key_properties = $reg_uninstall_key.OpenSubKey($key_name);
$name = $key_properties.GetValue('DisplayName');
$version = $key_properties.GetValue('DisplayVersion');
if (($key_name -imatch $pattern_valid_name) `
-and ($name -ne $null)) {
$programs_installed.$name = $version;
}
$key_properties.close();
}
$reg_uninstall_key.close();
}
$registry.close();
Once we fetch the remote registry key, we get the subkeys and parse out the keys that we can’t use, keeping the DisplayName and DisplayVersion of the ones that we consider valid. After we finish, we perform cleanup by closing each of the keys that we opened.
Accessing the function should result in near-identical results as before.
Categories: PowerShell, Uncategorized
Tags: PowerShell