Friday, June 26, 2009

Microsoft Windows DHCP Team Blog : How to prevent address exhaustion from Secondary Server in split-scope deployment

DHCP gets a lot of new, much-wanted, features in Windows Server 2008 R2. For instance in split scope scenario (80/20), the server with the 20% will run out of addresses. To avoid this, the response can be delayed and thus most leases will come from 80% server. Read more in the team blog.

Microsoft Windows DHCP Team Blog : How to prevent address exhaustion from Secondary Server in split-scope deployment

Master List of Windows 7 Keyboard Shortcut

A useful list of how to manage Windows 7 from the keyword. Win+number and Win+Shift+Left/Right are very cool.

Master List of Windows 7 Keyboard Shortcut | Windows 7 News

Response Group Configuration Tool not working properly ?

When you try to create a new Workflow in the Response Group Configuration Tool, you do not see the standard templates (just an empty list)

This is a problem related specifically to Windows Server 2008 and is caused by SPN names not always being registered correctly (In our labs it is maybe 1/3 of the computers experiencing the problem).

First you should check if you’re server names are registered correctly

SetSPN –L <OCSFE host name>

If you don’t see two http/<OCSFE host name> registrations then you should create them as follows

SetSPN –A http/<OCSFE host name> <OCSFE host name>

SetSPN –A http/<OCSFE FQDN> <OCSFE host name>

and then you can use SetSPN –L again to check that the records have been created correctly.

Second you should check that the account you are using is a member of the RTCUniversalServerAdmins (This group works, I haven’t tested if less administrative rights can do the same), if it isn’t then add it and Voila you should

Courtesy to Alex Lewis for providing part of the solution (He also recommends a 3rd step “open the IIS Admin tool. Open up the deploy virtual directory and choose authentication in the middle pane. Choose Advanced Settings from the action pane. From here, check the Enable Kernel Mode Authentication box.” – but this hasn’t been necessary in the places where I have seen the problem.

Wednesday, June 03, 2009

Finally Groove file synchronization working on x64 …

I have finally solved the problem of getting Groove file synchronization to work on 64-bit Windows -

image

As you can see I’m running x64-based PC and my groove is syncing 553 MB to my colleagues/other computers.

The only catch is that it’s a workaround rather than a solution ;-) I am “seamlessly” integration a 32-bit Windows 7 installation running in Windows Virtual PC Beta that you can download from here. If you don’t want to bother installing Windows 7 in your guest, then the Virtual XP supplied from Microsoft as VHD installation works as well.

It’s not new that you can solve Groove filesync by running a 32 bit Virtual guest system, the new feature with Windows Virtual PC is that it runs as an virtualized application that have the look and feel of all my other applications and that can be started as an application in my startup folder ;-)

Also until now, even with the rather slow CPU on my Lenovo X301, I haven’t seen any performance hit on the host computer and I have been running all of my usual applications (5-6 PowerPoint's, IE8, Outlook, Office Communicator, MyMobiler etc.) and demoing UC for my students this week (Of course 4 GB of ram helps, but still …).

Monday, June 01, 2009

Little neat “trick” in Communicator Mobile

(With the chance of exposing how little I know about the Mobile client and/or how much of the user documentation that I have actually read).

This is the screen you get when you are logged on to Communicator Mobile on your device -

Available

So when I want to change my status and or sign-out I have until now single-clicked the “Available” icon, waited for the application to start and then signed out/changed status.

What I have recently figured out is that you can click-and-hold to get a menu like this -

image

The same is of course possible when you are logged out -

image

And here is a small trial with a video showing the process -

Friday, May 29, 2009

A little tip for the Road Warrior

Off topic but relevant to travelling consultants/trainers ;-) The World Electric Guide contains an Electric Power guide that I check each time I’m delivering Voice Ignite’s and/or UC R2 Boot Camps in a new country. It is simple to use and contains images of different adaptors/outlets for each country. At the main page you will also find guides for International dialing, Internet roaming and much more ;-)

Wednesday, May 20, 2009

Live Mesh Logs

If you are using Live Mesh, you may want to dig deeper into what it is really doing. To do so, I just found some interesting log files.

Mesh has a trace/activity log placed in C:\users\*\appdata\local\microsoft\live mesh\gacbase\Moe-*-*-*-YYYY-MM-DD-*.log. It seems to log quite a bit of information, so expect huge log files.

The file is a kind of CSV-file, but without headers. Luckily, Import-Csv in PowerShell V2 has a –header arguments, so you can decode the file using -

dir *.log | import-csv -header Date,Severity,Component,Number1,Number2,Number3,Message







As you can see, I have no clue as to what numbers 1 to 3 are for, but please comment, if you know.

Wednesday, May 13, 2009

Windows 7 RC on the Lenovo S10e

A bit off topic from our normal posts on msgoodies, but though I'd share this anyhow, as some folks might find it useful.

I've found the Lenovo S10e to be pretty much the perfect netbook for me when travelling. So naturally, once the Windows 7 Release Candidate became available, I went and installed that on the box.

Now, this poses a few challenges, as the only official Lenovo-supported OS for this machine is Windows XP Home Edition. Most things work straight off the bat, but one thing was missing - hotkey support.

Now, hotkeys actually work for some functions - volume & brightness, for example. But you do not get the ability to turn wireless and bluetooth on or off, and you don't get any OSD indicators of the actual hotkey actions. So this is really something you want working on the machine under Windows 7 RC

