OneNote and XML–finding pages

Pages are towards the bottom of the hierarchy in OneNote – though we still haven’t dived into the content of pages yet.

 

You can find the pages in your notebooks like this:

 

$onenote = New-Object -ComObject OneNote.Application
$scope = [Microsoft.Office.Interop.OneNote.HierarchyScope]::hsPages
[ref]$xml = ”

$onenote.GetHierarchy($null, $scope, $xml)

$schema = @{one="http://schemas.microsoft.com/office/onenote/2013/onenote"}

$xpath = "//one:Notebook/one:Section"
Select-Xml -Xml ([xml]$xml.Value) -Namespace $schema -XPath $xpath |
foreach {
$psitem.Node.Name
}

 

There’s one drawback to this – all you get is the page names:


PowerShell Summit
Comedy
Personal information
Book Series
AD
Applications
CCNA
Exchange
Infrastructure Architecture
Operations
Security
Hyper-V
WMI
PS Deep Dive
Deep Dive US12

 

You need to play around with Xpath a bit more to get a meaningfiul structure – ideally notebook – section – page

Removal instructions for ProtectSurf

What is ProtectSurf?

The Malwarebytes research team has determined that ProtectSurf is a browser hijacker. These so-called “hijackers” manipulate your browser(s), for example to change your startpage or searchscopes, so that the affected browser visits their site or one of their choice. This one also displays advertisements

https://forums.malwarebytes.org/index.php?/topic/156902-removal-instructions-for-protectsurf/

Leadership – Key Question to ask during fact gathering

From the excellent Leadership blog by John Maxwell, the key question of “What Do You Think?” is examined

http://www.johnmaxwell.com/blog/my-1-question-for-the-people-around-me

QUOTE:  The simple act of asking the right questions of the right people can provide crucial information, offer clarity and help you make better decisions. That process begins with the questions you ask yourself. It continues with the questions you ask others. When you ask the right questions of people on your team, it not only gives the above benefits, it can also improve your connection with them and demonstrate your openness and teachability.

In my upcoming book, Good Leaders Ask Great Questions, I share the eleven questions that I continually ask members of my team. Today, I’ll talk about the question that I ask my most often: “What do you think?” These words come out of my mouth a dozen or more times every day.

1. Gathering Information – want good information from multiple sources and perspectives
2. Confirming My Intuition – what can you do to validate your belief?
3. Assessing Someone’s Judgment or Leadership – fastest way to assess people’s thinking and observation abilities
4. Teaching How I Think – Why is a great tool for connecting and equipping.
5. Processing a Decision – Sometimes people need a number of different perspectives in order to discover the best choice

Apple – How iPhone 6 compares with iPhone 5s

From the Apple product announcements a head-to-head comparison of both phones are made that highlight new iPhone 6 features and whether it is advantageous to upgrade:

http://www.pcmag.com/article2/0,2817,2468229,00.asp

QUOTE: Previous generations of iPhone have mostly been spec bumps, with the iPhone 5′s screen increase from 3.5 to 4 inches and the new A7 chip in the 5s making most of the news, along with some camera improvements. This time, Apple has released two phones to cover its bases, both with larger screens and the even faster A8 processors.

We won’t know for sure until we get the iPhone 6 in for a full review, but we expect real-world performance to be somewhat similar, at least at first. When app developers start making more complex apps and games to match the A8′s power, you may see some lag on your iPhone 5s, but it’s clear you’d need some pretty serious games to slow the A7 down.

Apart from the screen and CPU, there are also some interesting new features in iOS 8, most notably Apple Pay, which will arrive in October and promises to make mobile payments a more accepted standard. And if any company’s going to do it, it’s Apple. Unfortunately for those with the iPhone 5s, this feature requires NFC, which only the iPhone 6 and 6 Plus will have.

Windows XP – Unofficial version of SP4 on the way

This non-Microsoft implementation of SP4 is mainly to provide a shortcut in building an XP based system from scratch as it is essentially a rollup of all past security updates.  This would be used at one’s own risk and by technical professionals who could repair issues without support by Microsoft.  This new resources may be useful in some settings, as long as technicians understand the inherent risks.

http://www.zdnet.com/want-windows-xp-sp4-unofficial-versions-are-on-the-way-7000033030/

