Hi, my name is Rolando, I am a Systems Administrator with proven skills in design, configuration, integration and administration of technological platforms with special strength in CyberSecurity as well as script coding for automating tasks, using Bash, Shell, PowerShell, PHP, Python, and others. Specialized in “Like Unix” Operating Systems with strong and extensive knowledge of Windows platforms and virtualization with KVM, Xen, LVM, VMware, I have too demonstrated ability to complete tasks accurately despite interruptions and competing demands. Results-oriented, with more than 20 years in the IT Technology industry.

<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> Generals | <span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> , , , , | Comments Off on Welcome

Installing PowerShell on Linux (Ubuntu 18.04)

As all you already must to know, I am a Linux enthusiastic, especially when it comes Ubuntu. But the truth is that in each company in which I had to work for the last five years, they are companies that base their technology platform mostly on Windows Server operating systems.

Because of that, I had to manage Windows servers, but little by little I am including services running on Linux servers, the great advantage all Linux users / administrators know. However, sometimes the integrations require using scripts in PowerShell, that’s why I have installed what is necessary to be able to call PowerShell for WMI queries to Windows servers from my natural BASH, PHP or Python scripts. So then, below, the step by step of how to install the PowerShell console on my Linux operating system (Ubuntu 18.04)

# Download the Microsoft repository GPG keys
wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb

# Register the Microsoft repository GPG keys
sudo dpkg -i packages-microsoft-prod.deb

# Update the list of products
sudo apt-get update

# Enable the "universe" repositories
sudo add-apt-repository universe

# Install PowerShell
sudo apt-get install -y powershell

# Start PowerShell
<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> Linux, Ubuntu, Windows | <span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> , , , , | Comments Off on Installing PowerShell on Linux (Ubuntu 18.04)

Get Installed Agents Windows Server

When I did need to check the Installed Agents in a lot of servers in the network, I decide to try it with an PowerShell Script, this script below do my job easy and quick. This did let me create a file report with each server information that I was looking for.

# Clear Screen
Write-Host Starting Checking proccess..

#Set the PWD to a LocalPath Vab

#Set the name of the file with all Server List to be checked
#Concatenate all the Path and File Name to check
$ListPath=$LocalPath.ToString() + "\" + $FileName.ToString()

#Read  the file  with all servers list and 
$Servers = Get-Content $ListPath

# Loop to check each Server in the list
foreach ($server in $Servers) { 
        Echo "**********************************************************************"
        Echo "Checking host: $Server"  
        Echo "**********************************************************************"
        #Query WMI information from remote system
        $S_error = ""
		Write-Host "Testing connection to $server"
		if (Test-Connection -ComputerName $server -Quiet -count 2){
			 Write-Host "$server is alive and reacheble"
			$Err = Get-WMIObject Win32_BIOS -computername $server -ErrorVariable S_Error -ErrorAction SilentlyContinue
        if ($S_error[0])
	        Write-Host "Having problem connecting to WMI on $Server... "
			Echo "Having problem connecting to WMI on $Server... "
            Echo "**********************************************************************"
            Echo " "

			Write-Host "Getting Information from $Server... "
            $OSInfo = Get-CimInstance win32_OperatingSystem -ComputerName $Server
            $OSInfo | Select-Object -Property @{Name="ComputerName";expression={$_.CSNAME}},@{Name="OS Name";expression={$_.Caption}},@{Name="ServicePack";expression={$_.ServicePackMajorVersion}},@{Name="Architecture";expression={$_.OSArchitecture}},Version,OperatingSystemSKU,@{Name='InstallDate';expression={$_.InstallDate}}
            $Net = Get-WMIObject Win32_NetworkAdapterConfiguration -ComputerName $server -filter ipenabled="true" | Format-List  
            # Echo "CUMPUTER NAME: $Server "
            Echo " NETWORK INFO:" $Net 
            Echo "**********************************************************************"
            $Agents = Get-WmiObject -Query "select * from win32_service where name like'%AmazonSSMAgent%'" -ComputerName $server | Format-Table -Property PSComputerName, Name, ExitCode, Name, ProcessID, StartMode, State, Status
            Echo " AGENTS FOUND at : $Server " $Agents
            Echo "**********************************************************************"
            Echo " " 
            Echo " "
			Echo "**********************************************************************"
            Echo " "

As you can see in the code, you’ll need a file called ServerList.csv in the same folder where you all ready have the past script, please remember that yo must to save the script as “.ps1” file extension.

<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> Windows | Comments Off on Get Installed Agents Windows Server