Couple of things you should know about the software for the S10e. There is no standalone hotkey application - this functionality is part of the energy management application / driver set.

Initially, I tried installing the XP energy management drivers / application, but no joy - didn't work. In some cases, it would work initially, but after a reboot, OSD functionality was lost.

After some digging around on the web, what I found was this: You want Lenovo's Energy Management application, version 3.1.5.2. Once you install this, hotkeys & OSD function as intended - also after rebooting the machine. Furthermore, it is a native Vista application, so you won't need to run it in any sort of compatibility mode.

Being a sucker for eye candy, I think the OSD display is also a lot nicer than the included XP version as well ;-)

So, where to find Lenovo Energy Management 3.1.5.2?

Go here: http://consumersupport.lenovo.com/en/DriversDownloads/drivers_show_678.html

Virtualization with OCS 2007 R2

Quick goodie - As expected/promised all roles except those handling Audio/Video are supported – read more at the Communications Server Team blog in the blog post Office Communications Server 2007 R2 Virtualization.

Thursday, April 30, 2009

Windows 7 RC publicly available on MSDN/TechNet

So Windows 7 RC should be available at TechNet and MSDN on Subscriber Downloads beginning from 6:00 AM Pacific Time or 15:00 CET time. The only problem right now seems to be that both Subscribers Download sites are down currently (But luckily connect.microsoft.com is running, so I have it fully downloaded in a few moments ;-)

Anyway – here’s the news for you. I have been running Windows 7 for quite a while now and it the perfect mix of speed from Windows XP and features (and more) from Windows Vista ;-)

Are there types of files or folders that I cannot share or synchronize with Live Mesh?

Yes – read here.

I normally use Jungledisk for cloud-based storage but in certain scenarios Live Mesh is better: Sharing with others and when I have to synchronize files from a place where I do not want to use my JungleDisk encryption keys. JungleDisk encrypts data before they leave the computer.

BTW, I tested Live Mesh with an EFS-encrypted file. As it can read the file, it simply meshes the file up – so beware that you do not compromise security – and remember that Microsoft can read your data.

JungleDisk will not copy the file, but that may simply be a side effect, as JungleDisk runs as a service and thus does not have access to my EFS-decryption keys.

Get-Packet, a Packet Sniffer for PowerShell

This guy, Robbie Foust, wrote just that – I’m deeply impressed. Read more/get it here.

PS. Remember that Netmon 3.3 was recently released. Get that here.

How to upgrade from Windows 7 pre RC builds to RC

While waiting for the RC build, I just wanted to provide you with a little trick. By default only upgrades from Vista to Windows 7 RC is supported (So Microsoft get as much feedback as possible on the Vista upgrade scenario).

If you don’t have the time/incentive to wait for the downgrade to Vista and then an upgrade to the RC build (in my case I have three Vista machines and two Windows 7 machine that I will upgrade, so Microsoft will still get their feedback) then you can use this little trick -

Here’s what you can do to bypass the check for pre-release upgrade IF YOU REALLY REALLY NEED TO:

  1. Download the ISO as you did previously and burn the ISO to a DVD. (See later comment)
  2. Copy the whole image to a storage location you wish to run the upgrade from (a bootable flash drive or a directory on any partition on the machine running the pre-release build).
  3. Browse to the sources directory.
  4. Open the file cversion.ini in a text editor like Notepad.
  5. Modify the MinClient build number to a value lower than the down-level build. For example, change 7100 to 7000 (pictured below).
  6. Save the file in place with the same name.
  7. Run setup like you would normally from this modified copy of the image and the version check will be bypassed.

clip_image002

These same steps will be required as we transition from the RC milestone to the RTM milestone.

The above is a snippet from from the Engineering Windows 7 blog post called Delivering a quality upgrade experience.

And of course in Step 1/2 you could just mount the ISO image using Daemon Tools version 4.30.4 (or higher) that supports Windows 7 and extract it to your preferred location.

Wednesday, April 29, 2009

Office 2007 Service Pack 2 released

It's finally out.

Get it here : http://www.microsoft.com/downloads/details.aspx?FamilyID=b444bf18-79ea-46c6-8a81-9db49b4ab6e5&displaylang=en

Lots of fixes - and Outlook in particular is much more responsive. Outlook-specific fixes and improvements detailed here: http://support.microsoft.com/kb/968774/

Happy downloading!

Sunday, April 26, 2009

OCS 2007 R2 Edge Certificate Wizard gotcha

During a recent customer deployment of OCS 2007 R2, we came across a small issue that might be relevant for some of you.

We were using the OCS 2007 R2 Edge Server setup wizard to request certificates for the external interfaces. This particular customer uses GoDaddy for their certificates. We created an offline request and pasted the CSR into GoDaddy's request interface - and were promptly told that the CSR was not valid.

What we discovered was this: The customer's OCS R2 Edge server was running Windows Server 2008. When we created the certificate request using the setup wizard, the -----BEGIN CERTIFICATE REQUEST----- header and -----END CERTIFICATE REQUEST----- trailers were not inserted into the file. This was what threw the error when we pasted the CSR into GoDaddy's interface.

To solve this and be able to get our certificate from GoDaddy, we simply pasted correctly formatted header and trailer lines into the CSR, which was then accepted as a proper CSR file.

If OCS R2 Edge is deployed on Windows Server 2003 R2, the certificate request header and trailer is inserted into the request file generated by the setup wizard, so the issue looks to be specific to deployments on Windows Server 2008.

