cjvandyk.com C's SharePoint Collective

Title: C's SharePoint Collective
Description: All things SharePoint from an 8 x SharePoint MVP
cjvandyk.com is ranked 0 in the world (amongst the 40 million domains). A low-numbered rank means that this website gets lots of visitors. This site is relatively popular among users in the united states. It gets 50% of its traffic from the united states .This site is estimated to be worth $0. This site has a low Pagerank(0/10). It has 1 backlinks. cjvandyk.com has 43% seo score.

cjvandyk.com Information

Website / Domain: cjvandyk.com
Website IP Address:
Domain DNS Server: ns46.domaincontrol.com,ns45.domaincontrol.com

cjvandyk.com Rank

Alexa Rank: 0
Google Page Rank: 0/10 (Google Pagerank Has Been Closed)

cjvandyk.com Traffic & Earnings

Purchase/Sale Value: $0
Daily Revenue: $0
Monthly Revenue $0
Yearly Revenue: $0
Daily Unique Visitors 0
Monthly Unique Visitors: 0
Yearly Unique Visitors: 0

cjvandyk.com WebSite Httpheader

StatusCode 200
Cache-Control private, max-age=0
Content-Type text/html; charset=UTF-8
Date Tue, 16 Aug 2016 11:11:50 GMT
Server GSE

cjvandyk.com Keywords accounting

Keyword Count Percentage

cjvandyk.com Traffic Sources Chart

cjvandyk.com Similar Website

Domain Site Title

cjvandyk.com Alexa Rank History Chart

cjvandyk.com aleax

cjvandyk.com Html To Plain Text

