Viser opslag med etiketten SuperOffice7. Vis alle opslag
Viser opslag med etiketten SuperOffice7. Vis alle opslag

fredag den 3. februar 2012

Visual C# Command Line Compiler has stopped working.

A few months back, after running Windows Update on all our Remote Desktop and XenApp 6.0 servers, users of 2 applications would get the below error.
image
The applications would only get the error on XenApp, but not the Remote Desktop servers. One of our XenApp servers had been taken out of production for some tests, and had not been updated, and when running the same applications on that server, we would not get the above error.
We run all applications within Application Virtualization Client. While investigating this error we also noticed that the error did not turn up, when run outside App-V. So what is happening ? notice that the application that is crashing is the .NET C# command line compiler, and not the application it self. When attaching Windows Debugger to one of the application we could see the application would still be running after that dialog had been shown, after once you click close the following exception would be thrown inside the application.
Exception type: System.IO.FileNotFoundException
Message: Could not load file or assembly 'mscorlib.XmlSerializers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.
InnerException: System.IO.FileNotFoundException

I found several similar cases on Google, but none exactly like ours.
http://connect.microsoft.com/VisualStudio/feedback/details/93647/xml-serializer-throws-file-not-found-exceptions
and
http://blogs.msdn.com/b/asiatech/archive/2010/08/02/could-not-find-the-file-c-windows-temp-lt-xml-serializer-random-generated-file-name-gt-dll.aspx
We created a Support case at Citrix and the 2 3rd party company’s. They both managed to find a work around but in different ways. One found this link http://stackoverflow.com/questions/1127431/xmlserializer-giving-filenotfoundexception-at-constructor/1642941#1642941 and noticed changing this worked in our case
clip_image001
The other vendor had seen the error before and recommended following this guide http://forums.citrix.com/thread.jspa?threadID=273000 but that did not work. After some more troubleshooting they found a workaround but wouldn’t tell me what it was, and wouldn’t give us a fix to make the application work, so we had to continue the support case at Citrix.
After troubleshooting, running various debug tools and sending and endless streams of crash dumps, we finally managed to find a work around that made all applications work.
It is kind of similar to the above mentioned fix. Add the following registry key. ( you don’t need to restart the server, but you will need to logoff and back on to see if it fixed your problem). Simply add the following registry key
Key: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Citrix\CtxHook
Value Name: ExcludedImageNames
Type: REG_SZ
Value: csc.exe,cvtres.exe

tirsdag den 3. januar 2012

App-V, Office 2010 and Ribbons