It is worth noting that if you use IIS on Windows Server 2008 to create an SSL certificate request, the -----BEGIN CERTIFICATE REQUEST----- and -----END CERTIFICATE REQUEST----- lines are included in the generated CSR file - so "normal" IIS certificate requests created on Windows Server 2008 are not affected.

Friday, April 24, 2009

How to install Exchange 2010 and Exchange 2010 UM

If you want to play with Exchange 2010 UM, then here are two links on two different blogs that will help you -

How to Install Exchange Server 2010 Beta

How to Install Exchange Server 2010 Unified Messaging Beta

Happy installing ;-)

Friday, April 17, 2009

Regex – Still a Lot to Learn…

I though I was pretty good with Regex’s  - but just realized that even if I use it a lot – there are still a lot of things to learn. And Regex (I’m using the .Net version) is very powerfull.

The other day, I was searching for some useful regex’s, as I wanted to test for invalid email domain – e.g. the positive ones should be matched and the rest should be trapped. During this search, I stumbled across RegexBuddy and I decided to spent the €30 to buy it. And that had really sped up my learning! After getting the grips for the interface, it is very useful. First of all, no more repetitious string –replace pattern from PowerShell. Now everything is shown in color – live – and you can trace things down and even build the thing using graphical bricks.

So what have I learned so far?

Replacing each space in the start of a string/line – e.g. replace leading spaces with &nbsp; – is easy (now) -

$line -replace '(?<=(^ *)) ','&nbsp;'



 






Splitting a distinguished name – taking escaped characters into account – also simple -




# PowerShell V1
[regex]::split($dn,'(?<!\\),')
# PowerShell V2 CTP3
$dn -split '(?<!\\),'





And how about writing a CSV with another delimiter than comma in PowerShell V1. I did a Convert-TsvToCsv earlier and have also written Export-Tsv (not published). But it can be done so easy with a regex that I’m almost ashamed over all the work I have done -




function Export-DelimitedFile($file,$delimiter=";") {
$work=Join-Path $env:temp ($myinvocation.mycommand.name + $pid + ".temp")
$input | Export-Csv $work
(type $work) -replace '("[^"\r\n]*")?,(?![^",\r\n]*"$)',"`$1$delimiter" | out-file $file
}





Have so much regex fun!

Wednesday, April 15, 2009

Making PowerTab 0.99 Beta 2 work on PowerShell V2 (CTP3)

Being very fond of PowerTab, it has been a loss that it did not work for PowerShell V2. But it turns out to be very simple to fix the problem. It fails as the parameter signature for $host.ui.rawui.NewBufferCellArray seems to have changed in V2.

Fixing the problem is a matter of changing two lines in <PowerTabDir>\TabExpansion.ps1. The old line is commented out -

#      $message = $host.ui.rawui.NewBufferCellArray(@('[Tab]'),'Yellow','Blue')
$message = $host.ui.rawui.NewBufferCellArray(@('[Tab]'),[consolecolor]::Yellow,[consolecolor]::blue)





and




#      $message = $host.ui.rawui.NewBufferCellArray(@('[Err]'),'Yellow','Red')
$message = $host.ui.rawui.NewBufferCellArray(@('[Tab]'),[consolecolor]::Yellow,[consolecolor]::red)




Have fun!

 



PS: It does not work in ISE

Friday, April 10, 2009

Want to dial 1-800-flowers or 1-866-MSONLIN from OC ?

Many don’t realize that this is possible from Office Communicator (RTM or R2) – allthough I have showed it to the students at most of my boot camps.

OC according to my testing supports what is called E.161 mapping of characters to numbers (also known as ANSI T1.703-1995/1999, and ISO/IEC 9995-8:1994 or most probably similar to what you see on your mobile phone), so if you write e.g. +1800flowers in your OC client it will look like this -

image

The only rule is that you have to start with  a number, otherwise the client will think that you are trying to lookup a person in the Address Book.

As you may know Microsoft supports RFC3966 and here is what the RFC says about this (Thx to Dennis Klama for this pointer) -

5.1.2.  Alphabetic Characters Corresponding to Digits

   In some countries, it is common to write phone numbers with alphabetic characters corresponding to certain numbers on the telephone keypad.  The URI format does not support this notation, as the mapping from alphabetic characters to digits is not completely uniform internationally, although there are standards [E.161][T1.703]   addressing this issue.

What happens in OC, is that the character/number mapping is taking place client side and therefore the actual URI only consists of numbers.

Furthermore, my testing shows that OC supports the International standard for character to number mapping, but you should be aware that different countries in the past have had different regional implementations of the mapping. Furthermore the use of vanity numbers is unusual in Europe.

For your reference I have created a table mapping of characters/numbers that OC and E.161 uses

abc def ghi jkl mno pqrs tuv wxyz
2 3 4 5 6 7 8 9

Automated Maintenance of Directory Service Restore Mode Password

With Windows Server 2008 SP2 or SP1/RTM with hotfix KB961320 you can make administration of the DSRM password completely automatic. The approach is this: You create an unprivileged account in Active Directory, set the password and using a scheduled task you execute the new sync from domain account xxxx command.

This nice approach is documented in the Directory Services blog. Read the complete story here.

Thursday, April 09, 2009

MVP for yet another year ;-)

Dear Dennis Thomsen,

Congratulations! We are pleased to present you with the 2009 Microsoft® MVP Award! This award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others.

