Deleting device records in Tachyon

I’m often ask how to remove devices that are registered in Tachyon that have been decommissioned. This SQL script allow you to delete device records based on them being offline and you have specified the FQDN and TachyonGuid.

USE [TachyonMaster]
GO

DELETE FROM [dbo].[Device]
 WHERE
 Status = 0
 and
 Fqdn = '1EVCOL118.1e.local'
 and
 TachyonGuid = '4C4C4544-0053-4310-8051-B8C04F4B5631'

— Status = 0 means that the device is offline
— Fqdn = ‘device name’ is the device FDQN of the device that needs to be deleted
— TachyonGuid = ‘TachyonGuid’ is the Tachyon GUID of the device that needs to be deleted
GO
To remove devices that have not be online in the last 60 days run.

USE [TachyonMaster]
GO
DELETE FROM [dbo].[Device]
 WHERE LastConnUtC < DATEADD(day, -60, GETDATE())
Advertisements

, , , ,

Leave a comment

Who is the top user of Tachyon?

Its Friday afternoon and its been a long week as the product team are in the final few days before we release to support the next version of Tachyon. I wanted to turn my attention to doing something stress free so opened Powershell ISE and created this little script to find out who the top users of Tachyon are.

$Cred = Get-Credential
$url = 'https://<tachyonServer.domain.com>/consumer/AuditLogs/'
$headers = @{}
$headers.Add("X-Tachyon-Consumer",'Explorer')
$BodyString =  @{
                   Sort = $null
                   Start = 1
                   PageSize = [System.Int32]::MaxValue
                }
$json = $BodyString | ConvertTo-Json
$object = Invoke-RestMethod -Uri $url -Credential $Cred -ContentType 'application/json' -Headers $headers -Body $json -Method Post
$object.Items | Where{$_.Component -eq "Consumer"} | Group -Property UserName |  Sort Count -Descending|Ft Name,Count

Hope you find this useful and have a great relaxing weekend as I plan to do.

Leave a comment

Get device status from list of devices

The Tachyon Explorer is a great interface to the Tachyon Platform but sometimes it does not expose the data in the way that customers want to use it, this is one of the main that a design goal for Tachyon was to expose an API layer that we call Consumer API. Everything that you can access in Tachyon Explore is available thought the Consumer API, this is great because we can access data via Powershell scripts.

Here is an example that a customer ask for, ‘how you can query the online status information from a list of FQDNs?’.

Change the <tachyonServer.domain.com> in the $url to your Tachyon Consumer API instance.

$Cred = Get-Credential
$devices = @('Device1.domain.com', 'device2.domain.com', 'devicex.domain.com')
foreach($d in $devices)
{
  $binary  = [System.Text.Encoding]::UTF8.GetBytes($d)
  $encodedValue = [System.Convert]::ToBase64String($binary)
  $url = "https://<tachyonServer.domain.com>/consumer/devices/fqdn/" + $encodedValue
  $headers = @{}
  $headers.Add("X-Tachyon-Consumer","Explorer")
  try
  {
    $object = Invoke-RestMethod -Uri $url -Credential $Cred -Headers $headers
    if ($object.Status -eq 0)
    {
      Write-Host "$d : Offline"
    }
    elseif ($object.Status -eq 1)
    {
      Write-Host "$d : Online"
    }
    else
    {
      Write-Host "$d : Unknown"
    }
  }
  catch
  {
    Write-Host $d ":" $_.Exception.Response.StatusDescription
  }
}

This script could be extended to read a file for the list of FQDNs. There are many example online but here is a link to one that should work fine.

 

, ,

Leave a comment

Getting Product Pack version number from 1E Tachyon version 3.0

This is just a quick post of a Powershell script that might be useful when trying to compare what versions of Tachyon Product Packs are installed in your Tachyon environment to those that are on the TachyonExchange.

$Cred = Get-Credential
$url = “https://tachyondemo.1e.local/consumer/ProductPacks/
$headers = @{}
$headers.Add(“X-Tachyon-Consumer”,”Explorer”)
$object = Invoke-RestMethod -Uri $url -Credential $Cred -Headers $headers
$object | FT Name, Version, UploadTimestampUt, Description

