Call me...

T he atheist rejects the claim that there is a
supernatural entity or force that interacts with existence...
Because it is a claim without basis.

Atheism makes no claims whatsoever.
Atheism asserts nothing.
Atheism IS NOT an act or an action
IT IS a position
 It has no objective.
Comparatively / Conversely:
Anti-theism IS an act or an action
 It IS NOT a position
 It has an objective.

Sunday, November 17, 2019

Powershell sending to Google Voice, and also a Lease mileage tool...

Probably, the most useful part of this, is what it takes to send an email to a (your?, some other?) Google Voice (GV) conversation... I suppose.

So that part first...
In GV settings, make sure you have enabled "Forward messages to email".

Then from GV... Send a text message to your GV number.
Head you your GMAIL account, and find that email notification from GV.
Click on the three vertical dots next to the 'reply' arrow, in this email, and select 'Show original':

Scroll down to find the 'From:' line...
This is the email address of this conversation, that you will use in your script:

The rest of this, is the script I have scheduled to run every day, telling me what my target mileage should be less than, and how many days I have left on this 39 month lease.
$ODOatStart = 18
$LeaseMileage = 325000 
$LeaseStarted = "11/16/2019"
$LeaseEnding = "02/16/2023"
$DaysHad = (((Get-date).AddDays(1))-[DateTime]'11/16/2019').Days
$TotalDays = 1189 # = ([DateTime]$LeaseEnding-[DateTime]$LeaseStarted).Days+1
$MilesPerDay = 27.33389 # = ($LeaseMileage/$TotalDays)
$MilesAllowed_Today = '{0:N0}' -f ([math]::Round(($DaysHad*$MilesPerDay)+$ODOatStart))

$Username = "joe.smith" # Just the username. Leave out the ''
$PW = "sr465bblo0986vfert65z" # Application Specific PW (because of 2-factor auth)
$EmailFrom = "joe.smith"
#$EmailTo =
# look at the 'From:' line of the raw email
  $EmailTo = ""
$Subject = "Mileage Target"
$DaysLeft = '{0:N0}' -f ($TotalDays - $DaysHad)
$Body = "ODO: $MilesAllowed_Today  ($DaysLeft days left)"

$SMTPServer = ""
$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 587)
$SMTPClient.EnableSsl = $true
$SMTPClient.Credentials = New-Object System.Net.NetworkCredential($Username, $PW);
$SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body)

#([datetime]"02/16/2023").ToString(“dddd, dd MMM yyyy”)

Some of the calculations ($TotalDays and $MilesPerDay) are commented out...
Plug in the variables, and (F8) run  just those...
Then run those calculations to get their fixed values.


Or run the calculations each time... Your call... I don't know your life. :-)

$TotalDays = ([DateTime]$LeaseEnding-[DateTime]$LeaseStarted).Days+1
$MilesPerDay = ($LeaseMileage/$TotalDays)

The only reason I hard code them in, is that these are 'fixed; values, and it makes the script run just a (nominal, but still) bit faster.

You can use this to send texts to a mobile phone directly too... 

The T-Mobile example is commented out.
And you can send to multiple recipients by separating addresses with a single comma, and encapsulating that in double quotes:

$OtherEmail = ""
$EmailTo = "$OtherEmail," 

~ That last line was just me looking at what day of the week the lease ends on.

Thursday, September 12, 2019

Powershell - Get computers IMEI, and SIM card number ~ Remote PC

I just went through a marathon session, setting up several Dell 7212 Rugged tablets, that came with their SIM card already inserted...

In order to activate the cellular capabilities with a carrier, the following two details are required...
     But these are kind of a hassle to get to. And to work with...
  •      The IMEI number (device ID)
  •      The SIM card number

I found it MUCH easier to get to this info from my own computer, than from the tablet, as follows:
   ~ Note - About the Test-WSMan, PsExec, and the winrm config...
    ~ These just make sure WinRM is enabled. 

     ~ 'Invoke-Command' requires WinRM
$Target = "HOSTNAME"

$TestCommand = $null
$TestCommand = Test-WSMan -ComputerName $Target
If (!($TestCommand)){C:\SysInternals\PsExec.exe -s -nobanner \\$Target /accepteula cmd /c "c:\windows\system32\winrm.cmd quickconfig -quiet"}

$Network_IMEI = Invoke-Command -ComputerName $Target -ScriptBlock { netsh mbn show interfaces }
$Network_SIM = Invoke-Command -ComputerName $Target -ScriptBlock { netsh mbn show read interface=* }
$IMEI = ((($Network_IMEI | select-string "device id").ToString()).Trim()).replace('              ','')
$SIM = ((($Network_SIM | select-string "SIM ICC Id").ToString()).Trim()).replace('       ','')
Write-Host "Cellular device info:" -ForegroundColor Cyan -BackgroundColor DarkGreen