At Microsoft, we believe that technical communities enhance people’s lives and the industry’s success because independent experts, like you, help others extract greater value from products and technologies through the free and objective exchange of knowledge. As a Microsoft MVP, you are part of a highly select group of experts that represent technology’s best and brightest who share a deep commitment to community and a willingness to help others.
On behalf of everyone at Microsoft, thank you for your contributions to technical communities.

Thank you to Microsoft for the award, I really appreciate working with Microsoft and getting access to the information and resources that the MVP award opens up for.

More information about the ability to NAT the R2 A/V Edge Service (So no public IP is needed)

Stumbled over this excellent article with good information on how to setup the R2 A/V Edge, firewall for SNAT’and DNAT etc. It includes nices captures of the SIP traffic / candidates so it’s well worth the read. Read the post from Rick Varvel here - Configuring R2 A/V Edge Service for NAT.

Connectivity information in OC 2007 R2

My colleague, Claus-Ole, just pointed me to a neat trick that I didn’t know of. In OC you can, like in Microsoft Outlook 2007, press Ctrl key while right-clicking the OC Icon and voila up comes a menu item called “Configuration information” -

Configuration Information

Where you get a lot of information on your connection type, autoconfiguration ABS download etc. Read more about this neat little feature at the source Office Communicator Configuration Information.

Tuesday, April 07, 2009

PowerShell, Getting the Value Out of a ScriptBlock

When you are doing a little advanced scripting and passing scriptblocks around, one of the problems I encountered was how to execute the scriptblock in a pipeline and get the value out of it. Say you want the user to be able to enter a scriptblock and compare your data to the value returned from it – how is that done?

Executing a scriptblock is easy using the &-operator

$sb={"Hello World!"}
&$sb





 



You can also use the invoke method -




$sb.invoke()





If you want to have a filtering scriptblock e.g. comparing a value with a scriptblock (not its value), I found it easy and logical to use where(-object) -




$sb={$_.name –like ‘note*’}
dir $env:windir | where $sb
# or
if (dir $env:windir | where $sb) {"Slipped through filter, go on"}





But what if you want to execute it, feeding in values from the pipeline to get new values? (Often you would only send in one value at a time). The answer is foreach(-object) -




$sb={$_.name.toupper()}
dir $env:windir note* | foreach $sb





When can this be useful? In numerous places, I would say. What if you have some getter script, with these arguments -




Get-XXX –dateproperty <property>
–value <value|scriptblock>
filter <scriptblock>





 


If this case the code is something like (pseudo code) -