http://www.ryanvm.net/forum/viewtopic.php?t=10321

QUOTE: Some five months after Microsoft ended support for Windows XP, a developer is preparing to make an unofficial service pack for the 13-year-old OS available on general release.  Using the project title of Unofficial Service Pack 4, Greece-based developer harkaz started work in September 2013 on bringing together all the official updates from Microsoft in a single package.

In his description of the Windows XP service-pack project, harkaz said: “Many users — including me — who won’t be able to upgrade their old machines to a newer OS would like to easily install all Windows updates in one convenient package. For this reason, I started working on a Service Pack 4 package.”  According to harkaz, Windows XP Unofficial SP4 is a cumulative update rollup for Windows XP x86. It can be applied to a live Windows XP system that has a minimum of SP1 installed. Alternatively, it can be integrated in any Windows XP installation media.

Publishing more than one Azure Cloud Service as part of a TFS build

Using the process in my previous post you can get a TFS build to create the .CSCFG and .CSPKG files needed to publish a Cloud Service. However, you hit a problem if your solution contains more that one Cloud Service project; as opposed to a single cloud service project with multiple roles, which is not a problem.

The method outlined in the previous post drops the two files into a Packages folder under the drops location. The .CSPKG files are fine, as they have unique names. However there is only one ServiceConfiguration.cscfg, whichever one was created last.

Looking in the cloud service projects I could find no way to rename the ServiceConfiguration file. It looks like it is like a app.config or web.config file i.e. it’s name is hard coded.

The only solution I could find was to add a custom target that is set to run after the publish target. This was added to the end of each .CCPROJ files using a text editor just before the closing </project>

 <Target Name="CustomPostPublishActions" AfterTargets="Publish">
    <Exec Command="IF '$(BuildingInsideVisualStudio)'=='true' exit 0
    echo Post-PUBLISH event: Active configuration is: $(ConfigurationName) renaming the .cscfg file to avoid name clashes
    echo Renaming the .CSCFG file to match the project name $(ProjectName).cscfg
    ren $(OutDir)PackagesServiceConfiguration.*.cscfg $(ProjectName).cscfg
    " />
  </Target>
   <PropertyGroup>
    <PostBuildEvent>echo NOTE: This project has a post publish event</PostBuildEvent>
  </PropertyGroup>

 


Using this I now get unique name for the .CSCFG files as well as for .CSPKG files in my drops location. All ready for Release Management to pickup


Notes:


  • I echo out a message in the post build event too just as a reminder that I have added a custom target that cannot be seen in Visual Studio, so is hard to discover
  • I use an if test to make sure the commands are only run on the TFS build box, not on a local build. The main reason for this is the path names are different for local builds as opposed to TFS build. If you do want a rename on a local build you need to change the $(OutDir)Packages path to $(OutDir)app.publish. However, it seemed more sensible to leave the default behaviour occur when running locally

Source: Rfennell

Apple Watch – Early Review of this new device

This InformationWeek article provides early review of Apple Watch accessory

http://www.informationweek.com/mobile/mobile-devices/apple-watch-useless-beauty-brilliant-engineering/d/d-id/1315568

https://www.apple.com/watch/

QUOTE: Nonetheless, Apple Watch is a brilliant piece of engineering. While it may lack a reason for being, it appears to be a triumph of fashion and entertainment. It’s likely to appeal to Apple customers, many of whom can afford the unnecessary expense of the Apple Watch.

Starting at $349, Apple Watch should prove popular with well-heeled young people, a group likely to be delighted with the social interaction enabled by the product: the ability to send heartbeats to one another via the device’s haptic sensor, to transmit doodles, and to reply to email via menu options or voice input rather than typed text.

The Apple Watch, beautiful though it may be in comparison to other smartwatches on the market, is useless in the sense that it isn’t even a stand-alone product; it’s an iPhone accessory. It needs to be paired with an iPhone for GPS data and WiFi connectivity. It needs to be paired with an iPhone because otherwise it might cannibalize iPhone sales, as the iPhone has done to the iPod.

The Apple Watch isn’t so much a revolutionary product as a devolutionary one: It marks the migration of technical functions into the objects and activities of everyday life. It marks an even greater emphasis on design as a differentiator. Apple Watch won’t be a runaway hit like the iPhone or iPad; but it will help Apple expand the focus of the technology industry beyond mobile devices and the desktop.