This should give you output similar mine development environment.

ScriptOutput

Leave a comment

Parsing the Tachyon Switch log for SSL failures

The script below will give you a count of the IP addresses that have attempt to connect to the Tachyon Switch but have been refused because of an SSL connection error.

 

#Update this with the path to Tachyon.Switch.log
$File = ‘C:\Temp\New folder\Tachyon.Switch.log’

$Output = @()
$hash =@{}

#this is the text in the log that indicate the agent is unable to connect.
$Warnings = Select-String $File -pattern “Warning: state=2”
foreach ($Line in $Warnings)
{
$newline = $line.ToString().Split(“=”)
$Output = $Output + $newline[2]
}

#Add a count to the list
$Output| % {$hash[$_] = $hash[$_] + 1 }

#only include IPs with more than 1 occurrence
$Result = $hash.getenumerator() | ? { $_.value -gt 1 }

#Order the list in occurrence order.
$Result | Sort-Object Value -Descending

Example output:
Name           Value
—-                 —–
10.0.1.136    2
10.1.9.238    2

Leave a comment

Get ConfigMgr Versions

Just a quick blog to share a little SQL query that shows what version of ConfigMgr is being used at each site in you hierarchy.

SELECT DISTINCT SiteServer,’Site Version Number’ = Version,’Version Name’=
CASE
WHEN Version = ‘4.00.5135.0000’ THEN ‘ConfigMgr 2007 Beta 1’
WHEN Version = ‘4.00.5931.0000’ THEN ‘ConfigMgr 2007 RTM’
WHEN Version = ‘4.00.6221.1000’ THEN ‘ConfigMgr 2007 SP1’
WHEN Version = ‘4.00.6221.1193’ THEN ‘ConfigMgr 2007 SP1 with KB977203’
WHEN Version = ‘4.00.6487.2000’ THEN ‘ConfigMgr 2007 SP2’
WHEN Version = ‘4.00.6487.2111’ THEN ‘ConfigMgr 2007 SP2 with KB977203’
WHEN Version = ‘4.00.6487.2157’ THEN ‘ConfigMgr 2007 R3’
WHEN Version = ‘4.00.6487.2207’ THEN ‘ConfigMgr 2007 R3 with KB2750782’
WHEN Version = ‘5.00.7561.0000’ THEN ‘ConfigMgr 2012 Beta 2’
WHEN Version = ‘5.00.7678.0000’ THEN ‘ConfigMgr 2012 RC1’
WHEN Version = ‘5.00.7703.0000’ THEN ‘ConfigMgr 2012 RC2’
WHEN Version = ‘5.00.7711.0000’ THEN ‘ConfigMgr 2012 RTM’
WHEN Version = ‘5.00.7711.0200’ THEN ‘ConfigMgr 2012 RTM CU1’
WHEN Version = ‘5.00.7711.0301’ THEN ‘ConfigMgr 2012 RTM CU2’
WHEN Version = ‘5.00.7782.1000’ THEN ‘ConfigMgr 2012 SP1 Beta’
WHEN Version = ‘5.00.7804.1000’ THEN ‘ConfigMgr 2012 SP1’
WHEN Version = ‘5.00.7804.1202’ THEN ‘ConfigMgr 2012 SP1 CU1’
WHEN Version = ‘5.00.7804.1300’ THEN ‘ConfigMgr 2012 SP1 CU2’
WHEN Version = ‘5.00.7804.1400’ THEN ‘ConfigMgr 2012 SP1 CU3’
WHEN Version = ‘5.00.7804.1500’ THEN ‘ConfigMgr 2012 SP1 CU4’
WHEN Version = ‘5.00.7804.1600’ THEN ‘ConfigMgr 2012 SP1 CU5’
WHEN Version = ‘5.00.7958.1000’ THEN ‘ConfigMgr 2012 R2’
WHEN Version = ‘5.00.7958.1101’ THEN ‘ConfigMgr 2012 R2’
WHEN Version = ‘5.00.7958.1203’ THEN ‘ConfigMgr 2012 R2 CU1’
WHEN Version = ‘5.00.7958.1303’ THEN ‘ConfigMgr 2012 R2 CU2’
WHEN Version = ‘5.00.7958.1401’ THEN ‘ConfigMgr 2012 R2 CU3’
WHEN Version = ‘5.00.7958.1501’ THEN ‘ConfigMgr 2012 R2 CU4’
ELSE ‘Unknown version’
End
FROM Sites

