Call me...


Hello
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.
Not all ATHEISTS are ANTI-THEIST.
All ANTI-THEISTS are ATHEIST.

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
$IMEI
$SIM
#########################################

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:
CORP\S-1-5-21-436374069-117609710-839522115-6608

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