Friday, March 26, 2010

Running VMware vSphere Client on Windows 7

The problems running vSphere clients on Windows 7 have brought a lot of pain and the proposed workarounds were complex and invariably didnt work.

BUT here is a very good simple arcticle which works ! - we like this a lot...

Wednesday, March 24, 2010

Sharepoint 2007 wildcard searching

To use a wildcard search or part of the name, you must specify the field name you are looking for.

eg. FileName:whiz* will find all documents with a FileName starting with "whiz"

I havent found a way to search on field's with spaces in yet (ie where there is a space in the file name replacing it with _x0020_)

There is a good article here
http://www.novolocus.com/2009/05/27/sharepoint-can-have-wildcard-searching/

Thursday, February 25, 2010

dotNet Dictionary - ContainsKey

I think Dictionary objects are brilliant data structures. The way they can contain objects and nested dictionaries within them seleves makes them a fantasic store,

However I was using a Dictionary obect to store Key Value Pairs and I couldnt be sure that I knew if all the key's were present. The first way I found to check was to try to get the key within a Try Catch block and if they key wasnt found the Catch block would return a default value.

This was both stressfull to me and the performance of the app, so I was very pleased when I found a method to test if a key existed: Dictionary<(Of <(TKey, TValue>)>)..::.ContainsKey Method

BUT I was even happier when I found the Dictionary<(Of <(TKey, TValue>)>)..::.TryGetValue Method

TryGetValue means you dont need to wrap your code in Try Catch blocks to handle exceptions and you can pass back a default value if the key is not found. Brilliant !

A couple of Excel VBA usefull notes

UserName = Environ("Username")
Domain = Environ("UserDomain")
Combined= Environ("UserDomain") & "\" & Environ("Username")

CurrentDate = Date
CurrentTime = Time

Some file and folder VBA commands

Current folder name: CurDir
Change the active folder: ChDir "C:\My Documents"

File exists test: If Dir("F:\My Documents\My Workbook.xls") <> "" Then ....

Delete a file : Kill "F:\My Documents\My Workbook.xls"

Creates a new folder: MkDir "F:\My Documents\NewPrivateFolder"
Delete a folder: RmDir


Copy a file (the file must be closed): FileCopy "OrgWorkBook.xls", "CopyWorkBook.xls"

How to move a file (the file must be closed):

OldFilePath = "C:\OldFolder\Filename.xls" ' original file location
NewFilePath = "C:\NewFolder\Filename.xls" ' new file location
Name OldFilePath As NewFilePath ' move the file


My thanks to this reference - allbeit a little hard to read beacause of the ad's

February 2010 Windows Media Center Cumulative Update for Windows 7

Although Windows 7 Media Centre is much better than previous releases - its support of media extenders such as Xbox 360 and Linksys are woefully behind. Here is the latest patch for Windows 7 and I do hope that this is supported by the extenders being updated as well.

Sharepoint list item - custom drop down menu

To be able to customise Sharepoint Context menus easily using Javascript in a a Content Editor Web Part is extreemly powerfull and remarkably simple to get working. - see this article for guidance Customizing SharePoint Context Menus.

