Loading...

Installing VMWare PowerCLI – A life changer

If you don’t already work every day in command line in the Information Technology world, I’d recommend you start…. if only to use this tool. This tool removes some of the time consuming clicks required in the GUI — not to say it is at all hard in the GUI, but when you are dealing with hundreds of machines at a given time, you will learn more about what I mean over time.

Installation

Run the following:

Install-Module -Name vmware.powercli -Scope AllUsers

You may also use CurrentUser for the scope if you’d prefer.

And then of course to use it:

Import-Module vmware.powercli

Research

Now get comfy and start researching. The capabilities with existing knowledge of Powershell scripting…. possibilities are endless.

https://code.vmware.com/docs/5060/cmdlet-reference/doc/Start-VM.html

Office Deployments

At first, I thought deploying Office 2019 the “new way” was daunting and it seemed like it was going to be a pain to deploy. It really isn’t. Even if you haven’t done it before. Here’s the basic process of it. There are tons of things you can do with it but this grazes the top to get you moving along with a quick deployment.

So the following will guide you through installing Office 365 for use on machines with Terminal Services deployed. You can of course remove the property to enable this if you wish.

Step 1 – Download the tool

Obtain the office deployment tool:

http://www.microsoft.com/en-us/download/details.aspx?id=36778

Of course you can Google Office Deployment Tool as well. Microsoft has a thing for moving stuff around more than I’d like them to.

Step 2 – Run and extract the goodies (for the lesser experienced, don’t stop now, the rest is easy!)

Run the tool, extract to a location of your choosing. Once complete, open Powershell and navigate to the folder. IE:

cd C:\Office2019

Step 3 – Configure the config XML file

You’ll notice they’ve included some pre-configured answer/ config files for us to use. Let’s open either the 64 or 32 bit version in a text editor like Notepad. Make sure to add the following “SharedComputerLicensing” property if you are using terminal services (Remote Desktop Deployments).

Be sure to modify things like the product id as needed. Here is a link with a list of IDs:

https://support.office.com/en-us/article/product-ids-that-are-supported-by-the-office-deployment-tool-for-click-to-run-77654e77-aaeb-4ed6-84eb-1d8b0e086590

Here’s a list of IDs that could be used in case Microsoft moves their page….. (the first 3 are the Office 365 Editions):

  • O365ProPlusRetail
  • O365BusinessRetail
  • O365SmallBusPremRetail
  • Excel2019Volume
  • HomeBusinessRetail
  • HomeBusiness2019Retail
  • HomeStudentRetail
  • HomeStudent2019Retail
  • O365HomePremRetail
  • ProfessionalRetail
  • Professional2019Retail
  • ProjectPro2019Retail
  • ProjectPro2019Volume
  • ProjectStdXVolume
  • ProjectStd2019Retail
  • ProjectStd2019Volume
  • ProPlus2019Volume
  • Standard2019Volume
  • VisioPro2019Retail
  • VisioPro2019Volume
<Configuration>
<Product ID="O365ProPlusRetail">
<Language ID="en-us" />
</Product>
</Add>
<Display Level="None" AcceptEULA="TRUE" />
<Property Name="SharedComputerLicensing" Value="1" />
 <Updates Enabled="TRUE" Channel="Monthly" />
</Configuration>

Google is your friend when you don’t know one of these properties. 🙂

Step 4 – Run it!!

Run it, deploy it, download it, whatever you want! Both commands are shown below. Download is good for network deployment. Run is great for a local install.

.\setup.exe /configure configFileName.xml OR .\setup.exe /download configFileName.xml

Grow with Google – My take on it

I took some time to do the IT course “Grow with Google – IT Support Specialist Certificate”. It wasn’t as much to learn things as to prove to myself that I knew a thing or two about IT. The course as I expected was easy in many areas, but it did start proving difficult because it covers such a broad range of areas. There were also topics discussed like CIDR format which I was intrigued by only to find I already knew exactly what it was, I just didn’t realize it had a special name. I learned terminology and some of the background inter-workings of things that I didn’t previously know so it was definitely nice to have some supplemental training on topics I’ve already been exposed to.

I’d recommend it for most people, especially those that have some beginning knowledge in IT already. Some of the first courses that took me next to no time to complete like the system administration stuff, I felt would be hard for someone that had never been involved with Linux or Windows. However, I went straight to the labs and skipped over material, so I can’t make an official opinion of it.