C's SharePoint Collective C's SharePoint Collective The SharePoint Knowledge Collection of Cornelius J. van Dyk, an 9 x SharePoint MVP Home SharePoint Versions List Posts RSS Comments RSS Edit RSS Pages Home Versions Scripts How do I - Exclude certain file types from a XCopy folder sync? When you're managing multiple SharePoint farms that rely on custom, in-house developed Powershell modules, keeping these modules up to date across the entire enterprise can be a tricky prospect. This is usually where I employ some Powershell with calls to XCopy. XCopy is a very powerful tool for synching files between systems. As you can see from its documentation page, there are many command switches for it. The tricky thing is usually when you're trying to sync folders that contain Powershell scripts, but these scripts generate log files. You want to sync the .ps1 files, but not the .log files. How do we do that then? This is where the /exclude: switch comes into play. You can create a text file containing the extensions you wish to exclude. Then you simply pass the text file to the /exclude: switch thus: xcopy S:\Corne\Scripts\*.* T:\Scripts /E /I /F /H /R /Y /d /exclude:Exclusions.txt Its important to remember that the exclusion will do a simple path match on the values specified in exclusions.txt. As such, having the file content defined thus: .log will exclude anything that matches ".log" somewhere in the path of the file e.g. files ending in ".logger", ".logs", ".log2, ".log" etc. will all be excluded from XCopy. This can be resolved by simply adding a backslash to the back of the extension thus: .log\ Now XCopy will only ignore files with a ".log" extension. Enjoy C 0 comments Posted in How do I?, PowerShell, Scripting, Tips, XCopy Links to this post i-SharePoint anyone? This has been sorely missing for years! Thankfully Microsoft is finally making this happen. Microsoft brings SharePoint to iOS https://techcrunch.com/2016/06/21/microsoft-brings-sharepoint-to-ios Exciting times. Later C 0 comments Posted in Apple, SharePoint Links to this post Fixing Camtasia Studio black preview screen problem in Windows 10 0 comments Posted in Camtasia, How do I?, Tips, Video Links to this post Powershell Tip - Padding Text Since we use Powershell for just about everything these days, you're sure to end up generating some kind of quick report of something in SharePoint through a simple Powershell script. Inevitably, the need to pad text comes up. Powershell makes it easy to left and right pad text variables through the use of the .PadLeft() and .PadRight() .NET methods used as follows: $str = "My Report Title"; $strPad = $str.PadLeft(20) + "."; Write-Host $strPad; The output looks like this: My Report Title. In this case, we were left padding the string to 20 characters. By default, padding is done with spaces so given the string was already 15 characters long, 5 spaces were added to the front of the string resulting in our output. The use of the additional period will become apparent as we look at right padding the text as follows: $strPad = $str.PadRight(20) + "."; Write-Host $strPad; The output looks like this: My Report Title . Here you can clearly see the 5 spaces before the period. ;-) If you want to pad with something other than spaces, you can simply supply the second, optional parameter to PadLeft() or PadRight() specifying the character to be used for padding e.g. $strPad = $str.PadRight(20, "$") + "."; Write-Host $strPad; The output looks like this: My Report Title$$$$$. Enjoy! C 0 comments Posted in How do I?, PowerShell, Scripting, SharePoint, Tips Links to this post How do I - Round numbers to a given decimal space in Powershell? One of my subscribers asked how to round in Powershell. It's actually quite easy. All you have to do is use the [math] preprocessor's Round() method e.g. if I wanted to round to two decimal places I'll use the following: [math]::Round($value, 2); If I issue the Round() call without a second parameter thus: [math]::Round($value); I would get an integer rounded value, i.e. I'd get the whole, ignoring any decimals. Hope that helps! Later C 0 comments Posted in How do I?, PowerShell, Scripting Links to this post How do I use Powershell with IIS 7 or later? If you're into any form of automation, you know that Powershell rocks! That said, the real strength of Powershell comes from it's snap-ins. These extensions allow you to do all manner of things. One of those is the ability to script actions in IIS. To get started you'll need to ensure you have the Feature installed on your flavor of Windows. If you don't have it installed, you can either download it here: https://www.microsoft.com/en-us/download/details.aspx?id=7436 or add it via Windows' Programs and Features. Generally on anything late Windows 7 or Server 2008, it's already loaded. Once installed, you'll need to load the snap-in thus: Import-Module WebAdministration From here, you're only limited by the available calls and your imaginations. Happy scripting. C 0 comments Posted in PowerShell, Scripting, Tips Links to this post What is the SharePoint hive? Almost a decade ago I posted an article explaining what the 60/12 hive is. Since then, SharePoint has undergone many new versions so I thought it was time I updated my hive article just a bit to include the three additional major releases since then. For more information on the origination of the "hive", refer to the original article linked above. SharePoint Version Hive Server Disk Location 2007 C:\Program Files\Common Files\Microsoft Shared\web server extensions\12 2010 C:\Program Files\Common Files\Microsoft Shared\web server extensions\14 2013 C:\Program Files\Common Files\Microsoft Shared\web server extensions\15 2016 C:\Program Files\Common Files\Microsoft Shared\web server extensions\16 Enjoy C 0 comments Posted in 2007, 2010, 2013, 2016, Hive, SharePoint, Tips Links to this post How do I - Get a list of email addresses of all users who belong to a given SharePoint security group? One of mentees asked me how to extract the emails of all the owners of a given site. With some Powershell magic and the use of the -ExpandProperty switch, this is actually quite easy. $url = "http://{webapp}/sites/{site}"; $owners = Get-SPWeb $url | Select -ExpandProperty SiteGroups | Where {$_.Name.ToLower() -match ((Get-SPWeb $url).Title.ToLower() + " owners")} | Select -ExpandProperty Users | Select Email; foreach ($owner in $owners) { {do something with $owner.Email} } In the above script, we start off by setting the $url variable. Then we make the big call to get the owners list of emails into $owners. The command calls Get-SPWeb for the given URL. The return of that is then piped to a Select command using the -ExpandProperty switch to expand the SiteGroups. This would get you all site groups, but piping it to the Where command allows us to filter the returned groups down to the one we want. The Where command is fed the name of the site group (in lower case) and is asked to match it against the spweb object's title (in lower case) with " owners" concatenated. A couple of things to note: It is good practice to ALWAYS make the case of text the same on both sides of a text based comparison. I prefer lower case, hence the dispersion of .ToLower() in my code. This part of the code does depend on default security groups being used in SharePoint. This is 95% of the time the case, but you should be aware that different naming conventions may have been used for the name of the site owners group. Now that we have the owners security group, the result is piped to another Select command expanding to return the users of that group. Finally, we pipe to a Select statement that selects a single field i.e. the email address. You now have an array of email addresses that can be iterated and used via the .Email field reference. Enjoy C 0 comments Posted in How do I?, PowerShell, SharePoint Links to this post How to load a dot net class in Powershell when you don't know the DLL name. Most of us know that the main SharePoint classes live in Microsoft.SharePoint.dll. The easiest way to load this assembly is by using the ::LoadWithPartialName method thus releasing you from having to use the exact DLL name. In this case its obvious, but there are a couple of classes that are in DLLs that are not so obvious. Simply call the following: [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint"); You can replace the "Microsoft.SharePoint" with any class name, provided its accessible on the system. Enjoy C 0 comments Posted in PowerShell, Programming, Scripting, SharePoint, Tips Links to this post How do I - Allow someone the ability to TRUNCATE TABLE in SQL Server without granting them DBO rights? There comes a time where a developer produces a stored procedure (sproc) that tries to clear a table quickly. In the case of permanent tables, this is usually done using the TRUNCATE TABLE statement in TSQL. Of course in a production setting, you will have limited rights on your SQL Server and databases. As such, we generally grant users DB_DATAREADER and DB_DATAWRITER rights. Additionally, we'll grant users EXECUTE rights on sprocs. The problem is that in order to do a TRUNCATE TABLE, SQL actually drops that table in order to clear it so quickly. That won't be possible when a users is trying to execute the sproc in production. Since they have EXECUTE rights, they'd be able to execute it, but it will fail when the system tries to drop the table in question. For that, the executor needs to have DBO rights. Of course we're not going to grant people DBO rights in production! So the question becomes, how do you solve the problem? I'm assuming that well defined change management and process control is in place already. If it is not, you need to start there first. Once you have a proper method for reviewing changes to sprocs going into production, you can apply this quick fix: TSQL BEFORE ALTER PROCEDURE [dbo].[BlaBlaBla] @TableName varchar(60) AS DECLARE @QUERY NVARCHAR(200); ... TSQL AFTER ALTER PROCEDURE [dbo].[BlaBlaBla] @TableName varchar(60) WITH EXECUTE AS OWNER AS DECLARE @QUERY NVARCHAR(200); ... By simply adding the WITH EXECUTE AS OWNER line to the sproc, it will execute as owner level permissions, thus allowing the TRUNCATE statement to succeed. Now it's important to understand that this creates a security risk that YOU must manage. That's why it's important to review any and all changes that are made to the sprocs, especially if they're going to have this statement in them. It may be better to just create a generic sproc that you can feed a table name to, which elevates like this and truncates the table passed to it. Enjoy C 0 comments Posted in How do I?, SQL, SQL Server, TSQL Links to this post How do I - Determine what type of site template was used when a SharePoint site was created? If you work in SharePoint regularly, you may develop the ability to look at a SharePoint site and correctly guess which template was used in the creation of said site. Of course, given how SharePoint works, you'd probably only have a 50/50 shot at best of actually being correct. Given how most everything is connected to Features and the fact that site templates in most cases just have a given sub set of Features that are turned on during the creation process, it's really anybody's guess. Powershell to the rescue! Of course, if you're an administrator with shell access to your farm, you can always resort to Powershell to get that answer. All you have to do is get the WebTemplate property of the SPWeb object for the site thus: Write-Host (Get-SPWeb http://sharepoint.crayveon.com/sites/site123 | Select WebTemplate); Alternatively, you could use the Get-SPSite cmdlet at the beginning of the pipe to get all the sites and sub sites and their templates thus: Write-Host (Get-SPSite http://sharepoint.crayveon.com/sites/site123 | Get-SPWeb | Select URL, WebTemplate); Enjoy C 0 comments Posted in How do I?, PowerShell, Scripting, SharePoint Links to this post My "Save site as template" option is gone from Site Settings in SharePoint 2013... where did it go? A common practice in the world of SharePoint is to create sub site templates. A site collection administrator will customize a template sub site and then via the Site Settings use the "Save site as template" option to create a new template that can be used for new sub sites. The problem is that this option isn't always available. So why not? The answer lies in the activation of Publishing Features on the site collection. If at any point in time during the entire life cycle of the site, you had turned Publishing on for the site collection, this option is removed permanently. See https://support.microsoft.com/en-us/kb/2492356 for more detail. Later C 0 comments Posted in 2013, Annoyances, SharePoint Links to this post How to convert text to upper or lower case in InfoPath If you're developing SharePoint forms with extended functionality, then you've most likely already been exposed to InfoPath. You know, that thing that Microsoft said was dead years ago? :-) Unfortunately, InfoPath doesn't have the maturity of something like Visual Studio and C# when it comes to text handling. It would have been great if we could have had access to a .ToUpper() or .ToLower() method when dealing with text, but alas, we do not. To that end, we have to use a workaround leveraging the translate() method. In order to generate the equivalent of .ToUpper() which converts all text to uppercase, you'll need to use this: translate(., "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ") Vice versa, to get a .ToLower() equivalent which converts all the text to lowercase, you'll need: translate(., "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") Enjoy C 0 comments Posted in Annoyances, InfoPath, Programming, SharePoint, Tips Links to this post How do I - Fix the problem where SharePoint Designer 2013 crashes upon opening a site? This one is REALLY annoying! I never understood why software vendors always assume that users are on the latest and greatest version of their software. Furthermore, they assume you're only using the current version by itself. The REAL WORLD REALITY is much further removed from the utopian vision most vendors have of their products. In my case, this was a problem back in the previous version cycle, when I upgraded from SharePoint 2007 to 2010. My clients were migrating from 2007 to 2010 thus having content in both formats. Of course, this problem didn't go away or get fixed, but instead it persists to this day with the version upgrade from SharePoint 2010 to 2013 and I'll be you dollars to donuts we'll see this problem going from 2013 to 2016 as well. Synopsis A large company with multiple terabytes of content decides to upgrade from SharePoint 2010 to 2013. Given the large amount of data, it's a phased migration over time. As a result, some sites are in 2010 and some are in 2013. End user support staff will need to be able to support both 2010 and 2013 sites. When these users install SharePoint Designer 2013 and then try and open a SharePoint 2013 site with SPD 2013, without uninstalling SPD 2010 i.e. running 2010 and 2013 parallel, then SPD could crash consistently. Oh, and forget about going back to 2010 also. It will also now be crashing upon opening a site. I consider this to be a product bug. I really wish concurrent version testing would have higher priority with software vendors. Solution To solve this little conundrum, we're going to have to hack the system... time to fire up good old REGEDIT. Follow these steps to clear up the problem. Click the Windows start button. Type "regedit" and press enter. In the registry editor, locate the following key: HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Common\Open Find\Microsoft SharePoint Designer\Settings\Open Site Delete the "ClientGUID" key located here. Locate the next key: HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Common\Open Find\Microsoft SharePoint Designer\Settings\Open Site Delete the "ClientGUID" key here. Now restart SharePoint Designer and your sites should open as expected. NOTE: Your most recently used list will now show both 2010 and 2013 sites. It's recommended to keep using SPD 2010 with SharePoint 2010 sites and 2013 with 2013 sites. Hopefully this post saves someone some time and frustration. Later C 0 comments Posted in 2010, 2013, Annoyances, Bugs, How do I?, SharePoint, SharePoint Designer, SPD, Step-by-Step, Tips Links to this post SharePoint Audit Log reporting SharePoint has some built in Audit Log reporting that can be leveraged for rudimentary auditing purposes. In order to these reports to become available, you will need to configure the Audit Settings on a per site collection basis from the /_layouts/15/settings.aspx page. From your site collection root, click the Settings gear in the top left of the page. On the dropdown menu, click "Site Settings". Under the "Site Collection Administration" section, click the "Site collection audit settings" (/_layouts/15/AuditSettings.aspx) link. On the "Configure Audit Settings" page, you can configure a multitude of options such as audit log trimming and the different events to audit. Once you've configured your desired settings, click the "OK" button to close the page and enforce the settings. You will have to wait for the audit processing timer jobs to run before reports will become available. The delay time will depend on your system's configuration, but by default these jobs run daily. To view the reports, simply return to the site settings page and click "Audit log reports" (/_layouts/15/Reporting.aspx?Category=Auditing) under the Site Collection Administration section. From this page, you will have several report options. Play around with these reports and see what's useful to you. Happy SharePointing! Later C 0 comments Posted in 2013, Auditing, How do I?, SharePoint, Step-by-Step Links to this post How do I - Fix SharePoint ULS Logs not being written? From time to time, you will run into a situation where you're looking for ULS logs in their regular place i.e. %CommonProgramFiles%\Microsoft Shared\Web Server Extensions\15\LOGS\ but there aren't any log files being written. Most of the time, the problem is simply that an admin might have changed the logging location. Ensure you're checking the correct logging location. Navigate to Central Admin >>> Monitoring >>> Configure Diagnostic Logging Check the Path value. You can copy the value and paste it into your Windows Explorer address bar for quick access to the logging location. If the logging location is correct, but you're still not getting logs on the server, check the Trace service. Open the Service console from the server where the logs aren't being written. Scroll down and check that the "SharePoint Tracing Service" is running. If the service is running, you may want to restart it for good measure. Most likely it's NOT running though. If it's not, start the service. If the service does not use Local System for the account, but instead uses a domain account, it's likely that the password might have changed recently. Obtain the new password and reset the credentials for the service and then restart the service. If that isn't the issue, there's sometimes some access issue with the logging location at the time the service started up. You could try toggling the logging location path value. Navigate to Central Admin >>> Monitoring >>> Configure Diagnostic Logging Check the Path value. Change it to a folder that does exist. Click OK. Navigate back to the "Configure Diagnostic Logging" page. Change the Path value back to %CommonProgramFiles%\Microsoft Shared\Web Server Extensions\15\LOGS\ and click OK. I'll continually add more steps as I uncover more reasons logging doesn't work in SharePoint. ;-) Later C 0 comments Posted in How do I?, SharePoint Links to this post How do I - Manually force SharePoint patches or CU installations to complete using PSConfig.exe SharePoint patching has always been a sore subject. The installation of Cumulative Updates can leave your environment in a non functional state which is why Microsoft always recommend that you only install CUs if you are absolutely sure that the CU actually fixes something that is broken within your environment. As with all other installation recommendations, it's always recommended that patches and CUs follow a proper change management path of DEV >>> QA >>> PROD in order to ensure minimal impact to production systems. My standing recommendation to all my clients is as follows: Do NOT install any CU until it's been in the wild for at least a month. There has been many retractions and re-publishings of CUs over the course of history and unfortunately, Microsoft's track records with CU regressions is not stellar. The last thing you need to to install a CU that breaks your production environment. By waiting a month, any obvious issues with the CU would become known before you apply it to your environment. Install the target patch or CU into DEV first. Let it simmer in this environment for 2 weeks. Ensure that you have the ability to roll back the CU through VM snapshots. Since most DEV environments are virtual these days, this isn't really a problem. If ANY issue is reported by developers in the DEV environment, investigate it and do NOT proceed to step 3 until you're sure the problem was not caused by the CU. If the CU is the cause of the problem, simply roll back to your previous snapshot. Be sure this policy is well published and communicated, especially within your developer community as developers would lose any code that resided on the DEV farm without being checked into source control, when you conduct the rollback. But that never happens, right? Developers always check their code into source control, right? ;-) Once the CU passed the DEV test, it's time to move it to your QA environment for validation against what should be in PROD. Again, the assumption here is that your QA environment is a true representation of the PROD environment. If the CU breaks anything in QA, simply stop the process and do NOT proceed to step 4. As with step 2 above, if your QA environment is also virtual (most are these days) then you can simply roll it back as well when problems are encountered. Leave the CU in the QA environment for at least 2 weeks to simmer before advancing to step 4. Finally deploy the CU to your PROD environment. Since there is no uninstall for CUs, and given that a lot of PROD SQL Servers are still physical, once you get to this point, there's no going back. If some regression issues are discovered after you've installed to PROD, you're at the mercy of Microsoft releasing a patch to resolve the issue. It is best to open a support ticket as soon as possible to help them determine how widespread and serious the regression is. Now in each of the install steps above, you'll sometimes find that running PSConfig.exe or the Configuration Wizard after completing the CU/Patch installation, would fail or get stuck. This leaves you in no man's land and has to be resolved in order to complete the installation/upgrade. NOTE: A CU/PATCH INSTALLATION IS NOT COMPLETE UNLESS YOU HAVE A SUCCESSFUL RUN OF PSCONFIG ALL ALL YOUR SERVERS IN TURN!!! When this happens, you can manually run PSConfig to force the completion as follows: Run the SharePoint Management Shell as admin. (Right click icon, Run as Administrator) There should be a path to BIN already defined in the management shell, but if you get a command not found error when you enter PSConfig, you could manually change directory to C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\BIN Execute psconfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures If PSConfig fails on step 9 or 10, proceed as follows: Edit C:\ProgramData\Microsoft\SharePoint\Config\GUID\cache.ini Reset value to 1 From the SharePoint Management Shell, execute stsadm -o execadmsvcjobs From the SharePoint Management Shell, execute psconfig.exe -cmd upgrade -inplace b2b -wait -force This should complete your update successfully. REMEMBER THAT YOU HAVE TO DO THE ABOVE PSCONFIG FOR EACH AND EVERY SERVER IN YOUR SHAREPOINT FARM. START WITH THE CENTRAL ADMIN SERVER AND THEN PROCEED WITH EACH SERVER IN TURN ONCE THE PREVIOUS SERVER COMPLETED. It is said that you don't HAVE to run PSConfig in a single threaded fashion as stated above, but from personal experience, whenever I've had issues with CU installations, it was because PSConfig was run concurrently on multiple servers in the farm, but I'd recommend you let your own personal experience be the judge. Enjoy C 0 comments Posted in CU, How do I?, SharePoint Links to this post How do I - Update the SharePoint Search Service Application Default Content Access account credentials using Powershell When corporate security policy require that account passwords be updated, the Default Content Access Account used for the Search Service Application needs to be manually updated as well. If your Search Service is in a funky state, this might not be possible using the browser UI. When this happens, you'll need to resort to Powershell to save the day using the following script: $userid = "domain\search_account"; $password = "account_password"; $ssa = Get-SPEnterpriseSearchServiceApplication "Search Service Application"; $sac = New-Object Microsoft.Office.Server.Search.Administration.Content($ssa); $sac.SetDefaultGatheringAccount($userid, (ConvertTo-SecureString $password -AsPlainText -force)); Enjoy C 0 comments Posted in How do I?, PowerShell, Search, SharePoint Links to this post SharePoint PowerShell error - The local farm is not accessible - Cmdlets with FeatureDependencyId are not registered When you're new to a SharePoint farm, you may try to open the SharePoint Management Shell expecting to work in PowerShell. Even though your account may be a local administrator on the server as well as a member of the SharePoint Farm Administrators group in Central Admin, you may still receive this error message: The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered. The issue is related to access to the configuration database for SharePoint. What you need to do is grant access to the user in question, to the configuration database in SQL Server. This can be done with the following two PowerShell commands: $db = Get-SPDatabase | where {$_.Type -eq "Configuration Database"} Add-SPShellAdmin "domain\username" -database $db We begin by using the Get-SPDatabase cmdlet to get a reference to the SharePoint databases. When you execute Get-SPDatabase by itself, it will provide you a listing of all SharePoint databases in the farm. By filtering the type of database to only "Configuration Database" via the where clause, we are able to return on the configuration database in the farm. Using the returned reference from this, we can use the Add-SPShellAdmin cmdlet to grant the user in question access to the configuration database. Happy SharePointing! C 0 comments Posted in PowerShell, SharePoint Links to this post How do I - Sort a list of custom class objects in descending order in C#? Suppose we have a custom class defined thus: class CustomClass { public string String1 { get; set; } public string String2 { get; set; } public string String3 { get; set; } public int Int1 { get; set; } public int Int2 { get; set; } public CustomClass() { String1 = ""; String2 = ""; String3 = ""; Int1 = 0; Int2 = 0; } public int Calculate() { return Int1 + Int2; } } As we can see, the class initializes it's variables and has a Calculate() method that simply returns the added value of the two int variables of the class. Now suppose we have a list of these class objects in our app with varying values thus: CustomClass MyClass = new CustomClass(); MyClass.Int1 = 10; MyClass.Int2 = 5; CustomClass My2ndClass = new CustomClass(); My2ndClass.Int1 = 7; CustomClass My3rdClass = new CustomClass(); List lst = new List(); lst.Add(My2ndClass); lst.Add(MyClass); lst.Add(My3rdClass); We now have a list containing 3 of our custom class objects. The first object in the list has an Int1 value of 10. The second has an Int1 value of 5 and the third, given the class' initialization method, will have an Int1 value of 0. Given the order that we added the class objects to our list, the list, when looking at the Int1 field would look thus: 7, 10, 0 How do we go about sorting this list by any one of the variable fields of the custom class, say Int1 in our case? The built in support for Linq in Visual C# and the .NET Framework, actually makes this very easy. Using a Lambda expression, the task becomes a one liner thus: lst = lst.OrderByDescending(x => x.Int1).ToList(); We start with the OrderByDescending() method and then pass the Lambda expression to reference back to the object itself. The x => part of the expression tells C# to reference back to the calling object which in our case is lst. C# will reference back to lst as x which is where the x.Int1 then instructs the OrderByDescending method to use the Int1 field as the value by which to sort, in descending order, the x object which translates to lst. By appending the ToList() method to the back of the statement, C# will take the sorted result and generate a new List object which we simply assign back to the original lst variable. If we needed to sort in ascending order we would use the OrderBy() method instead thus making the statement: lst = lst.OrderBy(x => x.Int1).ToList(); Enjoy C 0 comments Posted in Links to this post I am humbled to be honored again I am humbled to be honored as a Microsoft MVP for SharePoint Server, for the 9th time. The MVP community is a great group of people that I'm proud to be associated with. 0 comments Posted in MVP, SharePoint Links to this post How do I – Play the TNG Red Alert (or any audio file for that matter) in my WinForms C# app Out of the box, C# and .NET supports the playing of any .WAV file. The code is pretty straight forward. We simply need to reference the system media class to create a SoundPlayer{} object thus: System.Media.SoundPlayer p = new System.Media.SoundPlayer(@"C:\Media\MySoundEffect.wav"); Once we have the object, we simply invoke the Play() method thus: p.Play(); So in two simple lines of code, we are able to play any .wav file from our application. There are some more embedded problems that may not immediately be obvious. Allow me to explain. Suppose I'm trying to add the Star Trek TNG Red Alert sound to my app for an emergency notification. I begin by locating the sound in question. A quick web search takes me to the http://www.trekcore.com/audio/ site where the Red Alert section has several samples to choose from. Once I locate the sound sample that I wish to use, I click the link and download the file. PROBLEM #1: The file is in the .mp3 audio format. Attempting to use it in the instantiation of the SoundPlayer() method fails with the message that only .wav files are supported. RESOLUTION We could use a custom media player class, or we could just let the internet do some work for us. A quick search pointed me to the http://media.io/ online audio conversion web site. The simple interface couldn't be cleaner or more straight forward: Simply take the .mp3 file we previously downloaded and upload and convert it on this site. Now we finally have a .wav file that we can use in our project. Now we would like the alert sound to be played 3 times and a popup window present the error notification. That's easy, right? We simply use a for() loop that looks like this: for (int i = 0; i { MessageBox.Show("There is an error!", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); }); t.Start(); } Once we have the message box contained in a separate thread, we simply make that call prior to playing our audio thus: ShowAlert(); for (int i = 0; i { MessageBox.Show("There is an error!", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); }); t.Start(); } Once we have the message box contained in a separate thread, we simply make that call prior to playing our audio thus: ShowAlert(); for (int i = 0; i <= 2; i++) { System.Media.SoundPlayer p = new System.Media.SoundPlayer(@"TNG-Red-Alert.wav"); p.Play(); System.Threading.Thread.Sleep(1500); } Once the user interacts with the message box, the thread (t) will terminate gracefully. In the mean time our main app is free to continue execution of our loop to play the alert sound. Enjoy C 0 comments Posted in Links to this post For all the audio aficionados A very interesting Kickstarter campaign for a portable DAC. http://www.kickstarter.com/projects/gavn8r/geek-a-new-usb-awesomifier-for-headphones/description 0 comments Posted in Links to this post Fixing Visual Studio 2012 defaults One of the biggest pet peeves I experienced when switching to Visual Studio 2012 was the fact that the default command buttons were changed. In going for a cleaner look, many of the main command buttons most developers use most frequently, was removed from the toolbar interface and buried in the menu structure instead. Personally, the buttons I find myself using most frequently are the Navigate Backwards and Navigate Forwards ( ), Comment Selected Lines and Uncomment Selected Lines ( ) and lastly Increase Line Indent and Decrease Line Indent ( ). The Navigate functions are still there, but the Comment and Indent functions are buried deep within the Edit/Advanced menu. While it’s true that the Comment functions do have hot keys attached to them, I hardly consider Ctrl+K,Ctrl+C for a single click to be useful to most developers save the few that know the hotkeys by heart. As for the Indent commands, they don’t have any hotkeys and you’d have to click through Edit/Advanced/Indent to get the action. Though small annoyances, these can be addressed by simply adding the commands back to the command bar. Here’s how to do just that: Click Tools on the menu bar. On the popup menu, click "Customize". After the Customize dialog window opens, click over to the "Commands" tab. Select the "Toolbar" radio button. In the dropdown to the right of the Toolbar radio button, select the "Standard" toolbar to work with. The toolbar's controls will be previewed in the bottom left of the dialog window. To the right of the preview, click the "Add Command" button. In the Add Command dialog window that opens up, select the "Edit" category to the left. On the right, scroll down through the commands and locate the "Line Indent" command. Select the command and click the "OK" button. The command will be added to the top of the Controls preview. Repeat steps 8 through 12 for the "Line Unindent", "Selection Comment" and "Selection Uncomment" commands as well. The interface doesn't allow multi-select, though that would be nice touch in a future update. Once you have all the commands, use the "Move Up" and "Move Down" buttons to the right to arrange the commands in the order you wish them to appear on the toolbar. When you're happy with the arrangement, click the "Close" button. Your new toolbar should now reflect your favorite buttons again. :-) Happy coding! C 0 comments Posted in Annoyances, C#, Programming, Step-by-Step, Visual Studio Links to this post Older Posts Search About Me Cornelius J. van Dyk A seasoned SharePoint Architect with over 15 years of experience. Smithsonian Award for Technological Innovation - Banking and Insurance 9 x Microsoft SharePoint MVP MCITP, MCTS, MCP http://blog.cjvandyk.com Born and raised in South Africa during the 70's I got my start in computers when a game on my Sinclair ZX Spectrum crashed, revealing it's BASIC source code. The ZX had a whopping 48K of memory which was considered to be a lot in the Commodore Vic20 era, but more importantly, it had BASIC built into the soft touch keyboard. Teaching myself to program, I coded my first commercial application at age 15. After graduating high school at 17, I joined the South African Air Force, graduating the Academy and becoming a Pilot with the rank of First Lieutenant by age 20. After serving my country for six years, I made my way back into computer software. Continuing my education, I graduated Suma Cum Laude from the Computer Training Institute before joining First National Bank where my work won the Smithsonian Award for Technological Innovation in the field of Banking and Insurance. Soon I met Will Coleman from Amdahl SA, who introduced me to a little known programming language named Huron/ObjectStar. As fate would have it, this unknown language and Y2K brought me to the USA in 1998. I got involved with SharePoint after playing around with the Beta for SharePoint Portal Server 2003. Leaving my career at Rexnord to become a consultant in 2004, I was first awarded the Microsoft Most Valuable Professional Award for SharePoint in 2005, becoming only the 9th MVP for WSS at the time. I fulfilled a life long dream by pledging allegiance to the Flag as a US citizen in 2006. I met the love of my life and became a private consultant in 2008. I was honored to receive my ninth MVP award for SharePoint Server in 2013. View my complete profile Twitter Labels SharePoint (43) How do I? (20) Programming (12) Downloads (9) PowerShell (9) Annoyances (8) Tips (8) C# (7) Musings (7) Visual Studio (7) Outbursts (6) Scripting (6) 2013 (5) InfoPath (5) Step-by-Step (4) Toolbox (4) Windows XP (3) 2010 (2) Auditing (2) Blogging (2) Bugs (2) Gadgets (2) MVP (2) NFL (2) Search (2) Video (2) Windows 8 (2) 2007 (1) 2016 (1) Apple (1) Articles (1) CU (1) Camtasia (1) Capacity Planning (1) Cricket (1) Hive (1) Mobile (1) SPD (1) SQL (1) SQL Server (1) SharePoint Designer (1) TSQL (1) Telerik (1) Windows 7 (1) XCopy (1) iPhone (1) Links SharePoint Versions List Quix Utilities for SharePoint SharePoint Admin Nav Console Track Subscribe via RSS Alternatively subscribe via Email network connection Connect Subscribe To Posts Atom Posts All Comments Atom All Comments Videos Loading... Pageviews Today Popular Posts Fixing Visual Studio 2012 defaults One of the biggest pet peeves I experienced when switching to Visual Studio 2012 was the fact that the default command buttons were changed... How do I – Add a Search Keyword and visual Best Bet in SharePoint 2010? If you have content that you wish to raise in the search results for users, you could do that by adding Search Keywords and Best Bets to the... SPFarm.Local is null in SharePoint 2010 causing C# Console App to throw a “Object reference not set to an instance of an object” error This one is one of the more annoying errors you’ll encounter in SharePoint development. The simple reason for that is because the error you... InfoPath AND OR logic with boolean types and bit values in C based languages – Why your checkboxes are not working as expected OK, that’s a massive title for this blog post. :-) Nevertheless, if you’re having trouble with your InfoPath check boxes not having the des... How do I – Scroll the Telerik RadGridView to the top after a data refresh? What seems like a very simple thing to do, and quite frankly it should be, turned out to be a little more tricky than I thought. Setting th... Samsung Ativ S vs Apple iPhone 5 comparrison Well Windows 8 has come and so has the Surface tablet. I got my Surface on launch day and having strayed to the dark side over the past co... SharePoint boundaries and limits There are many boundaries and limits that you will generally not run into, in the SharePoint world. One such boundary that I ran into the o... Where do I find my ULS logs in SharePoint? If you’re new to SharePoint you’re going to want to learn about ULS (stands for Unified Logging Service) logs early on. Most everything tha... How do I - Programmatically update a People Picker field in an InfoPath XML document using C# I previous blogged how to update an InfoPath XML field . There are some exceptions to when it comes to People Picker fields though. The... How do I? – Calculate the number of SharePoint Web Front End servers I need. I am going to take you through my journey for Capacity Planning in this entry. Given the topic, this will be quite a lengthy post so if you&... Follow by Email Translate Blog Archive ▼ 2016 (9) ▼ July (1) How do I - Exclude certain file types from a XCopy... ? June (3) ? May (1) ? April (1) ? March (1) ? February (1) ? January (1) ? 2015 (6) ? December (1) ? November (1) ? October (1) ? September (1) ? August (1) ? January (1) ? 2014 (4) ? December (1) ? November (3) ? 2013 (11) ? October (2) ? August (5) ? June (1) ? May (1) ? April (1) ? February (1) ? 2012 (18) ? November (3) ? October (5) ? September (2) ? August (8) ? 2010 (1) ? April (1) ? 2009 (1) ? August (1) ? 2008 (2) ? July (1) ? January (1) ? 2007 (84) ? December (2) ? November (8) ? October (7) ? September (4) ? August (9) ? July (3) ? June (10) ? May (3) ? April (7) ? March (12) ? February (12) ? January (7) ? 2006 (78) ? December (11) ? November (6) ? October (1) ? September (2) ? August (11) ? July (3) ? June (6) ? May (10) ? April (6) ? March (9) ? February (10) ? January (3) ? 2005 (39) ? November (11) ? October (6) ? September (9) ? August (10) ? July (3) +1 ChocoTheme by .css{mayo} | Blogger Templates by Blogger Template Place | supported by One-4-All | powered by Blogger Entries (RSS) and Comments (RSS)

cjvandyk.com Whois

Registrar URL: http://www.godaddy.com
Registrant Name: Cornelius van Dyk
Registrant Organization: Cornelius van Dyk
DNSSEC: unsigned
For complete domain details go to:
The data contained in GoDaddy.com, LLC's WhoIs database,
while believed by the company to be reliable, is provided "as is"
with no guarantee or warranties regarding its accuracy. This
information is provided for the sole purpose of assisting you
in obtaining information about domain name registration records.
Any use of this data for any other purpose is expressly forbidden without the prior written
permission of GoDaddy.com, LLC. By submitting an inquiry,
you agree to these terms of usage and limitations of warranty. In particular,
you agree not to use this data to allow, enable, or otherwise make possible,
dissemination or collection of this data, in part or in its entirety, for any
purpose, such as the transmission of unsolicited advertising and
and solicitations of any kind, including spam. You further agree
not to use this data to enable high volume, automated or robotic electronic
processes designed to collect or compile this data for any purpose,
including mining this data for your own personal or commercial purposes.
Please note: the registrant of the domain name is specified
in the "registrant" section. In most cases, GoDaddy.com, LLC
is not the registrant of domain names listed in this database