Spybot Search & Destroy Weekly Update – September 10, 2014

2014-09-10

Keylogger
++ Win32.KeyLogger.heur ++ Win32.LimitLogger.a
Malware
+ Win32.Banload + Win32.Flooder
Trojans
++ Win32.Chisburg.iip ++ Win32.Inject.rvkx ++ Win32.Limitless.a3 ++ Win32.Reconyc.cepl
Total: 2599905 fingerprints in 809882 rules for 7325 products.

»www.safer-networking.org/about/updates/

Best Practices – Top 10 security recommendations for businesses

http://www.zdnet.com/10-security-best-practice-guidelines-for-businesses-7000012088/

QUOTE: This list is not entirely focused on mobile security, but is general to corporate security. Here’s my list of 10 security best practice guidelines for businesses:

1.Encrypt your data: Stored data, filesystems, and across-the-wire transfers all need to be encrypted. Encryption is essential to protecting sensitive data and to help prevent data loss due to theft or equipment loss.

2.Use digital certificates to sign all of your sites: Save your certificates to hardware devices such as routers or load balancers and not on the web server as is traditionally done. Obtain your certificates from one of the trusted authorities.

3.Implement DLP and auditing: Use data loss prevention and file auditing to monitor, alert, identify, and block the flow of data into and out of your network.

4.Implement a removable media policy: Restrict the use of USB drives, external hard disks, thumb drives, external DVD writers, and any writeable media. These devices facilitate security breaches coming into or leaving your network.

5.Secure websites against MITM and malware infections: Use SSL, scan your website daily for malware, set the Secure flag for all session cookies, use SSL certificates with Extended Validation.

6.Use a spam filter on email servers: Use a time-tested spam filter such as SpamAssassin to remove unwanted email from entering your users’ inboxes and junk folders. Teach your users how to identify junk mail even if it’s from a trusted source.

7.Use a comprehensive endpoint security solution: Symantec suggests using a multi-layered product (theirs, of course) to prevent malware infections on user devices. Antivirus software alone is not enough. Antivirus, personal firewall, and intrusion detection are all part of the total approach to endpoint protection.

8.Network-based security hardware and software: Use firewalls, gateway antivirus, intrusion detection devices, honey pots, and monitoring to screen for DoS attacks, virus signatures, unauthorized intrusion, port scans, and other “over the network” attacks and attempts at security breaches.

9.Maintain security patches: Some antivirus programs update on what seems like a daily basis. Be sure that your software and hardware defenses stay up to date with new antimalware signatures and the latest patches. If you turn off automatic updating, set up a regular scan and remediate plan for your systems.

10.Educate your users: As I wrote in The second most important BYOD security defense: user awareness, “it might be the most important non-hardware, non-software solution available. An informed user is a user who behaves more responsibly and takes fewer risks with valuable company data, including email”.

Taking ownership..

Wah.. what a pain. All you want to do is copy data files from an old XP hard drive, and when Windows 7 or 8 prompts you to take ownership and ‘continue, nothing happens.It shouldn’t be difficult, and guess what? It isn’t. Smile

There is a link on this website.. yes this one .. which contains a small zip file. It’s the link just underneath the section ‘UNINSTALL’, and this is how it works.

  1. Download and run the ‘install’ zip file.
  2. Navigate to the intransigent folder on the XP drive.
  3. Right click on it and select ‘Take Ownership’
  4. Stand well clear as a CMD type window opens and flashes through the contents of the folder.
  5. When the CMD window disappears, go into the folder and easily retrieve the data files, photos, music, documents, favourites and all.

Wasn’t that easy? Saved you pulling your hair out and cursing Microsoft?

This is what to look for on the website..

Take ownership

There is an ‘uninstall’ zip file too, so you can remove the function from the right click menu, useful if you have multiple users who like to experiment with dangerous utilities..

Smile .

OneNote and XML–finding sections

I recently showed how to find the names of your OneNote notebooks.  The next level down is the section.  You can find these sections in a notebook like this:

 

$onenote = New-Object -ComObject OneNote.Application
$scope = [Microsoft.Office.Interop.OneNote.HierarchyScope]::hsPages
[ref]$xml = ”

 

$onenote.GetHierarchy($null, $scope, $xml)

 