get-object | where &$filter| foreach {
if ($value –is [scriptblock]) {
$compareto=$_ | foreach $value
else {
$compareto=$value
}
if ($_.$dateproperty –gt $value) {
“ok”
}
}



 


The user can then either stick it a value or calculate a value using the scriptblock – and that based on the data from the object itself and before the comparison is made -



# Getting files accessed after January 1st
get-xxx–dateproperty lastAccessTime –value ([datetime] "2009-01-01")
# Getting files accessed 90 days after it was modified
get-xxx–dateproperty lastaccesstime –value {$_.lastwritetime.adddays(90)}





The latter example was not possible without parsing a scriptblock.

SharePoint Designer 2007 is now free

Get it here.

What is REST?

Came across the acronym while I saw an Azure presentation. REST is Representational State Transfer but I’m not going to explain it in detail as I found this page, which explains it well. A 5 minute read.

Saturday, March 28, 2009

Free PowerShell eBooks

Just read/browsed two free PowerShell eBooks and here are my comments -

  • Frank Koch, Two books, An introduction for people with no real background knowledge and Administrative tasks. Available in German and English (only read the English version – even though I do read German). Worth a read – especially if you are new or still trying to get it. The latter covers a lot of the free add-ons you can get. The German shines through in some places in the English version, but I do not think that is too big a problem.
  • Keith Hill, Effective Windows PowerShell, 50 pages. You should read this if you have some knowledge of PowerShell. It covers the most important topics and goes quite deep into output formatters and parsing modes. Even longtime users may learn a few tricks. This books was updated March 2009 with some PowerShell v2 information.

Happy reading!

Friday, March 27, 2009

MUI for Office Communicator 2007 R2 available on TechNet

Late yesterday, the Multilingual User Interface (MUI) Pack for Office Communicator 2007 R2 was released for download on Microsoft Technet.

The following languages are included in the MUI:

Arabic
Bulgarian
Catalan
Chinese - Simplified
Chinese - Traditional
Chinese Hong Kong
Croatian
Czech
Danish
Dutch
English
Estonian
Finnish
French
German
Greek
Hebrew
Hindi
Hungarian
Italian
Japanese
Korean
Latvian
Lithuanian
Norwegian
Polish
Portuguese (Portugal)
Portuguese (Brazil)
Romanian
Russian
Serbian
Slovak
Slovenian
Spanish
Swedish
Thai
Turkish
Ukrainian

Get it here: http://www.microsoft.com/downloads/details.aspx?FamilyID=E7871DCD-8173-4866-A0C2-AF8659092ACC&displaylang=en

Thursday, March 26, 2009

Office Communications Server 2007 R2 Management Pack for System Center OpsMgr 2007 SP1

Just a quick note to let you know that the OCS 2007 R2 Management Pack for OpsMgr 2007 SP1 is now available for download.

Get it here:

http://www.microsoft.com/downloads/details.aspx?FamilyID=0FCA3752-76D4-42F3-9241-A663E40C1E2C&displaylang=en

Wednesday, March 25, 2009

Get-OpenFile

One of the many nice things about PowerShell it that you can use the existing utilities you’ve got and you love. And then you can enrich them using PowerShell. You do this best by converting the output to objects – which you then can use down the pipeline.

One such example is here. Handle.exe (sysinternals.com) returns open files (and other handles). If you wrap that with a script, you can convert the output to objects and then manipulation is so easy.

Here is Get-Openfile.ps1

param($fileFilter=$(throw "Filter must be specified"))

handle $fileFilter | foreach{
if ($_ -match '^(?<program>\S*)\s*pid: (?<pid>\d*)\s*(?<handle>[\da-z]*):\s*(?<file>(\\\\)|([a-z]:).*)') {
$matches | select @{n="Path";e={$_.file}},@{n="Handle";e={$_.handle}},@{n="Pid";e={$_.pid}},@{n="Program";e={$_.program}}
}
}





Handle must be found via $env:path or an alias. Note the use of –match and $matches and how a regex is used to match the output and easily pick up the relevant parts of the output using names. One advice: Learn regex!



An example




PS C:\Windows\PolicyDefinitions> get-openfile  er.exe

Path Handle Pid Program
---- ------ --- -------
C:\Windows\System32\en-US\... 38 7004 SearchIndexer.exe
C:\Windows\en-US\explorer.... 38 5764 explorer.exe
C:\Windows\SysWOW64\en-US\... 50 8484 explorer.exe



 



I originally called the Path property for File, but to bind the value automatically (in the pipeline), I renamed it to path.



This is nice -




PS> get-openfile  er.exe | dir

Directory: C:\Windows\System32\en-US

Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 27-05-2008 09:17 7680 SearchIndexer.exe.mui

Directory: C:\Windows\en-US

Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 02-11-2006 16:12 27136 explorer.exe.mui

Directory: C:\Windows\SysWOW64\en-US

Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 02-11-2006 16:12 36864 explorer.exe.mui



 


 



And this is just as nice -




PS> get-openfile  er.exe | gps

Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
------- ------ ----- ----- ----- ------ -- -----------
1554 33 178276 107420 622 863,72 7004 SearchIndexer
957 87 74504 82528 356 465,01 5764 explorer
513 32 28768 34044 203 28,27 8484 explorer



 



I use the method in Get-OpenFile a lot as that provides many advantages.



 







PS. You must be administrator to run handle. Get-OpenFile simply does not return any objects if you are not an admin. Handle.exe does not set $? or $lastexitcode, so checking for the condition is not easy.



PS2. Handle.exe can also display the user name and close handles (Remove-Openfile?). It is left to the reader to implement that. Handle.exe does not display files opened across the network. –a can do that, but the path is a strange \Device\Mup path, so it is excluded.

Strange Select-Object Behavior in PowerShell V2 CTP3

In PowerShell v1, the rules are as follows -

  • Select-Object used with –first or –last do not change the object type of the objects passing through
  • Select-Object selecting properties or adding changes the object type to PSCustomObject

Proof -

PS> gps -id $pid | Get-Type # Normal
System.Diagnostics.Process
PS> gps -id $pid | select name,ws | Get-Type # PSCustomObject
System.Management.Automation.PSCustomObject
PS> gps -id $pid | select name,ws | select | Get-Type # PSCustomObject
System.Management.Automation.PSCustomObject
PS> gps -id $pid | select * | Get-Type # Normal (errors are left out)
System.Management.Automation.PSCustomObject
PS> gps -id $pid | select | Get-Type # Normal
System.Diagnostics.Process



 



In PowerShell V2 CTP3 the rules seem to be -




  • Select-Object used with –first or –last works as in V1


  • Select-Object, selecting properties or adding properties, creates a new type called Selected.<originaltype>


  • Select-Object resulting in a Selected.<type> will be turned into a Selected.System.Management.Automation.PSCustomObject! Very strange and very problematic in real-life use



Examples, showing it -




PS> gps -id $pid | Get-Type # normal
System.Diagnostics.Process
PS> gps -id $pid | Select name,ws | Get-Type # Selected.<type>
Selected.System.Diagnostics.Process
PS> gps -id $pid | Select name,ws | Select | Get-Type # Selected...PSCustomObject
Selected.System.Management.Automation.PSCustomObject
PS> gps -id $pid | select | Get-Type # normal
System.Diagnostics.Process
PS> gps -id $pid | select | select | Get-Type # normal
System.Diagnostics.Process
PS> gps -id $pid | select -f 1| select | Get-Type # normal
System.Diagnostics.Process
PS>



 



PS. Get-Type is not a built-in, but this function -




function Get-Type($inputObject) {
process { if ($_ -is [object]) {$_.PSTypeNames[0] } }
end { if ($inputObject -is [object]) { $inputObject.PSTypeNames[0] } }
}

PowerShell V2 CTP3 – Compatibility Problem - $MyInvocation

In PowerShell v1, you can use $MyInvocation.invocationname to test whether a script was dot-sourced or not.

This works in V1

if ($myinvocation.invocationname -ne ".") {
throw "Script should be dot-sourced to make this work"
}



but it not work in V2, and I cannot find a work-around :(




PS> '"invocation=" + $myinvocation.invocationname' | sc $env:temp\test.ps1
PS> &$env:temp\test.ps1
invocation=C:\Users\po\AppData\Local\Temp\test.ps1
PS> . $env:temp\test.ps1
invocation=C:\Users\po\AppData\Local\Temp\test.ps1
PS> # does it work when an alias is used?
PS> new-alias test $env:temp\test.ps1
PS> test
invocation=test
PS> . test
invocation=test



 



Update: Posted the problem on connect. MS has already closed my report with a 'fixed', so let's hope that is the case.

Monday, March 23, 2009

ILM “2” will ship in Q1 2010

According to my colleague, Risto Pedersen. He heard it at the keynote at TEC 2009 in Las Vegas.

Wednesday, March 18, 2009

Jeffrey Snover - Distinguished Engineer

Jeffrey, the father of PowerShell, got appointed Distinguished Engineer - well deserved. Read more here.

Monday, December 22, 2008

Viewing the downloaded Address Book file in readable format

For troubleshooting reasons I have often looked in the garbled ABS file (GalContacts.db) that is downloaded to the Office Communicator client in the %userprofile%\appdata\Local\Microsoft\Communicator\ folder. I just stumbled over this tip for creating a version of the ABS file in CSV format that is saved in "My Received Files".

Set the following registry key to enable the CSV file creation and then restart Office Communicator.

[HKEY_CURRENT_USER\Software\Microsoft\Communicator]
"DumpContactstoCSVFile"=dword:00000001

View Jeff Schertz full tip (with screenshots) in his post Viewing the OCS Address Book (for Humans).

Sunday, December 21, 2008

Office Communications Server 2007 R2 is RTM'ed

On the 19th of December Office Communications Server 2007 R2 was Released To Manufacturing (Build 6907), so it is in good time for the official launch on February 3rd.

We have been working with R2 since the Beta and are currently working hard to develop our material for our 4 days on-site Voice training delivered on R2 (Now based on RC, but will be updated to RTM before the first trainings start in January). Our new training will include training on all aspects of R2, but as usual with a special focus on Voice integration.

image

New in this version are a lot of things like telephony enhancements and new clients including the Attendant Console (A group based switchboard solution) an updated "Office Communicator for Windows Mobility R2" (Nicknamed CoMo) that includes phone state on mobile phone calls and One Number features (I will do a review of this client later), Dial-in conferencing support (Including CWA support for external clients) and of course enhancements to the overall architecture (Including a move to a 64 bit Server platform) and not least an updated CWA that now supports Desktop Sharing also for external users and non-Microsoft browsers ... and much, much more that I will talk about later (Or that you can find at other blogs).

The official launch of Office Communications Server 2007 R2 will be a soft launch and Inceptio (the company I work for) is participating as a sponsor for this event, that you can sign up for here.

What will we do in terms of spreading the word on R2?

I have had plans to publish information on R2 earlier, but I didn't since it was hard to determine what information was OK to publish and what was not (And I like my MVP benefits to much too risk it). I will now start posting information on R2 starting with the new Windows Mobility client.

Furthermore I will be speaking at Exchange Connections (March 15-18 2009) and I currently have three sessions (Subject to change).

OCS 2007 R2 from PowerPoint to Reality

So you have seen all the nice presentations and demos from Microsoft on Unified Communications and bought the idea!? As you probably guessed, it usually is a tad more complex than the marketing slides tries to convince you, so in this session I will give you the tricks for implementing OCS 2007 R2 in your organization successfully. After this session you will know where to focus your attention before, during, and after your deployment project, including advice on where to focus your attention in terms of the organizational implementation.

Tips and Tricks for Maximizing Your Investment in Unified Communications
So you have OCS 2007 R2 and/or Exchange 2007 implemented in your organization and you are starting to realize your investment by using presence, click-to-dial, one Unified Messaging inbox etc., but maybe you want even more ROI on your investment? In this session we will do a lap around the platform and look under the hood for developers. We will look at and demonstrate how to integrate business processes with Exchange 2007 SP1 Web services, how to build services that manage communications, and also take a look at Windows Workflows that talk and IM.

What Does it Take to Voice-Enable Your OCS 2007 R2 Deployment?

How do you provide OCS 2007 R2 and Exchange with its own voice? This session will focus on all the voice capabilities of OCS and Exchange. We’ll discuss the possible scenarios and how to enable them in your environment. This will include detailed discussions on the actual capabilities of the different solutions and based on experience from real-life deployment the efforts required to implement and maintain the different voice scenarios ranging from a pure standalone Enterprise Voice scenario to a full PBX and UM integrated dual forking scenario.

See all of the sessions here.

Lastly we have our training sessions including 2-4 day (based on previous experience) OCS 2007 R2 Voice Boot Camps that we deliver on-site in Europe, both as open and closed training sessions. They Include level 3-500 training on OCS 2007 R2 infrastrucutre and Voice related subjects and we bring a full lab environment including powerful portables, network, telephony equipment (E.g. Nortel CS1000, Gatewasy and/or soft PBX) wideband GN2000 headsets, and much more. The newest addition to this is our 2-day developer training on R2/Exchange 2007 SP1 (Get more info in this by contacting me at my.initials@inceptio.dk).

So I guess 2009 will be yet another busy year ;-)

CU out there !

Tuesday, December 16, 2008

WM 6.1, AccuWeather and Schap's Advanced Config

Just upgraded my HTC Touch Dual to Windows Mobile 6.1 and were doing all my settings again. One program I used to have was Schap's Advanced Config (SAC) but in v1.1. From the site, I got v2.0 and that had a nice new feature: You can change the location used by the weather forecast application. My problem was that Billund, Denmark could not be chosen from the list, but by finding Billund at www.accuweather.com, I could get the city code EUR|DK|DA008|BILLUND from the URL and specify that using SAC. Now the weather app shows the correct forecast :)

Friday, December 12, 2008

Matching multi-line text and converting it into objects

Sometimes your input is simply text and you have to work with it. If it is line-based e.g. each object is a separate line, it is not so hard, but what if the output is very dynamic and the information you need to combine spans multiple lines? In this case, you could start making some kind of state machine e.g. when the starting point is reached, set a variable, save data as you go and when the ending point or the next starting point is reached, construct the object and emit it to the pipeline so it can be used.

Well, there are better ways and in this example, I'll combine these things to make is much more straight-forward and generic -

  • Use regular expressions (regex) for matching the information you want
  • Show how to construct a regex in a readable way spanning multiple lines and containing comments
  • Using a dynamic approach, where the named captures in the regex are automatically converted into properties on the output object. This means that you only have to specify the name one, the loop processing the matches is totally generic and can be reused.

The examples uses output from repadmin /showrepl, but this is just an example I picked up more or less randomly. The idea here is to show the use of regex and converting the result to objects, the idea is not to create a bullet-proof parser of the output from repadmin /showrepl.

Here's the example -

# Define some text, in this case the text is stored in $text, but
# is could come from anywhere

$text=@'
DC Options: IS_GC
Site Options: (none)
DC object GUID: aff429b7-5694-4bda-ae4a-daa7d371ce0f
DC invocationID: b578e349-5846-46c5-8e01-b4a81d609e27
==== INBOUND NEIGHBORS ======================================
DC=company,DC=org
BLL\045ADDC001 via RPC
DC object GUID: 26446473-3433-4c73-942d-c750f0e476ec
Last attempt @ 2007-08-21 13:38:53 was successful.
CN=Configuration,DC=company,DC=org
BLL\045ADDC001 via RPC
DC object GUID: 26446473-3433-4c73-942d-c750f0e476ec
Last attempt @ 2007-08-21 13:38:53 was successful.
CN=Schema,CN=Configuration,DC=company,DC=org
BLL\045ADDC001 via RPC
DC object GUID: 26446473-3433-4c73-942d-c750f0e476ec
Last attempt @ 2007-08-21 13:38:54 was successful.
DC=DomainDnsZones,DC=company,DC=org
BLL\045ADDC001 via RPC
DC object GUID: 26446473-3433-4c73-942d-c750f0e476ec
Last attempt @ 2007-08-21 13:38:54 was successful.
DC=ForestDnsZones,DC=company,DC=org
BLL\045ADDC001 via RPC
DC object GUID: 26446473-3433-4c73-942d-c750f0e476ec
Last attempt @ 2007-08-21 13:38:54 was successful.
'
@

$regex=[regex] "(?msx)
# Option m = multi-line e.g. ^=start of line and $=end of line
# Option s = single-line e.g. . includes end-of-line
# Option x = spaces and comments are allowed in the pattern making this
# line possible

# Start of line (^), match partition, eat until end of line ($)
^ (?<partition> (CN|DC)=[^`$]+? )`$

# any chars - ? means lazy i.e. match as few characters as possible
.+?

# match site before \ using a series of wordchar
(?<Site> \w+) \\

# match domain controller afterwards
(?<DC> \w+)

# any chars
.+?

# match the date last attempted, note the spaces are escaped as option x is used
Last\ attempt\D+ (?<date> [\d\-]+\ [\d\:\.apm]+ )
"


# Search for pattern matches in $text
$regex.matches($text) | Foreach-Object {
# Save current pipeline object, so it is available from inside the next foreach-object
$match=$_
# Construct a new, empty object. Always return objects as output whenever possible. It
# makes using the output must easier
$obj=new-object object
# Get all the group names defined in the pattern - ignore the numeric, auto ones
$regex.GetGroupNames() | Where-Object {$_ -notmatch '^\d+$'} | Foreach-Object {
# And add each match as a property. When multiple results are returned, the
# value must be picked up using an index number hence the GroupNumberFromName call
add-member -inputobject $obj NoteProperty $_ $match.groups[$regex.GroupNumberFromName($_)].value
}
# emit the object to the pipeline
$obj

}



This is the output -




partition                     Site                          DC                            date
--------- ---- -- ----
DC=company,DC=org... BLL 045ADDC001 2007-08-21 13:38:53
CN=Configuration,DC=compan... BLL 045ADDC001 2007-08-21 13:38:53
CN=Schema,CN=Configuration... BLL 045ADDC001 2007-08-21 13:38:54
DC=DomainDnsZones,DC=compa... BLL 045ADDC001 2007-08-21 13:38:54
DC=ForestDnsZones,DC=compa... BLL 045ADDC001 2007-08-21 13:38:54



A final note: If you input is an array of strings, you have to convert it into a single text string before calling $regex.matches. This can easily be done, by joining the elements using newline as a delimiter -




[string]::join("`n",$array)

Friday, November 21, 2008

Update Rollup 5 for Exchange Server 2007 SP1 released

The latest update for Exchange Server 2007 SP1 was released by Microsoft yesterday.

As usual, a number of issues are fixed – a couple of highlights:

955989 (http://support.microsoft.com/kb/955989/ ) The SPN registration of a cluster fails, and Error event IDs 1119 and 1034 are logged in an Exchange Server 2007 Service Pack 1 environment

954197 (http://support.microsoft.com/kb/954197/ ) Exchange 2007 CAS cannot copy the OAB from the OAB share on Windows Server 2008-based Exchange 2007 CCR clusters

Download link: http://www.microsoft.com/downloads/details.aspx?familyid=652ed33a-11a1-459c-8ffe-90b9cbfe7903&displaylang=en&tm

Fix list: http://support.microsoft.com/?kbid=953467

Happy patching :-)

Tuesday, November 11, 2008

Office Communicator Mobile update

Just a quick note to point your attention to the latest release of Office Communicator Mobile (2007 Release).

A couple of fixes in the new release, most notably KB954769, which now enables login to Communicator Mobile when running in High Security mode - the update makes Communicator Mobile use NTLM for both medium security and high security mode.

Update description and list of fixes: http://support.microsoft.com/?kbid=954767

Update download link: http://www.microsoft.com/downloads/details.aspx?familyid=2eea3e24-f216-4887-92b0-f37d942e26e0&displaylang=en&tm

Thursday, November 06, 2008

ILM "2"

MIIS is a great engine for synchronization but the lack of a decent interface - for the administrator as well as for the end user - have made it necessary to either create a lot of code yourself or invest in other systems like Omada.
With ILM "2" (what a nice name...) the game has changed. While not as complete as Omada, ILM "2" seems to have a bunch of very useful features. I just attended an instructor led lab session here in Barcelona and the way and how easy you can do workflows and dynamic groups, makes a pure ILM "2" implementation possible - at least as a starting point or for simpler things. I haven't digged into ILM "2" too deep (yet), but what I have seen, seems ok.

Pull down an VHD with the RC-code from http://technet.microsoft.com/en-us/evalcenter/cc872861.aspx

Wednesday, November 05, 2008

Server 2008 R2 Active Directory and PowerShell

Filling my head at Tech-Ed, luckily, others are more efficient bloggers than I am.

Read this excellent summary by Dmitry of the "Windows Server 2008 R2 Active Directory: What’s Coming Up"” session at IT Forum (TechEd EMEA IT Pro) by Robert DeLuca and Alain Lissoir

Tuesday, November 04, 2008

A Day at Tech-Ed the PowerShell Way

Start-Service $body

Set-Location $bathroom
Clear-Item $body

Set-Location $restaurant
Get-Item $breakfast | Format-table | Add-Content $body

Set-Location $bathRoom
$body.oldFood | Out-Null
Clear-ItemProperty $body teeth

Set-Location $desk
$today=(Get-Date).Date
$potentialSessions=Get-ChildItem $sessions | `
Where {$_.description -gt $interest -and $_.date -eq $today} | foreach {
$_ | Add-Member Noteproperty Priority (read-host "Priority") -Passthru
} | where {$_.priority}
$plannedSessions=$potentialSessions | group timeslot | foreach {
$_.group | sort priority | select -first 1
}

Set-Location $conferenceCenter
$informationOverload=$false
$plannedSessions | foreach {
if ($informationOverload) {
Start-Sleep -Minutes 90
$informationOverload=$false
}
else {
Invoke-Item $_ | where {$_.content -notlike "sales pitch"} | `
Add-Content -path $body.brain
}
[void] (Start-Sleep -Minutes 30) -and (Add-Content $body $coffee)
if ($body.brain.overloaded) {$informationOverload=$true}
}

Set-Location ($anywhere | where {$_.beerCount -gt 5 -and $_.price -eq $null} | select -first 1)
while ($body.thirsty -and $body.alcoholPercentage -lt 1.5) {
Add-Content $body $beer
}

Set-Location $hotelRoom
Start-Sleep -minutes (60*7)

# See you tomorrow ;)


OCS 2007 R2 Planning Tools – Update #2

You may have tried the OCS 2007 Planning Tool, that was Microsoft’s first try at creating a planning tool for OCS. When I blogged about the R1 version of the tool I emphasized that it was a good start, but there was room for improvement. At least one of my suggestions has been incorporated into the product (Not taking the credit for that though), namely removing the requirement for high availability at the small sites.

New features in the R2 Planning Tool are (from my memory of what was in the R1 tool) -

  • Unified Messaging
  • Monitoring Server (The replacement for QoE Monitoring, that includes CDR)
  • The new Unified Communications Applications (New roles)
    • Response Group Service
    • Conference Auto-attendendant
    • Conference Announcement Service
    • Outside Voice Control
  • Group Chat Server (New)
  • Device Update Solution (The new Update Server, that is automagically installed with OCS and includes updates of Office Communicator 2007 clients)

Then the design of how to handle sites is greatly enhanced, it will for each site you deploy ask you a series of questions about what you want to deploy at each site e.g.

  • Online Collaboration
    • Conferencing features
    • CWA
    • Group Chat
  • Users
    • Internal and/or federated (Basically do you want to deploy Edge)
  • Voice
    • Enterprise Voice (E.g. do you want local Mediation Servers)

Lastly you will be asked if you want to use Edge Servers at a specific site or Edge Servers for each site.

So a lot of new features including even better links and explanations for scalability, planning steps and assumptions for users – a very good step forward (although we still need to be able to export the topology drawings to Visio files ;-) and it doesn’t end up with 225 servers for a simple OCS deployment, due to the more detailed questions related to sites. UPDATE #2 – at TechEd we were told that export to Visio will be part of the product.

I haven’t included screenshots in this post as I’m not sure if they are still covered under NDA, but basically the tool looks very similar to the old version.

The Edge Planning Tool will be enhanced for R2 as well, but this wasn’t demonstrated and I haven’t seen it either. Take a look at the current version at Tom Laciano’s blog or Jeff Schertz detailed post on the current Edge Planning Tool.