(Suplimental: The obove article is ok as far as it goes however to try to get the client side menu to carry out actions is not simple. You need to be skilled in Javascript and have a knowledge of the internal variable names Sharepoint 2007 users. [at least Sharepoint 2010 will have a client side dll!).

Other references I found usefull were :

Wednesday, January 27, 2010

BUG: SSIS 2008 derived columns from User variables data type

I wanted to create a derived column from a user:variable in SSIS so that I could combine the input of a CSV into a SQL table along with a column name saying where the CSV came from.

Usually you initialise the user:variable before the package starts with a non relevant string, such as "1234" then updated it to the correct value once the process starts.

The problem is that when you use the Derived Coulmn Transformation Editor and add a Derived Column as SSIS fills in the Data Type automatically for you and wont let you change its data length. So if you initialise the user:variable with "1234" the new column will be defined with a Data type Unicode string [DT_WSTR] 4 - notice maximum length of 4!

So if you update the user:variable string to a length of 5 characters SSIS fails!

My work around is to make sure that you initialise the user:variable string with a value which has a length of the maximum possible string which you are likely to encouter.

Hopefully this will be resolved in future releases.

Tuesday, January 26, 2010

Another Microsoft SQL exam passed

I'm sure it gets harder to study and pass exams as each year goes by, however just managed to achieve 98% in Microsoft SQL Server 2008, Implimentation and Maintenance so off for a beer to celebrate.

Summing Excel Range Intersects

Ever wanted to add up the value of the Intersecting Sets or Ranges.

I had a couple of Ranges as rowns,
eg Dept1 = Rows A1:N4 , Dept2 = Rows (A5:N6, A12:N16) etc

and then Columns Ranges for Jan, Feb
eg Jan = Column B1:B12, Feb = C1:C12 etc.

I wanted to get the sum of the Intersection between Ranges Dept1 for Jan. To do this use a Space as an operator. eg =Sum(Dept1 Jan)

Whilist everyone knows about the comma as a Union operator not many people have heard of space as an Intersect operator - see "Reference operators" in Excel help for more info

Tuesday, January 19, 2010

Using Windows 7 for "Server-like" loads

I'm studying for a SQL 2008 exam and found that you can mirror up to 3 backups to different devices, so when a client had some new Windows 7 machines delivered with loads of spare hard drive, I thought this would be an excellent location to backup an additioanal copy of SQL to overnight.

However after about a 15Gb backup from SQL 2005 server onto a Windows 7 share, the Windows 7 workstation seemed to loose its visibility from any of the Windows 2003 servers. (The other Windows 7 machines could still see the share).

A reboot solved the issue, until I tried to backup again!

Looking in the event log, I found memory errors showing as Non-Paged pool problems.

After a lot of searching, I came across the article below - it would appear that from the old SysInternals Site there used to be an article called "Tunining Workstations for Server-Like Loads". Microsoft seem to have "tidied up" these old articles and I couldnt find any links to the references shown on Technet, however if you make the registry changes to a Windows 7 machine, it seems a lot happier pretending to be a backup file server overnight.

Set the following registry to key to 1

HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\LargeSystemCache

and set the following registry key to ‘3′:

HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters\Size

Reboot and enjoy!


References:
http://alan.lamielle.net/2009/09/03/windows-7-nonpaged-pool-srv-error-2017
Event ID 2017 and 2021 - microsoft.public.windows.vista.networking_sharing Google Groups

Tuesday, January 12, 2010

Tuesday, December 15, 2009

Configuring User Profiles in Sharepoint 2010 beta 2 in the enterprise

This gives an interesting walkthrough for configuring user profiles. (Despite 5 installs of a Sharepoint 2010 its still not quite right).

Ive found this is a very tricky and time consuming process fraught with problems and Kathy's notes are very helpful.

in reference to: Kathy Hughes, MVP (view on Google Sidewiki)

Wednesday, October 14, 2009

Running SSIS packages from a web page

I need to run a simple aspx page on a SQL server to run an SSIS package so that users could kick off the process without having access to the SQL admin tools.

The following C# class in an asp.net page runs brilliantly on the SQL 2008 server

static void CallSSIS()
{
string pkgLocation = @"E:\VS Projects\\Sandbox.dtsx";
Application ssisApp = new Application();
Package ssisPackage = ssisApp.LoadPackage(pkgLocation, null);
DTSExecResult ssisPackageResults = ssisPackage.Execute();
}


The only major problem I had was publishing the web to a virgin Windows 2008 with IIS7 machine. When I browsed to the page it gave the following error "This configuration section cannot be used at this path".

After hours of head scratching and missleading web articles, it turned out that the ASP.NET is not installed as a ROLE in by default.

Server Manager -> Roles -> (scroll to Web Server (IIS)) -> Add Role Services -> ASP.NET

Volia!

Monday, October 12, 2009

Symantec System Center - Cant unlock server group

I was asked to look at unlocking a Windows 2003 Server Symantec System centre whos documented name and password didnt work.

If you a) update the "user-admin-p" registry entry -
HKEY_LOCAL_MACHINE\SOFTWARE\Intel\LANDesk\VirusProtect6\CurrentVersion\Accounts (more details here)


and then b) run the iforgot.exe program in the Program Files\Symantec\Symantec System Center\Tools folder

then you can reset the user account's password.

Sunday, August 16, 2009

Setting wss 3.0 site anonymous access

A couple of years ago I setup a secure WSS 3 web application which I now wanted to publish so that everyone (anonymous) could see it, however I couldnt find out how to do it.

Following the Microsoft guidance article it suggests Site Actions -> Users and Permissions -> Advanced Permisions -> Settings and then click on Anonymous access, however the option just wasnt there !

Further investigation reminded me I needed to make sure that my "authentication providers" needs to be set to support anonymous as otherwise its not an option to choose in menu above. To set this up go to Web Application Management -> Application Security -> Authentication Provider, choose the Zone you wish to edit and then make sure "enable anonymous access" is checked and save this setting.

Now go back to the first stage on the Advanced Permissions -> Settings drop down and voila, you can set anonymous for site, list level or none as you require.

Monday, August 10, 2009

Updating Windows 2008 Domain Account Policies

Whilst passwords meeting complexity requirements is all well and good in a production environment it is a pain in a development one. I have a Windows 2008 standard AD Domain Controller and and I needed a number of system accounts which I really didnt want to have to bother of recording complex passwords.

To change these settings is not intuative, however this is what I found:

To turn password complexity off in Windows 2008 Server or change other grayed out security options, follow these steps:
(1) Run gpmc.msc (Group Policy Management)
(2) Expand your Domain
(3) Go to Group and select Default
(4) Right click on Default Domain Policy or Default Domain Controllers Policy and choose Edit
(5) In the new window which opens expand computer Configuration->policies->windows settings->security settings->account policies->password policies
(6) Make your edits to the keys below:

There must be an easier way, which I am problaby missing !

Tuesday, July 28, 2009

C#3 anonymous types, parameters and LINQ for XML

Crash learning to work with LINQ XML (see sample code below to get a distinct list from an XML file written by a reporting services report) re-introduced me to a really usefull feature of C#3 called anonymous types where you can create an object on the fly. You can then use that object in the same method, however if you wish to pass it to another method then things start getting complicated. This blog note Anthony Steele's Blog : C#3 anonymous types as parameters points you in the right direction to whats possible.

(He also mentions a very good book on C#3 (by Bill Wagner) to hone your skills)


Note: as a learning LINQ is a lot of trial and error you can test your LINQ code in a very helpful utility called:http://www.linqpad.net/

Sample LINQ code
XDocument xDoc = XDocument.Load(@"c:\temp\RSD.xml");
var q = (from e1 in xDoc.Descendants("{SchemaName}Detail").Distinct()
let div = e1.Attribute("Division").Value
let cc = e1.Attribute("CostCode").Value
select new { div, cc }).Distinct();

q.Dump(); //this shows you the contents of q

Monday, July 13, 2009

Integrating External Document Repositories with SharePoint Server 2007

Whilist loading documents into Sharepoint from existing file shares is a good option it is often time consuming and here is an interesting article showing how you can link existing exteral document libraries with sharepoint Integrating External Document Repositories with SharePoint Server 2007:

Saving Reports to SharePoint using WebDav from Windows 2008

I was having difficulty getting Enterprise Reporting Services to run a data subscription (running on Windows 2008) to save reports into a Sharepoint Document library using a URL.

I found that Windows 2008 does not install the required WebDav Client (Not to be confused with the additional IIS7 WebDav Server addon) .

You can install this client by Adding the "Desktop Experience Feature" on Windows 2008, however this also installs lots of other things that you probably dont want and Ive not found a way to only install WebDav Client support.

After a server re-boot it works well and talks to Sharepoint Document Libraries, My thanks to the following article for assistance. Browsing SharePoint using WebDav from Windows 2008 « In The Mix

Friday, April 10, 2009

Chaks' Corner | WCF and Sharepoint - System.IO.FileNotFound Exception

Writing a WCF Sharepoint handler I had a great deal of trouble wondering why SPSite host = new SPSite(http://localhost..../) was giving a Web application could not be found error. The URL opened fine in a browser.

The answer appears to be security related where the WCF service doesnt seem to have enough permission to get to the local sharepoint server. One workaround which seems to work is to set the WCF Application Pool permissions to the same as the Sharepoint Application Pools. Im not sure its elegant but until I find a better way this seems to work. Thanks to the following blog: Chaks' Corner WCF and Sharepoint - System.IO.FileNotFound Exception