$schema = @{one="http://schemas.microsoft.com/office/onenote/2013/onenote"}

 

$xpath = "//one:Notebook/one:Section"
Select-Xml -Xml ([xml]$xml.Value) -Namespace $schema -XPath $xpath |
foreach {
$node = $psitem.Node

$npath = Split-Path -Path $node.Path -Parent
 
$props = [ordered]@{
   Workbook =  Split-Path -Path $npath -Leaf
   Section = $node.Name
}
New-Object -TypeName PSObject -Property $props
}

 

The first part of the script where the application object is created, the scope set and you get the hierarchy is the same as before.  The two scripts diverge when you get to the Xpath you’re going to use.  To find the notebooks you used:

 

$xpath = "//one:Notebook"

 

which means get me any Nodes called one:Notebook

 

To find the section you use:

 

$xpath = "//one:Notebook/one:Section"

 

which means any nodes called one;Section that are children of a one:Notebook node.

 

Remember XML is case sensitive.

 

Once you have the section nodes – which look like this:

 

name             : Quick Notes
ID               : {9EFAE9AC-0388-424A-8211-02E8FFE50666}{1}{B0}
path             : https://d.docs.live.net/43cfa46a74cf3e96/Documents/Personal (Web)/Quick Notes.one
lastModifiedTime : 2014-09-04T17:48:07.000Z
color            : #B7C997
Page             : {OneNote: one place for all of your notes, OneNote Basics}

 

You can extract the data you want. The path property can be used to extract the name of the note book with a little bit of Split-Path magic.

 

Next time you’ll see how to get down to the individual pages

Microsoft Security Advisory Notification Issued: September 9, 2014

Security Advisories Updated or Released Today

* Microsoft Security Advisory (2755801)
- Title: Update for Vulnerabilities in Adobe Flash Player in
Internet Explorer
- »technet.microsoft.com/library/se···/2755801
- Revision Note: V28.0 (September 9, 2014): Added the 2987114
update to the Current Update section.

* Microsoft Security Advisory (2871997)
- Title: Update to Improve Credentials Protection and Management
- »technet.microsoft.com/library/se···/2871997
- Revision Note: V3.0 (September 9, 2014): Rereleased advisory to
announce the release of update 2982378 to provide additional
protection for users credentials when logging into a Windows 7
or Windows Server 2008 R2 system. See Updates Related to this
Advisory for details.

* Microsoft Security Advisory (2905247)
- Title: Insecure ASP.NET Site Configuration Could Allow Elevation
of Privilege
- »technet.microsoft.com/library/se···/2905247
- Revision Note: V2.0 (September 9, 2014): Advisory rereleased to
announce the offering of the security update via Microsoft
Update, in addition to the Download-Center-only option that was
provided when this advisory was originally released.
Additionally, some of the updates were reissued to improve their
quality. See the Update FAQ for details.

Microsoft Security Bulletin(s) for September 09, 2014

 

Note: There may be latency issues due to replication, if the page does not display keep refreshing

Today Microsoft released the following Security Bulletin(s).

Note: http://www.microsoft.com/technet/security and http://www.microsoft.com/security are authoritative in all matters concerning Microsoft Security Bulletins! ANY e-mail, web board or newsgroup posting (including this one) should be verified by visiting these sites for official information. Microsoft never sends security or other updates as attachments. These updates must be downloaded from the microsoft.com download center or Windows Update. See the individual bulletins for details.

Because some malicious messages attempt to masquerade as official Microsoft security notices, it is recommended that you physically type the URLs into your web browser and not click on the hyperlinks provided.

Bulletin Summary:
https://technet.microsoft.com/library/security/ms14-sep

Critical (1)

Microsoft Security Bulletin MS14-052
Cumulative Security Update for Internet Explorer (2977629)
https://technet.microsoft.com/library/security/ms14-052

Important (3)

Microsoft Security Bulletin MS14-053
Vulnerability in .NET Framework Could Allow Denial of Service (2990931)
https://technet.microsoft.com/library/security/ms14-053

Microsoft Security Bulletin MS14-054
Vulnerability in Windows Task Scheduler Could Allow Elevation of Privilege (2988948)
https://technet.microsoft.com/library/security/ms14-054