CTRL of user accounts in Linux – Quick tips

Disable an account

sudo vipw

Modify the appropriate user you wish to disable from /bin/bash to /bin/disabled

webuser:x:500:500:webuser:/home/webuser:/bin/disabled

***This option will NOT prevent login over SSH***

Modify account password or lockout account

Lockout:

passwd -l <<username>>

The -u argument instead of -l will set the account as unlocked.

Modify Password:

passwd <<username>>

Curious for more details on who has attempted logon?

faillog -a

 

Keep in mind, aside from locking a user out, it is equally important to make sure you properly lock down your firewall to expose ports like 22 only to specific IPs. Don’t leave yourself exposed to the world.

The importance of redundancy

Today I had an experience that is not too far off from experiences I’ve seen and experienced in the past, though, not directly caused by me. As a typical (non-ma’ pa’) business setup, it is perfectly normal to have 2 or more domain controllers with DNS on a Windows based network. You ALWAYS want to point your DNS settings in DHCP to your domain controllers (Note the s in that last word). The experience was of maintenance on a server that caused a partial network ‘outage’ as it wasn’t able to find a second DNS server when maintenance was started on the Domain Controller 2. The problem came when, out of our 4 domain controllers, the one I happened to be doing maintenance on was the only one in use by the network…… (and mind you this is a 2008 domain controller, not our Server 2016 domain controller, yes that is an 8 year old server).

This is why redundancy is SO important. You should ALWAYS specify 2 DNS servers if you are in charge of a network. And you should be very conscious of what servers could be decommissioned in the future as well. You should feel a nasty feeling in your gut until you have a second one in there. You should always have more than 1 uplink to your VMWare hosts preferably on a secondary network card. Hardware failure isn’t super common these days, but it does happen. If your company is larger, you want to be sure you have HA (high availability) running on your core network equipment. You want to pay for a second internet provider.

Whether it is a network, a virtual machine, or something else that is business critical, PLEASE make sure you have redundancy built in to prevent issues like this. And if you are the one performing maintenance, you do always want to go over a mental checklist of what a server is performing for the business. If you are also controlling the network, you should NEVER have holes as giant as specifying only 1 DNS server in your network.

Please note, I was not responsible for the network in this particular scenario.

System image vs post install scripts

When it comes to a system image vs running scripts to set up a new computer and the necessary software, I find there is a healthy balance. On one hand it makes much more sense to create an image so out of the box its ready to go, but on the flip side, you have to update the drivers, the software, etc. In my experience, it makes sense to have a balance of both. Install items that update frequently via script so you aren’t plagued with updating your image 5 times a month or manually updating the software on deployment, or just install it via script. Usually installers these days pull the latest version anyhow and its not like the older days where it would be a static version that you downloaded. Take Ninite for example. I’d prefer running it once to having Chrome, Firefox, and whatever other small apps the company required be out of date 2 weeks after I created the image. Granted, the licensing can be a bit spendy for some companies. Some might argue…. why not just run Ninite again to update them. True… easy enough, but why? I like things “fresh”. “Clean”. Call me the tree hugger version of the IT squad I guess. Regardless, there’s never a one-option solution in IT. And that is one of the things that makes it so great!

Change all users to an alternate domain suffix

In Active Directory users and computers, right click Queries> New. Give it a name, click “define query”. Stay on the “Users” tab. Select “Is not” and type an invalid name like testtesttest. Click ok, ok. It should return a result with all users whose name is <<not>> testtesttest. Select all, right click> Properties. Go to Account tab> check “UPN Suffix” and change it to the appropriate suffix. That’s it! There are PowerShell methods to do this too but when handling hundreds of user accounts, you have to be absolutely careful in PowerShell. There are solutions online that work fine that I am not going to post here. This is purely for the GUI. Good luck!

Exchange and AD Powershell Useful Commands

I’ve had a few odd issues & tasks with Exchange 2010 and AD recently and wanted to take a moment to document them as well as the command used to resolve the issue:

The following command was useful to resolve an issue of multiple copies of the same shared mailbox showing where only one would allow access and the other copies would only fail to open.

Add-MailboxPermission -Identity <shared mailbox alias> -User <your mailbox alias> -AccessRights FullAccess -InheritanceType All -Automapping $false

The following will find all active user accounts whose Password Never Expires attribute is set to true formatted in a nice table of username and the value. Value is not really necessary because it should only return true, but everyone loves a sanity check right?