Updated 4th Jan 2012: And that didn’t work once rolled out in production anyway. Back to the drawing board. :-(

I explained how to use SuperOffice inside Microsoft Application Virtualization client in a former blog post. What I didn’t mention was that since we did that, we had a annoying problem with that. Every time a user started Microsoft Word, they would get a popup saying “An error occurred and this feature is no longer functioning properly. Please run Setup and select “Repair…” to restore this application

image

I opened a Support Case at Microsoft and we have been troubleshooting this issue for several months and today we finally cracked it. Doing installation of SuperOffice they register an Office Add on and register some Office Ribbons. They have “messed” up the registry keys a bit thou. Some things are registered for Office 12 (office 2007) and some tings get’s registered for Office 14 ( Office 2010 )

doing sequencing, after installing SuperOffice,
export hklm\software\Wow6432Node\Microsoft\Office\12.0  and delete it.
replace \12.0\ with \14.0\ in the reg file, and import it.

Now word will function again.

onsdag den 14. december 2011

SQL user does not use default schema

So I was troubleshooting an installation of SuperOffice Customer Service. When running the installer it would fail with an ODBC driver error saying something down the line of “’config’ object not found” and you could see it was doing a “select count(*) from config”

I jumped over to the SQL server and saw that the SuperOffice SQL user did not have crm7 schema set as default schema and was not owner. So I chanced that, and tried again. I would still failed. So I open a new query in Management studio and did a “select * from config” .. that should work, but didn’t, I would still get no such object.

after goggling a while I decided to do a alter user, so opened the “help” page for “alter user” and voila, after reading the page I suddenly knew what was wrong.

The value of DEFAULT_SCHEMA is ignored if the user is a member of the sysadmin fixed server role. All members of the sysadmin fixed server role have a default schema of dbo.

The person who had installed superoffice had added the SQL user crm7 to the sysadmin role, and as you can see, that will break the schema role assignment. After removing the user from sysadmin, everything worked again.

mandag den 10. oktober 2011

Working with SuperOffice though PowerShell

This powershell snap in is not meant to be a complete SuperOffice client, but for most basic stuff you can use this. Like say, you want to run a batch job everyday to update/sync information's from anther system and SuperOffice

working with powershell makes a lot of things a lot easier. Lets have a look at a few examples

First lets connect to SuperOffice. If you have the superoffice.config from your client laying around somewhere you can easily connect using that.

$module = Get-Module | where {$_.name -eq 'wingu.SuperOffice.SnapIn'}
if($module -eq $null){
$module = Get-Module -ListAvailable | where {$_.name -eq 'wingu.SuperOffice.SnapIn'}
if($module){ import-module wingu.SuperOffice.SnapIn }
}

$config = Get-SO7config c:\superoffice.config | Set-SO7config
$config.Username = $config.Explicit.DBUser
$config.Password = $config.Explicit.DBPassword

So, just to validate everything is working, lets get the license information
$LicenseInfo = Get-SO7LicenseInfo
# To replace running license use
#
Set-SO7LicenseInfo -CompanyName 'Happy Ducks Holding ApS' -SerialNumber '1234'
#
To Update current license. ( like if you buy more user licenses )
#
Set-SO7LicenseInfo $LicenseInfo

To see what credentials is associated with alz@sotest1.local and if he is logged on right now, you could so something like this


Get-SO7Person -email alz@sotest1.local | Get-SO7Credentials

Or to have a loot at who is using SuperOffice right now
Get-SO7Credentials | where {$_.CredentialType -eq 'Ticket' }

( this will not be accurate, since cleanup of ticket’s is only done when a user logs in. but still … )

Do you want a list of Persons asscociated with Contact ‘hestehøj a/s’ ?


Get-SO7Contact 'Hestejøj AS' | Get-SO7Person

Want to create a new Associate, with AD login ?


$logonName = 'alz'
$upn = 'alz@sotest1.local'
$FirstName = 'Allan'
$Lastname = 'Zimmermann'

# Get Associate if exists
$CRM7User = Get-SO7Associate -logonName $logonName -ea 0
# Get Person with email corrosonding to upn, if exists
$CRM7Person = Get-SO7Person -email $upn -ea 0
if((!$CRM7User) -and (!$CRM7Person)){
# could not find a person nor Associate so create both
$CRM7User = New-SO7Associate -FirstName $FirstName -Lastname $Lastname -logonName $logonName -Email $upn -AdUser
$CRM7User = Get-SO7Associate -logonName $logonName -ea 0
$CRM7Person = Get-SO7Person -email $upn -ea 0
}
if((!$CRM7User) -and ($CRM7Person)){
# Person exists, but have no Associate so create it and link to person
$CRM7User = New-SO7Associate -person $CRM7Person -logonName $logonName -Email $upn -AdUser
$CRM7User = Get-SO7Associate -logonName $logonName -ea 0
}
# Assign a UserLicense, allow login, and enable Windows/web
$CRM7User | Enable-SO7Associate

Or, create with a CRM5 password (not ad login) ?
$logonName = 'alz'
$upn = 'alz@sotest1.local'
$FirstName = 'Allan'
$Lastname = 'Zimmermann'
$Password = 'Passw0rd'

# Get Associate if exists
$CRM7User = Get-SO7Associate -logonName $logonName -ea 0
# Get Person with email corrosonding to upn, if exists
$CRM7Person = Get-SO7Person -email $upn -ea 0
if((!$CRM7User) -and (!$CRM7Person)){
# could not find a person nor Associate so create both
$CRM7User = New-SO7Associate -FirstName $FirstName -Lastname $Lastname -logonName $logonName -Email $upn -Password $Password
$CRM7User = Get-SO7Associate -logonName $logonName -ea 0
$CRM7Person = Get-SO7Person -email $upn -ea 0
}
if((!$CRM7User) -and ($CRM7Person)){
# Person exists, but have no Associate so create it and link to person
$CRM7User = New-SO7Associate -person $CRM7Person -logonName $logonName -Email $upn -Password $Password
$CRM7User = Get-SO7Associate -logonName $logonName -ea 0
}
# Assign a UserLicense, allow login, and enable Windows/web
$CRM7User | Enable-SO7Associate

anyway, here is a complete list of commands.
Get-Command -Module wingu.SuperOffice.SnapIn


Close-SO7Session
Decrypt-SO7H
Disable-SO7Associate
Enable-SO7Associate
Encrypt-SO7H
Get-MySO7Identity
Get-SO7Associate
Get-SO7Business
Get-SO7config
Get-SO7Contact
Get-SO7Country
Get-SO7Credentials
Get-SO7Email
Get-SO7LicenseInfo
Get-SO7Person
Get-SO7Secret
Get-SO7SystemInfo
New-SmartProcess
New-SO7Associate
New-SO7Business
New-SO7Contact
New-SO7Credentials
New-SO7Person
Remove-SO7Associate
Remove-SO7Business
Remove-SO7config
Remove-SO7Contact
Remove-SO7Credentials
Remove-SO7Email
Remove-SO7Person
Save-SO7config
Set-SO7config
Set-SO7LicenseInfo
Set-SO7Person


onsdag den 5. oktober 2011

First encounter with SuperOffice 7 PocketCRM

Apparently some people inside the company I work for, have told some one else that I have had a bit of experience with SuperOffice. One of our SuperOffice consultants was troubleshooting a failed SuperOffice 7 PocketCRM installation, and needed some help getting it up and running. I have never seen that product but I never back down from a good challenge.

The first thing I noticed when logging on to the server, was that SuperOffice web was installed, and didn’t work. If you browsed the local website, no matter what you wrote you would just get an HTTP 404 file not found. The weird thing was the error came from a Tomcat server and not IIS. I did a net stat –ano to see if Tomcat had “stolen” port 80, but that was not the case. After looking around a bit inside IIS, I noticed there was added an ISAPI filter pointing to a DLL inside the tomcat directory. After removing that entry, IIS worked again, and we could login to SuperOffice web.

But now Pocket CRM wasn’t working. Knowing that the ISAPI DLL was “eating” all web request, I  decided to created a new website and added the ISAPI filter to that website, and I also added a virtual directory pointing to Jakarta as it had been doing on the original website. browsing to the new website’s /dl I would now be presented with the option to download the pocket CRM client. We tested if we could login from a client, but had no luck. After several different test’s we managed to get an error from the client saying it couldn’t connect to http://fqdn/NetServer/soPrincipal . I ran the installer for SoWeb and created a new NetServer installation on the main website (the one with SoWeb) with a virtual directory called /NetServer. Ran config and we tested the CRM Pocket client again.

Now we would just get login failed, no matter what. I enabled logging on the NetServer installation, but it wouldn’t generate any log.

<SuperOffice>
<Diagnostics>
<add key="LogError" value="True" />
<add key="LogWarning" value="True" />
<add key="LogFailureAudit" value="True" />
<add key="LogSuccessAudit" value="True" />
<add key="LogInformation" value="False" />
<add key="LogToFile" value="True" />
<add key="LogFolder" value="c:\temp" />
</Diagnostics>
</SuperOffice>

Weird. I opened visual studio on my own machine, added a reference to the above server and created a small test application
    Sub Main()
Dim WS As New ServiceReference1.SoPrincipalClient
Dim Password As String = "secret", UserName As String = "user"
Dim Succeeded As Boolean, TimeZone As ServiceReference1.SoTimeZone, Response As ServiceReference1.SoPrincipalCarrier
Dim AuthenticationSucceeded
Dim Credentials As ServiceReference1.SoCredentials
Dim WsClient As test.ServiceReference1.SoExceptionInfo = WS.AuthenticateUsernamePassword(Password, UserName, _
Succeeded, TimeZone, Response, AuthenticationSucceeded, Credentials)
Console.WriteLine(
"Succeeded: " & Succeeded)
Console.WriteLine(
"AuthenticationSucceeded: " & AuthenticationSucceeded)
If Credentials Is Nothing Then
Console.Write(
"Credentials is nothing")
Else
Console.Write(
"Credentials Ticket: " & Credentials.Ticket)
End If
Dim s As String = ""
Console.WriteLine(
"done.")
Console.ReadLine()
End Sub


I cant re-generate the error message, to show here on the blog, but it said something about about not being able to bind the web service to port “http”. I have seen that error before so I opened web.config and added


<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>

After that I could now successfully authenticate to the NetServer, so we went back to the SuperOffice client. Same stuff, Client would say “authentication failed” and NetServer was net generating any log.

I went back to my application and wrote a wrong username and password. a log file was created. I delete the logs, chanced username/password to some valid credentials and ran the application again. no log file got generated … So seems SuperOffice has a bug and isn't logging successful logins when told too. We did the same test from the PocketCRM client, and saw the same thing happen. It would log when typing wrong username and password, and no log when we typed valid credentials. But the client kept saying “authentication failed”


After enabling debug logging inside tomcat I noticed PocketCRM wasn’t talking with NetServer though Tomcat, so I had the weird idea that maybe the PocketCRM application inside Tomcat didn’t talk with the correct NetServer


After looking though different files, I found \SuperOffice\SuperOffice 7 Server\Modules\PocketCRM\Tomcat 6.0\webapps\#pocketcrm\WEB-INF\classes and saw the NetServer URL was wrong. I changed it, and restarted PocketCRM, and voila. Everything worked.

fredag den 30. september 2011

Installshield MSI Multiple Instances

While working on automating installation of SuperOffice Customer Service (formerly known as eJournal ) I ran into a few issues. I started with just copying all files and changing configuration files but it didn’t quite do the trick. Doing installation of Customer Service it also install's 2 Windows Services and scripting that would just not be worth it, so I decided to see if I could control the installer instead.

If you have installed SuperOffice Customer Service once, the next time you call SuperOffice.CustomerService.exe you will get a prompt to either create a new instance or modify an existing installation

image

I’m no expert on MSI installers, but I did some digging around and it seems the way they get that to work, is doing some Transform scripting inside the installer. (that’s why it is an exe and not an MSI )

The first thing I did was extract the MSI and have a look at the properties in the installer so I could pass on the correct parameters. but when I called MSIEXEC with the SMI, I would get all kinds of different errors. (makes sense now ). After a lot of goggling I found that I could control the instance by number, by adding /Instance= to the .EXE … test that I created a couple in instances like this

SuperOffice.CustomerService.exe /instance=1 /V"EJHOSTNAME=servicesotest1.so7.wingu.dk INSTALLDIR=C:\servicesotest1.so7.wingu.dk /L*v c:\1.log /passive"
SuperOffice.CustomerService.exe /instance=2 /V"EJHOSTNAME=servicesotest2.so7.wingu.dk INSTALLDIR=C:\servicesotest2.so7.wingu.dk /L*v c:\2.log /passive"

And uninstalling

SuperOffice.CustomerService.exe /x /instance=1 /V" /L*v c:\1.log /passive"
SuperOffice.CustomerService.exe /x /instance=2 /V" /L*v c:\2.log /passive"

so I though that would be awesome, I could just pass on my CustomerService ID as Instance Name and everything would be perfect. But no … if I pass on a number higher than 1000 I fails and doesn’t work, so I had to do some more digging. I decided to see if I could emulate all the instance numbers and find a “free” instance number when installing, and the same, when uninstalling and look at install location.

I came across this neat little PowerShell Snap In/Module to get information about installed software. but you can also get all the information with WMI if you prefer that kind of stuff

$programs_installed = @{};
$win32_product = @(get-wmiobject -class 'Win32_Product' )
foreach ($product in $win32_product) {
$product | fl
# $product.InstallLocation
$name = $product.Name;

$version = $product.Version;
if ($name -ne $null) {
$programs_installed.$name = $version;
}
}

So now I can easely get a list of installed instances including my “instance number” by running


Get-MSIProductInfo -Name 'SuperOffice Customer Service' | fl ProductName, ProductCode, InstallLocation, PackageCode, InstanceType, Transforms

For a complete list, do


Get-MSIProductInfo | fl AuthorizedLUAApp, InstallContext, InstalledProductName, Language, Name, PackageCode, PackageName, ProductIcon, Transforms, Version, CollectUserInfo, Equals, GetComponentState, GetFeatureState, GetHashCode, GetType, ToString, PSPath, Item, AdvertisedLanguage, AdvertisedPackageCode, AdvertisedPackageName, AdvertisedPerMachine, AdvertisedProductIcon, AdvertisedProductName, AdvertisedTransforms, AdvertisedVersion, Context, Features, HelpLink, HelpTelephone, InstallDate, InstallLocation, InstallSource, IsAdvertised, IsElevated, IsInstalled, LocalPackage, PrivilegedPatchingAuthorized, ProductCode, ProductId, ProductName, ProductVersion, Publisher, RegCompany, RegOwner, SourceList, UrlInfoAbout, UrlUpdateInfo, UserSid, Advertised, Installed, V1, AssignmentType, DiskPrompt, InstanceType, LastUsedSource, LastUsedType, MediaPackagePath, ProductState, VersionMajor, VersionMinor, VersionString

So to wrap it all up ….


function InstallSuperOfficeCustomerService([String]$fqdn){
$InstanceID = 0
#$AllreadyInstalled = Get-MSIProductInfo -Name 'SuperOffice Customer Service'
$AllreadyInstalled = @(get-wmiobject -class 'Win32_Product' ) | where {$_.Name -eq 'SuperOffice Customer Service'}
if($AllreadyInstalled){
# add 1, to avoid getting "default" instance, and check if its free
$InstanceID = $InstanceID + 1
$isFree = $AllreadyInstalled | where { $_.Transforms -eq ":InstanceId$InstanceID.mst" }
# If not free, loop til we find one unused
while($isFree){
$InstanceID = $InstanceID + 1
$isFree = $AllreadyInstalled | where { $_.Transforms -eq ":InstanceId$InstanceID.mst" }
}
}
if(! (Test-Path 'c:\CustomerService')){ $temp = New-Item 'c:\CustomerService' -type directory }
# replace /passive with /qn to hide the UI
$parameters = "/instance=$InstanceID /V""EJHOSTNAME=$fqdn INSTALLDIR=C:\CustomerService\$fqdn /L*v c:\CustomerService\install-$fqdn.log /passive"""
# Write-Host ("X:\SuperOfficeInstall\Customer Service 7.0 SR2\SuperOffice.CustomerService.exe " + $parameters)
$installStatement = [System.Diagnostics.Process]::Start( "X:\SuperOfficeInstall\Customer Service 7.0 SR2\SuperOffice.CustomerService.exe", $parameters )
$installStatement.WaitForExit()
}

function UnInstallSuperOfficeCustomerService([String]$fqdn){
# now i could look though the instance number and call it with
# SuperOffice.CustomerService.exe /x /instance=$InstanceID /V" /L*v c:\$InstanceID.log /passive"
# but instead i'll play it safe and use the ProductCode

#$isInstalled = Get-MSIProductInfo -Name 'SuperOffice Customer Service' | where {$_.InstallLocation -like "*$fqdn*" }
$isInstalled = @(get-wmiobject -class 'Win32_Product' ) | where {($_.Name -eq 'SuperOffice Customer Service') -and ($_.InstallLocation -like "*$fqdn*")}
if($isInstalled){
# replace /passive with /qn to hide the UI
# $ProductCode = $isInstalled.ProductCode
$ProductCode = $isInstalled.IdentifyingNumber
$parameters = "/x $ProductCode /passive /L*v c:\CustomerService\uninstall-$fqdn.log "
# Write-Host ("msiexec " + $parameters)
$uninstallStatement = [System.Diagnostics.Process]::Start( "msiexec", $parameters )
$uninstallStatement.WaitForExit()
}
}

function IsSuperOfficeCustomerServiceInstalled([String]$fqdn){
$isInstalled = @(get-wmiobject -class 'Win32_Product' ) | where {($_.Name -eq 'SuperOffice Customer Service') -and ($_.InstallLocation -like "*$fqdn*")}
if($isInstalled){
return $true
}
else {
return $false
}
}

InstallSuperOfficeCustomerService 'deleteme4.domain.com'

UnInstallSuperOfficeCustomerService 'deleteme4.domain.com'

IsSuperOfficeCustomerServiceInstalled 'deleteme4.domain.com'
IsSuperOfficeCustomerServiceInstalled 'deleteme5.domain.com'

mandag den 26. september 2011

SuperOffice 7 Web and SO_ARC on different servers

I’m playing around with SuperOffice 7 web. I’ve managed to automate the process of creating separate websites per SuperOffice instance, but after the initial setup I started getting some weird errors.
I’m far from, done with all this, and I defiantly don’t know everything I need to know to make all this work, but I’m taking things as they come.

When downloading files, I would get errors like
clip_image002

My first though was I hadn't escaped the file path properly.
When setting up SuperOffice web I found that these 4 files needs to be updated
~\bin\Reporter\SoReporter.Executer.exe.config
~\bin\BatchService\SoBatchService.exe.config
~\bin\Reporter\SuperOffice.CONFIG
~\Web.config
I modified my SuperOffice PowerShell snap in to support loading all files and changing the content, to make it easier for me while automating the process.

In the above error the SO_ARC is places on \\fs01\Customers\SOTEST2\APPS\SO7\SO_ARC so that’s what I had in SoBatchService.exe.config, SuperOffice.CONFIG and Web.config. … I escaped the string with $SO_ARC = $SO_ARC.Replace("\", "\\") … Provisioned the website and tried again.

Still now luck, so open Process Monitor and look what's going on …. AAHHH!

image

That’s weird, I specifically set the credentials I want it so connect as and yet its accessing the files as IUSR …

    <Documents>
<!-- Location of SO_ARC -->
<add key="ArchivePath" value="\\\\fs01\\customers\\SOTEST2\\APPS\\SO7\\SO_ARC" />
<!-- Location of template folder.
This folder only needs to be specified when it is other than default.
-->
<!--<add key="TemplatePath" value="\\\\qa-build\\StateZeroSoArc\\Template" />-->
<!-- Location of temporary folder for streaming files.
This path must resolve to the same location for farms/culsters.
-->
<add key="TemporaryPath" value="c:\\temp" />
<!-- Impersonate user when accessing the document archive or the temporary folder -->
<add key="ImpersonateUser" value="False" />
<!-- Name of the user to impersonate with -->
<add key="ArchiveUser" value="soadmin_SOTEST2" />
<!-- Password of the user to impersonate with -->
<add key="ArchivePassword" value="SuperSecret" />
<!-- Domain of the user to impersonate with -->
<add key="ArchiveDomain" value="INT" />
<!-- Size of internal buffer in KB -->
<add key="BufferSize" value="32" />
</Documents>


Ah well, no worry, I modified my script to create an application pool with a domain account and set the websites anonymous account to run as the application pool.


# Set application Pool identity
Set-ItemProperty ('IIS:\AppPools\' + $InstanceName) -name processModel -value @{userName=($ADDomainName + '\' + $SOAdminUser);password=$SOAdminPassword;identitytype=3}
# Set Application Pool Identity as Anonymous User
Set-WebConfigurationProperty -filter /system.webServer/security/authentication/anonymousAuthentication -name userName -value "" -PSPath IIS:\ -location ('IIS:\Sites\' + $InstanceName)

And now it works… Guess that is a bug, or I don’t understand the parameters well enough.


And tonight I’m going to throw some love at reporting … Every time I try and generate a report I get this error in the browser after a minute’s time.


clip_image002[6]


Updated 27-09-2011: Problem solved. First of all, I had forgotten to create the DSN link. But it still failed.
There was no error messages being generated anywhere, so I fired up process monitor and had a look. And sure enough, SoReporter.Executer.exe was getting access denied creating so_log.txt, so I gave the application poll write permissions in the /bin and had a look. After doing that, every time I tried generating a report, instead of getting the above error I would know be logged out of the website. hmmm, strange …

After looking at some of the warnings in the normal log files I started to wonder if “Failed to parse Assembly 'Edanmo.OleStorage, Version=1.0.847.22469,Culture=neutral,PublicKeyToken=8840063030bd4bce'.” had something to do with this so began looking more into errors after finding DLL files. Edanmo.OleStorage quickly lead me to MsgReader – DLL . I bet they chanced something in the code and was not in the mode for reflector, but since I know now I had something to do with mail I remembered seeing something in the above config files


    <Factory>
<DynamicLoad>
<add key="DefaultSoMail" value="C:\Program Files\SuperOffice\SuperOffice 7 Web\SuperOffice\bin\SoMail.dll" />
<add key="SaleImpl" value="SuperOffice.Sale.Services.Implementation.dll" />
<add key="ProjectImpl" value="SuperOffice.Project.Services.Implementation.dll" />

Now, I know that is not right. I remember thinking the first time I saw it, that I couldn’t harm pointing at the “wrong” directory. the DLL was there too … but I know better than that. so just for fun I went though all the config files mentioned above and removed the path


        <add key="DefaultSoMail" value="SoMail.dll" />

Love and be hold. We have a winner …. Now I can generate reports.
I modified my provisioning scripts, deleted everything and created all from scratch ( to fix permissions, things I had chanced in config files etc. ) and re-tested and it still works .. so that is the fix …

søndag den 25. september 2011

Hosting SuperOffice 7 on Citrix/RDP

I have been spending a lot of time looking into SuperOffice 7 the last few weeks, preparing automatic provisioning and hosting of SuperOffice 7. I want to briefly talk about some of the issues I ran into, and how I worked around them to get a working environment up and running.

SuperOffice can work in a 2-tier solution with a SQL database on a server somewhere and a fat client installed on a client computer. In this solution when SuperOffice is started it load its configuration from the installation directory (C:\Program Files (x86)\SuperOffice\SuperOffice 7 Windows)
SuperOffice can also run as a Web Client in a semi 3-Tier solution. You have your database on some severe, you have a Webserver running 1 or more websites, each website with it’s own configuration file(s).

From a hosting perspective that means you would prefer the web approach, but not everything in SuperOffice works from the web client. And, for now, some of the administrative tasks cannot be done though the web interface either. Many 3rd party add-ons for superoffice is not designed to work from the web client either.

In a hosting environment with Citrix/Remote Desktop servers is sometimes installed as dedicated per customer, and sometimes installed in a “shared hosting” environment where different customers facilitate the same farm of server. If customers have their own servers, keeping the configuration files in a single location shouldn't post any problems, but in a shared environment you don’t want different users from different customers being able to only talk with 1 SuperOffice database

I'm sure there's many ways to handle this, but for now I see 2 working solutions. The SuperOffice 7 client supports an parameter called IniPath. If we start SOCRM.exe or SOAdmin.exe with this parameter it will load the superoffice.config and superoffice.ini files from that location instead. That does how ever pose a few problems. SuperOffice still use a lot of COM interfacing ( ActiveX ). Say you have word open and want to archive the document you have open. If SuperOffice is running you will see
image
and everything works perfectly. If how ever, SuperOffice is not running you will see
image
And if you click that button it will launch the SuperOffice client for you. This launch will not know about the IniPath parameter and SuperOffice will now be searching the wrong place for the configuration files.

I’m not sure if you could do an search and replace in registry and change the launch parameters, but there is another way

In the environment I’m working with right now we use Microsoft Application Virtualization ( App-V ) to deploy applications on all Citrix XenApp and Remote Desktop Servers. When you are sequencing SuperOffice 7 you can modify the File Properties for SuperOffice.config and SuperOffice.ini to make them User Specific

image

So I created a small “initializer” application and added to the package, that each user have to call once before using SuperOffice. That application copy in the configuration files for that specific customer, and from now on every time superoffice starts it is reading the “correct” configuration files. ( Note: you need to set the right permissions on the files, to allow users to change these files, while sequencing SuperOffice 7 )

lørdag den 24. september 2011

SuperOffice Powershell snap in updated

Updated 02-10-2011: Added new command called New-Smart Process. Read more about it here and here. Also made it easier to install as a module instead of PS Snapin
Updated 28-09-2011
: Fixed an error when creating new associates. Fixed a bug in the DSN links created by the snap-in. Added a handful more commands.

I’m starting to use the powershell snap in I created more and found quite a bit of bug’s, spelling errors and needed more commands for my tasks.
Here is a short list of commands

  • Close-SO7Session
    Close down any open connection to SuperOffice and unloads the appdomain
  • Decrypt-SO7H
    Decrypts an 7C: string. Used within superoffice.config to protect database username and password
  • Encrypt-SO7H
    Encrypts an text to an 7C: string. Used within superoffice.config to protect database username and password
  • Get-MySO7Identity
    Return an SO7Associate object representing who you are within the current connection to SuperOffice
  • Get-SO7Associate
    Return one or more SuperOffice Associate
  • Get-SO7config
    Get an empty config object. Used to represent an connection to SuperOffice
  • Get-SO7Credentials
    Get one or more SuperOffice Associate Credentials ( CRM5 / Active Directory / Tickets and so on )
  • Get-SO7Email
    return one or more Email Address from within SuperOffice
  • Get-SO7Person
    return one or more SuperOffice Person objects
  • Get-SO7Secret
    Used for Calculating CRM5 secrets
  • New-SO7Associate
    Create new SuperOffice Associate. Can auto create a Person if needed
  • New-SO7Credentials
    Attach/update credentials for an existing SuperOffice Associate
  • New-SO7Person
    Create new SuperOffice Person
  • Remove-SO7Associate
    Remove one or more SuperOffice Associates
  • Remove-SO7config
    Removes SuperOffice config files and removes DSN links
  • Remove-SO7Credentials
    Remove one or more SuperOffice Credentials
  • Remove-SO7Email
    Remove one or more SuperOffice Email Address
  • Remove-SO7Person
    Remove one or more SuperOffice Persons
  • Save-SO7config
    Save config object as SuperOffice config files ( superoffice.config/superoffice.ini and create DSN link )
  • Set-SO7config
    Set running configuration. (what superoffice database do you want to work with right now ) Will Close any existing connection and unload its appdomain
  • Set-SO7Person
    Update an existing SuperOffice person.

Download here. Compiles fine under both .NET 3.5 and 4.0.

lørdag den 17. september 2011

SuperOffice 7 making my head hurt

Updated 23-09-2011: I moderated my comment about superoffice. That was childish of me
Updated 24-09-2011: New version updated with a ton of bug fixes .. read more here

My original approach to handling users in superoffice didn't work as expected. I don’t know why I didn’t catch this while testing ( I apparently don’t test well enough )

The whole point of this powershell add on was to make a simple way of managing users in multiple SuperOffice databases. Turns out the SuperOffice NetServer API is hardcoded to declare everything as internal static’s ( that’s private shared for us VB nuts ). They don’t expose a function to clear them, and pretty much everything inside the API is handled though static’s. And they don’t offer you a way to change configuration. Even SuperOffice.Configuration.ConfigFile.SetConfigFile fails. ( they check internal static variable superoffice.socontext._currentPrincipal . That means you can “sign-out” but you’re a “stuck” with the database you connected to the first time. If you change the configuration file (like I did in my old code) SuperOffice will now throw
Authentication failed
Failed to create Identity from tokens
If you (but you wont, its not nice to spy at others bad coding habit's ) look inside SOCore.dll with reflection you can easily see that, SuperOffice is talking with the database ( so DSN link, database and database username/password is correct ) but the identity token it created with your windows principal or CRM username/password doesn’t match anything in database. Since its still looking in the old database

I tried messing a bit around with reflection and overwrite the variables. But didn’t really get me anyway (but I learned a lot of new trick while trying ) so I decided to go down the path I read about on devnet.superoffice.com .

AppDomain … Now there is something I don’t know anything about. I know what it is, but I have never, ever tried coding with/against it.I created a ton of small test applications going down different paths, but nothing really seemed to work. *IF* I managed to get different things loaded, superoffice would go nuts and not work. Then after several hours of getting more and more desperate i found a very simple example (sorry lost the link) and that got me kicked in to gear.

So here is the updated version of my powershell add-on to manage users in SuperOffice. Its pretty much the same but

  • I renamed all functions to start with so7.
  • I’ve added a Type Formatting file ( .ps1xml ) so output looks better.
  • I fixed a small bug in the configuration files. SuperOffice client goes nuts when it see <security> tag, so removed that unless you specifically set the Symmetric keys.
  • And best of all. Now it works against multiple SuperOffice instances.

Enjoy ….