Microsoft Security Bulletin MS14-055
Vulnerabilities in Microsoft Lync Server Could Allow Denial of Service (2990928)
https://technet.microsoft.com/library/security/ms14-055

Please note that Microsoft may release bulletins out side of this schedule if we determine the need to do so.

If you have any questions regarding the patch or its implementation after reading the above listed bulletin you should contact Product Support Services in the United States at 1-866-PCSafety 1-866-727-2338. International customers should contact their local subsidiary.

As always, download the updates only from the vendors website – visit Windows Update and Office Update or Microsoft Update websites. You may also get the updates thru Automatic Updates functionality in Windows system.

Security Tool
Find out if you are missing important Microsoft product updates by using MBSA.

Finding out what RAM DIMMs are installed on a computer without opening the box

OK, so I needed to know exactly what RAM was installed on a computer and how many slots there were. I could have had the user shutdown his machine, opened up the box, got out a flashlight, popped out the DIMMs, written down the obscure part numbers, plugged them back in, and closed it up. But not only was that way too much like work, it would totally have disrupted his workday. So, instead, I let PowerShell and WMI do the heavy lisfting. The following script will get the currently installed memory modules, the maximum RAM supported on the computer, and the number slots available.



#****************************************

#

# Script Name: Get-MemoryModules.ps1

#

# Script to get the number of memory slots, and the installed memory, on

# the local computer. Could easily be updated to go against remote computers.

#

# ModHist: 12/29/2012 – initial, Charlie.

#       : 08/26/2014 – Charlie. Added logic to get slots and max RAM.

#       :

#****************************************

$strComputer = “.”

$ComputerName = (hostname)

$colSlots = Get-WmiObject `

               -class “Win32_PhysicalMemoryArray” `

               -namespace “rootCIMV2″ `

               -Computername $strComputer

$nSlots = $colSlots.MemoryDevices

$nMax = $colSlots.MaxCapacity

$gbMax = $nMax/(1024*1024)

$colModules = Get-WMIObject `

                -class “Win32_PhysicalMemory” `

                -namespace “rootCIMV2″ `

                -computername $strComputer

foreach ($objItem in $colModules) {

Write-host “Bank Label: ” $objItem.BankLabel

write-host “Capacity: ” $objItem.Capacity

write-host “Caption: ” $objItem.Caption

write-host “Creation Class Name: ” $objItem.CreationClassName

write-host “Data Width: ” $objItem.DataWidth

write-host “Description: ” $objItem.Description

write-host “Device Locator: ” $objItem.DeviceLocator

write-host “Form Factor: ” $objItem.FormFactor

write-host “Hot-Swappable: ” $objItem.HotSwappable

write-host “Installation Date: ” $objItem.InstallDate

write-host “Interleave Data Depth: ” $objItem.InterleaveDataDepth

write-host “Interleave Position: ” $objItem.InterleavePosition

write-host “Manufacturer: ” $objItem.Manufacturer

write-host “Memory Type: ” $objItem.MemoryType

write-host “Model: ” $objItem.Model

write-host “Name: ” $objItem.Name

write-host “Other Identifying Information: ” $objItem.OtherIdentifyingInfo

write-host “Part Number: ” $objItem.PartNumber

write-host “Position In Row: ” $objItem.PositionInRow

write-host “Powered-On: ” $objItem.PoweredOn

write-host “Removable: ” $objItem.Removable

write-host “Replaceable: ” $objItem.Replaceable

write-host “Serial Number: ” $objItem.SerialNumber

write-host “SKU: ” $objItem.SKU

write-host “Speed: ” $objItem.Speed

write-host “Status: ” $objItem.Status

write-host “Tag: ” $objItem.Tag

write-host “Total Width: ” $objItem.TotalWidth

write-host “Type Detail: ” $objItem.TypeDetail

write-host “Version: ” $objItem.Version

write-host

}

Write-Host “Computer $ComputerName has $nSlots Memory Slots, and a Maximum Memory of $gbMax GigaBytes of RAM” $colModules | ft -auto “BankLabel”,@{Label=”CurrentMem(MB)”;Expression={$_.Capacity/(1024*1024)}},”Speed”