get-aduser -filter * -properties Name, PasswordNeverExpires | where { $_.passwordNeverExpires -eq "true" } | where {$_.enabled -eq "true"} | Format-Table -Property Name, PasswordNeverExpires -AutoSize

Set up Blue Iris Surveillance software with IFTTT

I have two cameras in which I’d like to always have a notification for if I’m not home. Initially I set this up to always send me an alert but I’m sure as you can imagine, my phone blew up with me walking around. Blue Iris has a neat feature which is simply a traffic light. If red, it will disable various things including recording (not desired for me in this case), but it can also disable alerts. I selected to only disable alerts if the traffic light is red. In the past, I had never used this feature. So here’s a brief how-to.

Click settings button and modify the settings as illustrated.

Set User Account that will perform this action.

Set Traffic Signal to Alerts Only

Verify web server port & disable Secure only for the web server

  1. On your server computer (Blue Iris Windows machine), install something like WAMP or XAMPP to handle web requests.
  2. After install set up a script similar to this one in PHP (create a php file with the name of your choice and .php extension):
    1. After you’ve created the script, drop it in your HTDOCs directory in WAMP or XAMPP
      1. For example, my directory is here: C:\Bitnami\wampstack-7.1.19-0\apache2\htdocs
<?php
$home = $_GET['home']; //get and set variable for the home status.
$my_file = 'log.txt'; //store logs so we know if our server is being used improperly and by whom

if($home == 'true')
{
	$handle = fopen($my_file, 'a') or die('Cannot open file:  '.$my_file);
	$data = date("Y.m.d.h.i.s") . ' on requesting ip: ' . $_SERVER['REMOTE_ADDR'] . ' Request to set RED.' . "\r\n";
	fwrite($handle, $data);
	fclose($handle);
	file_get_contents("http://10.1.1.99:8080/admin?user=admin&pw=password&signal=1");
	echo "home";
}
elseif($home == 'false')
{
	$handle = fopen($my_file, 'a') or die('Cannot open file:  '.$my_file);
	$data = date("Y.m.d.h.i.s") . ' on requesting ip: ' . $_SERVER['REMOTE_ADDR'] . ' Request to set GREEN.' . "\r\n";
	fwrite($handle, $data);
	fclose($handle);

	file_get_contents("http://10.1.1.99:8080/admin?user=admin&pw=password&signal=1");
	echo "away";
}
else
{
		
	$handle = fopen($my_file, 'a') or die('Cannot open file:  '.$my_file);
	$data = date("Y.m.d.h.i.s") . ' on requesting ip: ' . $_SERVER['REMOTE_ADDR'] . ' FAILED REQUEST!!! Request: ' . $home . "\r\n";
	fwrite($handle, $data);
	fclose($handle);
	echo "invalid";
	//donothing
}
?>
  1. Now let’s explain the URL in there so you can get an idea of what is happening and how Blue Iris is interpreting it. http://10.1.1.99:8080/admin?user=admin&pw=password&signal=1
    1. Where 8080 is the port you’ve set blue iris to
    2. User is the user account you create in Blue Iris
    3. PW is the password for said account (recommended to restrict this account down to admin tasks only not viewing rights or anything else).
    4. Signal is the traffic symbol where 1 is active (green) and 0 is inactive (red).
  2. Now if you browse to your local host URL 127.0.0.1/myphpfile.php?home=false you should have a value returned. In this case, you should see “away” in your web browser. If you see this, that means your PHP script is working. Blue Iris at this point should also change the animation in the traffic symbol.

  3. Let’s take a moment to understand all of what just happened and why. You set up a web server with a script to change the alert status on the local Blue Iris machine. Now you’ll need to expose the web server to the internet (or if your security aware, you may also set it to only work with IFTTT IP addresses). This step I will not outline as there are too many router combinations, but you need to port forward to your web server.
  4. IFTTT is super easy! Just log in, select Location for the “this” (set up an enter an area and set it appropriately for your home) and a “that” with a webhook in which you will put in your IP/ domain so something like x.x.x.x:PORT/myphpfile.php?home=true for enter and home=false for exit. You will create 2 webhook applets, one for enter and one for exit, each with the appropriate URL.

This guide is somewhat advanced as it assumes you know/ can port forward and you have a static IP or a domain set to change with your IP.