There's plenty of extra lines in there, to make it look pretty, but you should get the point, pretty easily.
The two pieces (from what I could see), are in different parts of the mnb. So... Two commands.

It took me a while to figure this all out... To get BOTH the IMEI number, and the SIM card number.

Hope it helps someone else!

Wednesday, March 27, 2019

Active Directory SID lookup.

Some notes on how to figure out what a specific AD SID value belongs to.

I was asked why a specific SID was showing up in an applications Security Alert logs.

That logging system tells the user that it is probably a 'Brute Force' attack from:

I used GetADUser to filter for that SID... Nothing.

I opened up my search, and looked at all AD objects, but the SID value was not apparent.
Here is where I ended up:

$SID_Value = "S-1-5-21-436374069-117609710-839522115-6608"
Get-ADObject -Filter "objectSid -eq '$SID_Value'"

Saw that it WAS a Computer object - So, more details as follows:

Get-ADComputer ((Get-ADObject -Filter "objectSid -eq '$SID_Value'").Name)

Friday, January 4, 2019

Powershell array to CSV file

The easiest way to drop a Powershell array into a CSV file...

$Array | Out-File $SaveLocation -Append -Encoding Ascii

Assigning the text format is the trick - the CSV has to be in ANSI.

And just Out-File save it as a CSV

Saturday, September 1, 2018

Powershell: Show Windows version build info, with UBR

I wanted to pull in all of the Windows version info into a variable...
Release Number, Build Number, and UBR / 'Update Build Revision'

These standard commands were lacking -
  • Get-WindowsEdition -Online 
  • [environment]::OSVersion
  • [environment]::OSVersion.Version
  • (Get-CimInstance Win32_OperatingSystem)version

The 'Release Number' and UBR don't show up.

The UBR is not super useful, except for adding completeness...
But the 'Release Number' is what most Windows version conversations rely on.

Sure, one can type 'winver', and see it in a pop-up window...
But I wanted something more tangible, and portable... As a $variable

Mostly - I wanted figure out how to get to this info from the command-line...

Anyway - It's in the Registry...
This does not require elevation. And it can be pulled in with one line (well two, but really one):
Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' `
select ReleaseID,CurrentBuildNumber,UBR


Or it can be prettied up with three lines:
$Reg_NT_CurVer = Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' `
select ReleaseID,CurrentBuildNumber,UBR
$BuildNo = ($Reg_NT_CurVer.CurrentBuildNumber)+"."+($Reg_NT_CurVer.UBR)
Write-Host " Version" $Reg_NT_CurVer.ReleaseID "(OS Bulld" $BuildNo") " -BackgroundColor Black
# On lines '1' and '2' above, that select is not really needed - I just put it there for clarity

Some additional notes:
# ReleaseID / Release is coded 'YYMM' - So, for example: '1803', was released 2018 March
# CurrentBuildNumber / CBN
# UBR is 'Update Build Revision'

# Below is just another way of putting the same info on screen.
# I re-labled the headers. The 'Out-String trim', just removes extra lines'