I’ve shown the “local” version of this, but it would be trivial to modify the script to run against a remote computer by adding support for a –ComputerName parameter. Also, at least some computers (most notably laptops) will not report their maximum supported memory correctly. I’ve run this script against the 6 physical computers running here and all worked fine expect for my HP laptop. That has 16 GB of RAM in it, but says the maximum RAM is 8 GB.

Microsoft Security Updates – SEPTEMBER 2014

Critical Security updates to Microsoft Windows, Internet Explorer, Framework, and other products became available on Patch Tuesday.  Users should promptly update to enjoy best levels of protection. So far, no issues encountered in early use after installation.  

https://isc.sans.edu/forums/diary/Microsoft+Patch+Tuesday+-+September+2014/18627

http://technet.microsoft.com/en-us/security/bulletin/ms14-sep

Apple – iPhone6 and other announced products

The iPhone6 and ApplePay were two of most significant product announcements from recent product update cycle:

http://7online.com/technology/live-updates-apples-product-announcement/301057/

http://www.networkworld.com/article/2604369/smartphones/apple-introduces-iphone-6-and-iphone-6-plus.html

Quote: At its big fall event at in Cupertino on Tuesday, Apple unveiled two new iPhones: the iPhone 6 and iPhone 6 Plus. As expected, both new models sport much larger screens than previous versions. The standard iPhone 6 now sports a 4.7-inch display, while the iPhone 6 Plus comes with a massive 5.5-inch screen, putting it squarely in “phablet” territory. Storage on both iPhone models now tops out at 128GB, double the amount of previous models, and cameras have been updated as well.

http://www.networkworld.com/article/2604405/smartphones/applepay-aims-to-replace-your-wallet-with-an-iphone.html

Quote:  Apple’s event in Cupertino on Tuesday wasn’t all about iPhones. CEO Tim Cook also took the stage to launch the company’s new wallet-killer technology, ApplePay.  The new payment process works using NFC (near-field communication) technology, so all you have to do is hold your phone to a sensor at the cash register, then use TouchID to complete the process. ApplePay will be exclusive to the iPhone 6 and 6 Plus, because the new phones are equipped with the requisite NFC radio antenna.

Deploying a Windows service with Release Management

I recently needed to deploy a Windows service as part of a Release Management pipeline. In the past, our internal systems I have only need to deploy DB (via SSDT Dacpacs) and Websites (via MSDeploy), so a new experience.

WIX Contents

The first step to to create an MSI installer for the service. This was done using WIX, with all the fun that usually entails. The key part was a component to do the actual registration and starting of the service

<Component Id ="ModuleHostInstall" Guid="{3DF13451-6A04-4B62-AFCB-731A572C12C9}" Win64="yes">
   <CreateFolder />
   <Util:User Id="ModuleHostServiceUser" CreateUser="no" Name="[SERVICEUSER]" Password="[PASSWORD]" LogonAsService="yes" />
   <File Id="CandyModuleHostService" Name ="DataFeed.ModuleHost.exe" Source="$(var.ModuleHost.TargetDir)ModuleHost.exe" KeyPath="yes" Vital="yes"/>
   <ServiceInstall Id="CandyModuleHostService" Name ="ModuleHost" DisplayName="Candy Module Host" Start="auto" ErrorControl="normal" Type="ownProcess"  Account="[SERVICEUSER]" Password="[PASSWORD]" Description="Manages the deployment of Candy modules" />
   <ServiceControl Id="CandyModuleHostServiceControl" Name="ModuleHost" Start="install" Stop="both" Wait="yes" Remove="uninstall"/>

So nothing that special here, but worth remembering if you miss out the ServiceControl block the service will not automatically start or be uninstalled with the MSI’s uninstall


You can see that we pass in the service account to be used to run the service as a property. This is an important technique for using WIX with Release Management, you will want to be able to pass in anything you may want to change as installation time as a parameter. This means we ended up with a good few properties such as

  <Property Id="DBSERVER" Value=".sqlexpress" />
  <Property Id="DBNAME" Value ="=CandyDB" />
  <Property Id="SERVICEUSER" Value="Domainserviceuser" />
  <Property Id="PASSWORD" Value="Password1" />

These tended to equate to app.config settings. In all cases I tried to set sensible default values so in most cases I could avoid passing in an override value.


These property values were then used to re-write the app.config file after the copying of the files from the MSI onto the target server. This was done using the XMLFile tools and some XPath e.g.

<Util:XmlFile Id="CacheDatabaseName" 
Action="setValue"
Permanent="yes"
File="[#ModuleHost.exe.config]"
ElementPath="/configuration/applicationSettings/DataFeed.Properties.Settings/setting[[]@name='CacheDatabaseName'[]]/value" Value="[CACHEDATABASENAME]" Sequence="1" />
 

Command Line Testing


Once the MSI was built it could be tested from the command line using the form

msiexec /i Installer.msi /Lv msi.log SERVICEUSER="domainsvc_acc" PASSWORD="Password1" DBSERVER="dbserver" DBSERVER="myDB" …..

I soon spotted a problem. As I was equating properties with app.config settings I was passing in connections strings and URLs, so the command line got long very quickly. It was really unwieldy to handle


A check of the log file I was creating, msi.log, showed the command line seemed to be truncated. This seemed to occur around 1000 characters. I am not sure if this was an artefact of the logging or the command line, but either way a good reason to try to shorten the property list.


I  therefore decided that I would not pass in whole connection strings, but just the properties that might change, especially effective for connection strings to things such as Entity Framework. This meant I did some string building in WIX during the transformation of the app.config file e.g.

<Util:XmlFile Id='CandyManagementEntities1'
   Action='setValue'
   ElementPath='/configuration/connectionStrings/add[[]@name="MyManagementEntities"[]]/@connectionString'
   File='[#ModuleHost.exe.config]' Value='metadata=res://*/MyEntities.csdl|res://*/MyEntities.ssdl|res://*/MyEntities.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=[DBSERVER];initial catalog=[DBNAME];integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;' />

This technique had another couple of advantages


  • It meant I did not need to worry over spaces in strings, I could therefore lose the “ in the command line – Turns out this is really important later.
  • As I was passing in just a ‘secret value’ as opposed to a whole URL I could use the encryption features of Release Management to hide certain values

It is at this point I was delayed for a long time. You have to be really careful when installing Windows services via an MSI that your service can actually start. If it cannot then you will get errors saying “… could not be installed. Verify that you have sufficient privileges to install system services”. This is probably not really a rights issue, just that some configuration setting is wrong so the service has failed to start. In my case it was down to an incorrect connection string, stray commas and quotes, and a missing DLL that should have been in the installer. You often end up working fairly blind at this point as Windows services don’t give too much information when they fail to load. Persistence, SysInternals Tools and comparing to the settings/files on a working development PC are the best options


Release Management Component


Once I had working command line I could create a component in Release Management. On the Configure Apps > Components page I already had a MDI Deployer, but this did not expose any properties. I therefore copied this component to create a MSI deployer specific to my new service installer and started to edit it.


All the edits were on the deployment tab, adding the extra properties that could be configured.


image


Note: Now it might be possible to do something with the pre/post deployment configuration variables as we do with MSDeploy, allowing the MSI to run then editing the app.config later. However, given that MSI service installers tends to fail they cannot start the new service I think passing in the correct properties into MSIEXEC is a better option. Also means it is consistent for anyone using the MSI via the command line.


On the Deployment tab I changed the Arguments to

-File ./msiexec.ps1 -MsiFileName "__Installer__"  -MsiCustomArgs ‘SERVICEUSER=”__SERVICEUSER__”  PASSWORD=”__PASSWORD__” DBSERVER=”__DBSERVER__”  DBNAME=”__DBNAME__” …. ’

I had initially assumed I needed the quotes around property values. Turns out I didn’t, and due to the way Release Management runs the component they made matters much, much worse. MSIEXEC kept failing instantly. if I ran the command line by hand on the target machine it was actually showing the Help dialog, so I knew the command line was invalid.


Turns out the issue is Release Management calls PowerShell.EXE to run the script passing in the Arguments. This in turn calls a PowerShell Script which does some argument processing before running a process to run MSIEXEC.EXE with some parameters. You can see there are loads of places where the escaping and quotes around parameters could get confused.


After much fiddling, swapping ‘ for “ I realised I could just forget most of the quotes. I had already edited my WIX package to build complex strings, so the actual values were simple with no spaces. Hence my command line became

-File ./msiexec.ps1 -MsiFileName "__Installer__"  -MsiCustomArgs “SERVICEUSER=__SERVICEUSER__  PASSWORD=__PASSWORD__ DBSERVER=__DBSERVER__  DBNAME=__DBNAME__ …. “