The version information came from http://en.wikipedia.org/wiki/System_Center_Configuration_Manager

, , , ,

Leave a comment

Registering existing Nomad Cache in ActiveEfficiency Single Site Download (SSD)

This is a continuation of the conversation I have with a customer that was started in my previous blog ‘How to enable the Nomad Single Site Download (SSD) feature after deployment of Nomad

Customer question: ‘As you know we have been using Nomad for months now and have a large amount of content cached on clients, is it possible to tell Nomad to populate ActiveEfficiency?’
Answer: ‘Sorry there is no Supported way to do this.’

Customer: ‘OK, but is it possible?’
Answer: ‘Yes, if you follow this process but remember this will not be supported by 1E’

As this process is not supported by 1E the following disclaimer applies

DISCLAIMER

Use of these items and process is at your sole risk.
All items and information are provided “as-is”, without any warranty, whether express or implied, of accuracy, completeness, fitness for a particular purpose, title or non-infringement. In no event shall 1E, its suppliers or author of this blog be liable for any damages whatsoever including direct, indirect, special, incidental or consequential, loss of business profits or special damages, even if 1E, its suppliers or author of this blog have been advised of the possibility of such damages.

I highly advise that you complete this process in a lab environment and fully understand the process before attempting the steps in production. Remember this is an unsupported process.

Step one – Stop Nomad Branch service to prevent the Nomad service responding to subnet election requests.
Example Powershell code: Stop-Service NomadBranch

Step two – Delete the Nomad Branch cache package status reference from the registry, this will force Nomad to enter Recovery mode when it next starts up.
Example Powershell code: Remove-Item -Path HKLM:\Software\1E\NomadBranch\PkgStatus -Recurse

Step three – Start Nomad Branch service, in the NomadBranch.log you should see

1
and the registry will show.

2
Example Powershell code:
Start-Service NomadBranch

Step four – Finally, to finish the reactivation process execute NomadBranch.exe -ActivateAll. This will complete the activation process.

3
and the registry will show.

4
Example Powershell code:
NomadBranch.exe -ActivateAll

Note: Using this process to populate the ActiveEfficiency database may affect some of the 1E Nomad reports.

Below is an example Powershell script that can enable SSD and register the content of the Nomad Cache with ActiveEfficiency

Final warning remember this is an unsupported process

#<DNS Alias for ActiveEfficiency Server>
$AEServerDNSAlias = ‘ActiveEfficiency’

# 0 is disabled, 1 is enabled to read from AE, 2 is enabled to write to AE 3 is enabled for both read and write.
$SSDEnabled = ‘3’

#Change to HK:M:\Software\WOW6432Node\1E\NomadBranch if 32 bit Nomad agent is used on 64 bit OS with CM2007 client
$RegPath = ‘HKLM:\Software\1E\NomadBranch’

#Stop Nomas service so that it does not respond to elections
Stop-Service NomadBranch

#Enable SSD
Set-ItemProperty -Path $RegPath -Name SSDEnabled -Value $SSDEnabled -Force

#Set ActiveEfficiency URL
Set-ItemProperty -Path $RegPath\ActiveEfficiency -Name PlatformURL -Value http://$AEServerDNSAlias/ActiveEfficiency -Force

#Delete all Package Status register key
Remove-Item -Path $RegPath\PkgStatus -Recurse

#Restart Nomad to allow Nomad to register into 1E ActiveEfficiency
Start-Service NomadBranch

#Finally reactivate the Nomad cache so that it shows as 100% complete rather that 99.00%
NomadBranch.exe -ActivateAll

, , , ,

Leave a comment