Microsoft Surface RT and Bluetooth Headphones

Interesting (honest) !! So I normally watch TV series on my to work in the morning and for quite a while I have not used my Bluetooth headphones.

So this morning, I thought, what the hell, they are charged, lets give them a go!

MISTAKE! big stylie.  Connected them up and started to watch an MKV and the surface ran like a 3 legged dog.  Playback was just not happening in shape or form.

Shut the Bluetooth headphone off, jacked in a wired set and hey presto, back to normal.

Tried it with music too, with the same problem.  I remember this being a problem when I first tried this with my RT, and it appears it’s still not fixed :-|

 

Using #Powershell Get a List of #Exchange InSite DCs from Eventlog [v2]

So I posted this https://blog.flaphead.com/2013/03/13/get-a-list-of-insite-dcs-from-eventlog/ a month or so ago, and found some stuff in that didn’t quite work for me.

So here is the update code.  Essentially I have now split out the server and domain so they can be referenced in the array

$Evt2080 = Get-EventLog Application -Source “MSExchange ADAccess” | where {($_.Category -eq “Topology”) -AND ($_.EventId -eq 2080)} | Select -first 1
$InSiteMatrix = @()
$Fields = “Server”,”Roles”, “Enabled”, “Reachability”, “Synchronized”, “GCcapable”, “PDC”, “SACLright”, “CriticalData”, “Netlogon”, “OSVersion”, “HostName”, “Domain”
$InSite = ($Evt2080.ReplacementStrings[-2]).Split(“`n”) | Where {$_}
ForEach($Item in $InSite){
$tmpMatrix = “” | Select $Fields
$tmpSplit = $item.Split(“`t”)
$tmpMatrix.Server = $tmpSplit[0]
$tmpMatrix.HostName = $tmpMatrix.Server.Split(“.”)[0]
$tmpMatrix.Domain = $tmpMatrix.Server.Substring($tmpMatrix.HostName.Length +1)
If($tmpMatrix.Server -ne “”){
$i=1
$tmpValues = $tmpSplit[-1].split(” “)
ForEach($thing in $tmpValues ){
$tmpMatrix.($Fields[$i]) = $thing
$i++
} #ForEach
$InSiteMatrix += $tmpMatrix
} #If
} #ForEach

SQL query to get #BlackBerry User information

So following on from my last post (https://blog.flaphead.com/2013/04/23/using-powershell-to-run-a-sql-command/) I use this SQL query to dump BlackBerry User information in to a #Powershell array so I can export it out.

SELECT [ServerConfig]. [ServiceName]
      , [UserConfig]. [DisplayName]
      , [UserConfig]. [UserName]
      , [userconfig]. [MailboxSMTPAddr] as [SMTPAddress]
      , [SyncDeviceMgmtSummary]. [ModelName]
      , [SyncDeviceMgmtSummary]. [PhoneNumber]
      , [SyncDeviceMgmtSummary]. [PlatformVer]
      , [SyncDeviceMgmtSummary]. [IMEI]
      , [SyncDeviceMgmtSummary]. [HomeNetwork]
      , [SyncDeviceMgmtSummary]. [AppsVer]
      , [UserConfig]. [PIN]
      , [ITPolicy2]. [PolicyName]
      , [UserConfig]. [MailboxSMTPAddr]
      , [UserConfig]. [MailboxDN]
      , [UserConfig]. [ServerDN] as [ExchangeServer]
      , [UserConfig]. [AgentId]
      , [UserConfig]. [RoutingInfo]
      , [UserStats]. [MsgsPending]
      , [UserStats]. [LastFwdTime]
      , [UserStats]. [LastSentTime]
      , CASE [UserStats] . [Status]
            WHEN 13 THEN ‘Stopped’
            WHEN 12 THEN ‘Running’
            WHEN 9  THEN ‘Redirection disabled’
            WHEN 0  THEN ‘Initializing’
            ELSE ‘Unknown [‘ + CONVERT (varchar , [UserStats]. [Status] ) + ‘]’
        END AS UserStatus
  FROM [dbo] . [UserConfig]
   LEFT OUTER JOIN [dbo] .[UserStats]
    ON [UserConfig]. [Id] =[UserStats] . [UserConfigId]
   LEFT OUTER JOIN [dbo] .[ITPolicy2]
    ON [UserConfig]. [ITPolicy2Id] =[ITPolicy2] . [Id]
   LEFT OUTER JOIN [dbo] .[ServerConfig]
    ON [UserConfig]. [ServerConfigId] =[ServerConfig] . [Id]
   LEFT OUTER JOIN [dbo] .[SyncDeviceMgmtSummary]
    ON [UserConfig]. [Id] =[SyncDeviceMgmtSummary] . [UserConfigId]

So setting the above at $SqlQuery and then running

$SqlServer = “BlackBerry SQL Server”
$SqlDb = “BlackBerry Database Name”
RunSqlQuery  $SqlServer $SqlDb $SqlQuery

 

Using #Powershell to run a SQL Command

So I have a hell of a lot of stuff where I am pushing or pulling data from SQL and wanted to share the function I use:

Function RunSqlQuery([string]$SqlServer, [string]$SqlDb, [string]$SqlCmd){
$Error.Clear()
Write-Host “SQL Server…: ” $SqlServer
Write-Host “Sql Database.: ” $SqlDb

$Connection = New-Object System.Data.SQLClient.SQLConnection

$Connection.ConnectionString =”server=$SqlServer;database=$SqlDb;trusted_connection=true;”

$Command = New-Object System.Data.SQLClient.SQLCommand
$Command.CommandType = [System.Data.CommandType]”Text”
$Command.Connection = $Connection
If($Error.Count -gt 0){Exit}
$Command.CommandText = $SQLCmd

$tmpDT = New-Object “System.Data.DataTable”
$Connection.Open()
$Reader = $Command.ExecuteReader()
$tmpDT.Load($Reader)
$Connection.Close()

$i=0;$tmpDT | ForEach{$i++}
Write-Host “Query Result size: ” $i
Write-Host “`n”

Return $tmpDT
}

The function assumes the account using the function has rights on the SQL database.

Typically I set the following:

$SqlServer = “SQLServer”
$SqlDB = “SQLDatabase”
$SqlQuery = “Select * from something”

RunSqlQuery $SqlServer $sqldb $SQLQuery

-or-

$SqlData = RunSqlQuery $SqlServer $sqldb $SQLQuery

 

Finding a computer in the AD using #Powershell

So I need to search the AD today for computer objects to see if a description has been set.

$Domain = ([System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()).Name
$Dom  = “LDAP://DC=” + $Domain.Replace(“.”,”,DC=”)
$strComputer = “<computer2search4>”
$strFilter  = “(cn=$strComputer)”
$Root       = New-Object DirectoryServices.DirectoryEntry $Dom
$selector   = New-Object DirectoryServices.DirectorySearcher
$selector.PageSize    = 1000
$selector.Filter      = $strFilter
$selector.SearchRoot  = $root
$selector.SearchScope = “Subtree”
$Objs = $selector.findall()
$Objs.count

 

The results are in the variable $Objs

#Lync Integration with #BlackBerry

So I have a need to integrate Lync with BlackBerry.  So I followed this wicked guide http://talesfromc.blogspot.co.uk/2011/04/lync-bes-503-integration.html?m=1 and all was shweet.  I had to make a few tweeks to the certificate request inf file, as the SAN names just didn’t want to add themselves to the certificate request:

[Version]
Signature=”$Windows NT$”

[NewRequest]
Subject = “CN=LyncFEPool.domain”
Exportable = TRUE
KeyLength = 1024
KeySpec = 1
KeyUsage = 0xA0
MachineKeySet = True
FriendlyName = “OCSConnector”
ProviderName = “Microsoft RSA SChannel Cryptographic Provider”
ProviderType = 12
RequestType=pkcs10

[EnhancedKeyUsageExtension]
OID=1.3.6.1.5.5.7.3.1
OID=1.3.6.1.5.5.7.3.2

[Extensions]
2.5.29.17 = “{text}”
_continue_= “DNS=PrimaryBES.domain&”
_continue_= “DNS=StandbyBES.domain&”
_continue_= “DNS=LyncFEPool.domain”

Then run certreq -new c:\LyncRequest.inf c:\LyncCertNew.req and request the cert, then import it blah, blah.

However, I have an Active/Passive BlackBerry setup and when I failed over to the Passive node, Lync didn’t work from my device.

The BlackBerry Collaboration Service would start and then stop with 3 Error events in the application event log:

Source:        BlackBerry Collaboration Service
Event ID:      15000
Level:         Error
Description:
<2013-04-12 12:12:44.910 BST>:[126]:<BBIM_EMDC2BEM01_BBIM_1>:<ERROR>:<LAYER = BBIM, [OCSC] TlsFailureException: The operation failed due to issues with Tls. See the exception for more information., ErrorCode=-2146893042, FailureReason = Other, InnerExceptionCertificateInfoNative::AcquireCredentialsHandle() failed; HRESULT=-2146893042>

Source:        BlackBerry Collaboration Service
Event ID:      15000
Level:         Error
Description:
<2013-04-12 12:12:44.910 BST>:[127]:<BBIM_EMDC2BEM01_BBIM_1>:<ERROR>:<LAYER = BBIM, [OCSC] TlsFailureException: The operation failed due to issues with Tls. See the exception for more information., ErrorCode=-2146893042, FailureReason = Other, InnerExceptionCertificateInfoNative::AcquireCredentialsHandle() failed; HRESULT=-2146893042>

Source:        BlackBerry Collaboration Service
Event ID:      15000
Level:         Error
Description:
<2013-04-12 12:12:44.925 BST>:[130]:<BBIM_EMDC2BEM01_BBIM_1>:<ERROR>:<LAYER = BBIM, [OCSC] BlackBerry OCSConnector will terminate…>

Turns out that you can’t use the initial cert you created, you have to export it with the public key to a .pfx file.  Then import that on to the Standby BES.

Everyday is a school day!

 

BlackBerry “Domain Prep”

#BlackBerry, #Powershell

So I had a bit of brain freeze yesterday, and then it hit me.  BlackBerry needs AD SendAs permissions, but I thought I had done that!

Doh! The current place I am working has multiple AD Domains, and I done the root!  What I needed was an Exchange like domainprep to apply the permissions ..

So knocked up this.  I basically this assigns the permission to a group, so I can add and remove service accounts to it ;-)

$domains = ([System.DirectoryServices.ActiveDirectory.forest]::getcurrentforest()).domains | select name | sort name
ForEach($domain in $Domains){
$dom = $domain.name
Write-Host $dom
Add-ADPermission $dom -user “domain\Group” -AccessRights extendedright -ExtendedRight Send-As
}

BlackBerry Delivery Confirmation

#BlackBerry

Couldn’t for the life of me remember the subject line .. Knew about <confirm> but its the rest I forgot.  So here you are: [More info here: http://www.blackberry.com/btsc/KB18737]

Send an email with the following subject:

<$Confirm,RemoveOnDelivery> BlackBerry Test Mail .. PLEASE DO NOT OPEN OR DELETE

Once it has been delivered to the device, you will get a return email like this:

—–Original Message—–
From: me
Sent: 11 April 2013 16:59
To: me
Subject: BlackBerry Delivery Confirmation

Your message:

TO: me@me.com
SENT: today
SUBJECT: <$Confirm,RemoveOnDelivery> BlackBerry Test Mail .. PLEASE DO NOT OPEN OR DELETE

has been delivered to the recipient’s BlackBerry Handheld.

Enough is enough

#wordpress

So I have been blogging for a while.  I started off using CommunityServer and then in the last year or so upgraded to WordPress.

My blog is hosted at home using Windows 2008 R2 on Hyper-V.  At home I use Virgin Media for my Broadband, and as I get a dynamic DNS, I use dns2go to public this blog.

It has happened a few time recently, where my home broadband just stops working, be it a router issue or outside network.  This is a royal pain the butt!

So, this week I signed up with WordPress, and paid for a business subscription.  I have move my data across (which was really time, wordpress to wordpress) and now have http://blog.flaphead.com alive and kicking on hosted wordpress.

So far so good, I have a new layout and I hope you like it.  Now in theory RSS should still work fine and I plan to move http://blog.flaphead.dns2go.com to wordpress over the weekend.

So if you experience any issues, surf to http://blog.flaphead.com  and re-add.

Stingray Traffic Manager Solution Guide – Microsoft Exchange 2010

#MSExchange #Riverbed #Stringray

The Riverbed Stingray documentation for Exchange Server 2010 has been updated!

PDF states Version 2.7.  .. created by Vinay Reddy on Mar 26, 2013 3:44 PM, last modified by Vinay Reddy on Mar 26, 2013 3:44 PM

Can see some updates on page 40 – 41, 43 – 47 and the script on page 60 -61 has a few cookie related updated as is noted as “Updated the TrafficScript for Single Virtual Server for all Exchange services with persistence configuration removed for OAB and AutoDiscover”

 

Check it out here:  https://splash.riverbed.com/docs/DOC-1716 -or- if they delete it ;-) here: https://ucinfo.files.wordpress.com/2013/04/stingray-traffic-manager-solution-guide-microsoft-exchange-2010.pdf