Once this was set my release pipeline worked resulting in a system with DBs, web services and window service all up and running.


As is often the case it took a while to get this first MSI running, but I am sure the next one will be much easier.


Source: Rfennell

Facebook Let 14 year old Kid Use my Email Address for Authorization Multiple Times

 

Subtitle: Facebook, your security still sucks.

 

So last night I get this email:

 Untitled-1

Who the hell is Billy Bowman? And why is he using my email address? And in rapid succession I receive:

 

 Untitled-2

 

 Untitled-3

 

So I say WTF? And *I* am able to login to this account “with my Hotmail credentials” and change the password on this account. I see that Billy is in a chat telling some girl he is 14 years old. (I concurrently change my hotmail password just in case, but this kid is NOT accessing my email).

 

 Untitled-4

Then I deactivate the account because I can’t switch the email address.

 

 Untitled-5

So even though I’ve changed the password on the account in question, Billy is able to reactivate it.

 

 Untitled-6

 

So now, I login to the Billy account and change the primary email address to the other address the kid has listed. I remove my email address from the Billy account.

 Untitled-7

So FB sends me a message…

 

 Untitled-8

And Billy tries to add it back

 

 Untitled-9

So I log in to the Billy account to insure the address is gone and log into my own account and quickly add that email address to my own Facebook account. And Facebook warns Billy that someone may have accessed his account and sends ME the email notification.

 Untitled-10

So Billy tries to change the password on his account. I’m ignoring these requests.

 

Untitled-11

Jawbone UP24 Firmware Update Doubles Battery Life to Last 14 Days

 

It’s probably not coincidental that on the day Apple is expected to announce details of their health and fitness platform and probably some tie in with the Mayo Clinic, if rumors are to be believed, that the Jawbone folks launched a firmware update that doubles the battery life of their latest generation fitness band, the UP24 from 7 days to 14 days (according to their marketing claims).

The front page on the Jawbone blog simply states:

 14 days

 

You’ll need to head over to https://jawbone.com/up/updater/download/windows (there’s a ink to the Mac updater as well) and grab the updates and run it. It’s wizard based, so just follow the prompts and you’ll see:

 up24.1

 

 up24.2

 

 

When the update is complete, you’ll be prompted to sync (with your iPhone as there is no Windows App) and then to completely charge your UP24.

 

I wish Jawbone would build a Modern Windows UI app (and I’m sure others would like a Windows Phone App. Fitbit has built a Modern UI app, and while it is a Bluetooth Sync protocol, the Fitbit dongle, a small USB thin, is required as it still doesn’t sync natively.

Data Breach – Home Depot security compromise confirmed

Forensic investigations have confirmed security controls at Home Depot were compromised (stock price has fallen by 4% since reports surfaced). Article also reflects additional data breaches were reported in recent days, by grocery chain Supervalu, UPS Stores Inc. and Dairy Queen.

http://www.computerworld.com/article/2604360/home-depot-confirms-breach.html

QUOTE:  After nearly a week of investigation, Home Depot on Monday confirmed that intruders had indeed broken into its payment networks and accessed credit and debit card data belonging to an unspecified number of customers who shopped at its U.S. and Canadian stores.

The statement announcing the breach did not detail the number of stores affected or the total number of cards compromised. It merely noted that the company is looking into the possibility that the breach occurred in April.  Home Depot also said there is no evidence that debit card personal identification numbers (PIN) were compromised. Nor is there evidence the breach affected any Home Depot stores in Mexico or purchases made online at the company’s website.

The company added that it has been working around the clock to mitigate the situation since being told about the breach last Tuesday.  “We apologize for the frustration and anxiety this causes our customers,” Frank Blake, chairman and CEO of Home Depot, said in the statement. “We owe it to our customers to alert them that we now have enough evidence to confirm that a breach has indeed occurred. It’s important to emphasize that no customers will be responsible for fraudulent charges.”

Since news of the breach went public, Home Depot’s stock price has fallen by about 3%, from $93.11 per share last Tuesday to $90.82 on Monday. After the company confirmed the breach late Monday, its share price dropped by nearly another percentage point in after-hours trading

Recent Comments

Archives