Write-Host "~~~~~~~~~~~~~~" -ForegroundColor Yellow
(Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' `
FL @{L='Release';E={$_.ReleaseID}},@{L='CBN';E={$_.CurrentBuildNumber}},@{L='UBR';E={$_.UBR}} `
| Out-String).Trim()     # (FL = format-list)

Write-Host "~~~~~~~~~~~~~~" -ForegroundColor Yellow
(Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' `
FT @{L='Release';E={$_.ReleaseID}},@{L='CBN';E={$_.CurrentBuildNumber}},@{L='UBR';E={$_.UBR}} `

| Out-String).Trim()     # (FT = format-table)

Sunday, August 19, 2018

Powershell TWAIN / scan from USB

This is just me being lazy, really...
  1. Plug in USB scanner...
  2. Start Button
  3. Open the 'Devices and Printers' applet
  4. Find the scanner
  5. Right-Click, and 'Start a Scan'

Or -
Write something that will find the scanner, and open the 'Start a Scan' window, when the script is ran...

I enabled the Quick Launch bar, and have this in there as a shortcut - I just changed the icon to a 'scanner'. (from here: %SystemRoot%\System32\SHELL32.dll)

This is the command for the shortcut...
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe –NoProfile -windowstyle hidden -file "C:\Users\Rich\PSScripts\StartScan.ps1"

This line can be ran, to discover the 'Device description' for your device...
(gwmi Win32_USBControllerDevice |%{[wmi]($_.Dependent)}).Description

Here is the scripts text:
$DeviceDesc = "CanoScan"
$FindTWAIN = (gwmi Win32_USBControllerDevice |%{[wmi]($_.Dependent)} | Where-Object {($_.Description  -match $DeviceDesc)})
If ($FindTWAIN.Name -match $DeviceDesc){
$DeviceID = ($FindTWAIN.DeviceID).Replace("\","#")
$ClassGuid = $FindTWAIN.ClassGuid
$FullCommand = "`"C:\WINDOWS\system32\rundll32.exe`" fdprint,InvokeTask /ss `"\\?\"
$Params = "`"\\?\"+$DeviceID+"#"+$ClassGuid+"`""
& "C:\WINDOWS\system32\rundll32.exe" fdprint,InvokeTask /ss $Params

If ($FindTWAIN.Name -Notmatch $DeviceDesc){
$MsgBoxInfo = "$DeviceDesc device not found..."
[void] [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.VisualBasic")
[Microsoft.VisualBasic.Interaction]::MsgBox($MsgBoxInfo, "OKOnly,SystemModal,Exclamation", "Nothing Found.") | Out-null
 ## Out-null just supresses the 'ok' to the (ISE?) screen, after pressing the OK button.

Monday, May 29, 2017

Jesus, big money and the GOP

Article originally appeared here, May 28, 2017 *:

Jesus, big money and the GOP: Before Fox News, there was “The 700 Club”

At "The 700 Club" I learned from Pat Robertson how to sell a "gospel of self" to the faithful

By: Terry Heaton

 (Credit: Salon/Flora Thevoux)

Excerpted from “The Gospel of Self: How Jesus Joined the GOP” by Terry Heaton (OR Books, 2017). Reprinted with permission from OR Books.*

Before there was Fox News, there was “The 700 Club.” The thousands or perhaps millions of Christians influenced by “The 700 Club” over the last four decades are good people. Their intentions are noble. They mostly wish that others would find the peace and contentment they’ve discovered for themselves. Along the way, however, the essential gospel call about feeding sheep and lambs has been overshadowed by a perceived need to not just challenge the evolution of our culture but also directly participate in what they view as its restoration. Certain Christian leaders whose motives—while presented as above reproach—have fed them Biblical mandates that seem to justify this participation. However, a deeper examination reveals that the gospel being most preached today is a form of self-centeredness: the gospel of self.

I know this, because I helped teach it while serving as Pat Robertson’s producer and executive producer during a most critical point in the TV program’s development, the 1980s, when Pat himself decided that God had called him to run for president and that he would win. The story of how this happened is my story, and the gospel of self is the dark side of that chronicle.

History will record that “The 700 Club” was the taproot of that which moved the Republican Party to the right and provided the political support today for a man like Donald Trump. A 2015 Harvard report concluded that right-wing media was driving the GOP, not Republican leadership, but this assumes that in order for people to behave as cultural radicals, they must be manipulated into doing so. This is a misleading interpretation of human nature and the power of personal faith. It would be absurd to suggest that the many elements of right-wing media didn’t play a role in this, but those who challenge this right turn by the GOP need to look far beyond the institutional power of media to influence. Conservative talk radio, Fox News, offline publications, and the hundreds of online observer websites would simply not exist without an audience driven by a faith-mandated conscience and thusly predisposed to their messages. We knew this at CBN in the early 1980s, and as long as we could present current events in what we called “a Biblical perspective,” people would take an interest.

This form of Christianity blends so well with the Republican Party because both are formed around a circle with self at the center. This was the overarching albeit unwritten strategy of Pat Robertson, although there were many in key positions at CBN who either weren’t aware of this or simply refused to see it. To me, it was pretty obvious and was later proven in a memorable private discussion I had with Pat about fundraising.

The 700 Club began as a Christian talk show for the faithful, but its evolution to a politically motivated, point-of-view news program began in bits and pieces before I arrived and accelerated afterwards. In an address to a noon prayer meeting in April of 1981, Pat Robertson offered the vision he wanted to fulfill and the Biblical justification for moving the ministry in that direction.
And I tell you, in our world today; people are like a bunch of sheep. They’re saying, ‘What must we do? You know, what do we do with our money? What do we do with our children? What do we do with our education? What do we vote for?’ And all these—What do we do? And somehow or other God’s got to give some people with knowledge of the times to tell Israel what they ought to do. And I think we have a golden opportunity to do that, and that’s one of the things we’re trying to do on The 700 Club…
That was Pat in 1981.

So the vision was set and the only missing element was money. After all, CBN was a ministry. It paid no taxes as a media company, and the tax exemption was worth far more than any for-profit business model, especially in 1981. Pat Robertson was a brilliant marketer, however, and despite his professed faith in God to take care of providing resources, very little at CBN was left to chance, and that applied especially to fund-raising. Only a small part of marketing is creative or innovative; most of the blue-collar efforts involved processes and were extremely scientific.

We knew, for example, what percentage of 700 Club members—at fifteen dollars a month – would covert to 1000 Club members—at eighty-three dollars a month—and we knew, on average, how long that conversion would take. We had the same data in terms of converting 1000 Club members to 2500 Club members, and turning those members into Founders Club members. Based on past growth, this allowed us to extrapolate a budget projection, and that’s what we used to make our plans.

But behind it all was the mind of a fund-raising genius, a man who understood human nature like few others, and mostly a man who was unafraid to exploit that understanding in a justified means to what he felt was a righteous end. I learned how to raise money directly from Pat Robertson, and his methodology might surprise the faithful, for it is built on self-centeredness. And if the core of its ability to raise money is built on selfishness, then it must follow that the CBN message itself must do likewise. This is the secret truth behind what we intended to present as a movement of God’s spirit on the earth.

In February 1985, as I was gaining more authority at the ministry of The 700 Club, I asked Pat if he would teach me everything he knew about raising money. We went to lunch, and I took copious notes. Here’s what he told me, according to my notes:

We don’t necessarily have to present everything as a crisis, but it’s impossible to make a change when everybody feels good about existing circumstances. That’s the mistake Reagan has made. He got re-elected but now faces difficulty in implementing change, since he sold the country on the fact that everything is hunky-dory.

It’s basically like John the Baptist. The axe is laid to the root of the tree and people are saying, ‘What shall we do?’
We need to tie the spiritual with the natural (meaning current events). He told the people what to do in light of the current events. We need to do the same thing, because if you can do that, you really have something that’s worth something.

Here’s what motivates people to give to CBN, and in this order:
It helps me.

It helps my family.

It helps my community.

It helps my nation.

I’m fulfilling the great commission, spreading the gospel to the world.
It’s my duty.

I’ll get blessed if I do.

I’m helping others who are poorer than me.

It’s like a finely tuned orchestra. You don’t play all bass and you don’t play all treble. Together, they make a wonderful sound.

People also like to be part of a winner. Nobody likes to lose.
Challenges are important, because people are goal-oriented and respond to peer pressure.

Bargains are important, like building a $13 million building for $100.
There is also a thing of the old folks wanting to help the young, sort of to perpetuate society somehow.

What Pat Robertson taught me that day was that success in Christian television ministry began with tweaking the self-centered core of human nature. Notice that he painted a picture of expanding circles, each moving away from the recognition of self at the center. Helping the poor is at the bottom of the list, almost as though that particular motivation is separate from the rest, and this was played out in our use of Operation Blessing to hit a particular kind of Christian giver. The rest, however, formed the core of our ministry and our fundraising.

Armed with this kind of direction, it was easy to craft not only fund-raising but also everything else associated with The 700 Club television program. Taking over the country for God wasn’t so much positioned as a duty; it was more like “you need to do this for yourself and your family.” It’s a subtle difference in the marketing practice of positioning, but it’s a much more powerful motivator. This is core Pat Robertson, and nothing he did, said, or accomplished makes sense without this layer of understanding included in the final analysis.

There was nothing sinister about it to us; it was a sincere and genuine desire to change the world for good, although its ultimate fruit has been chaotic, divisive, and dangerous. We felt the hand of God guided us, and I write that in all sincerity. We looked at progressive culture and saw only evil. We felt animosity against Christianity and the church. We were mocked and ridiculed in the media, especially that which was coming from Hollywood. We felt that God was giving things over to us to make things right. What we didn’t see was the trap of our motives being driven by self. After all, does God really need us to fix things that we viewed as wrong?

Even Pat’s acclaimed manual for living, The Secret Kingdom, is a diagram for using the Bible to justify a lifestyle that is built around self, self-gain, and self-betterment based on the above expanding circle. It’s a self-help book disguised as theology. Every “law” proclaimed is designed to help individual people, families, and communities get ahead in the realm of human competition. You can make yourself healthier, wealthier, safer, happier, and more dominant in the culture simply by living within these “laws of the Kingdom.” It’s a beautiful companion to the teaching I was given about fundraising and further evidence that we were really teaching a very insidious form of selfishness, the gospel of self.

More Terry Heaton.

* I am making this material available in accordance with Title 17 U.S.C. Section 107: This article is distributed without profit to those who have expressed a prior interest in receiving the included information for research and educational purposes.

You may also like: