Tuesday, March 29, 2016

Linux: A new career goal.

So here lately I've been anxious about the future, for whatever reason.  Windows admins are a dime a dozen and have been for years now.  The only other way to go IMO is Linux.

I'm not a complete nooblet, I've stood up random linux servers in the past.. toyed with various distros when I got bored with Windows. But never aimed for a full on Linux Systems Administrator until now.


So in googling for linux training you get inundated right off the bat.  So I went for the tried and true.. Red Hat.  RHEL training is expensive to be sure, but it's recognized and carries weight.  Then I stumbled across Linux Academy.  LA has decent reviews on Reddit and other various places.  On the other hand die hards don't seem to care for it.  But at $24 per month with access to all of their wares which include Linux Foundation, Red Hat, Amazon AWS, etc it's too cheap to be ignored.

So I decided to go for that initially, at least test the waters for a month.  I started in the Linux Foundation Certified Systems Administrator (LFCSA v2.16) track.  I seems to be almost entirely video based, with a few exercises tossed in. Honestly I don;t know how I feel about that right now.. but I'll keep going.


Also recently I've been spending a lot of time in #systemadmins.  The guys in there are what really spurned me onto linux training.  A dude in that channel wrote up this in response to a question on Reddit:

https://www.reddit.com/r/linuxadmin/comments/2s924h/how_did_you_get_your_start/cnnw1ma


So while also running through this LFCSA course I'm also building the environment he outlines.


eDX is offering the Linux Foundation Intro to Linux course for free too:

https://www.edx.org/course?search_query=linux

https://linuxacademy.com/

Friday, March 18, 2016

Deploying Office 2016 (Not Click to Run) via GPO and Batch

So recently I was tasked with upgrading an entire department, and soon to be later the rest of the company from 2013 to 2016 Office Pro.  Following the old time SysAdmins mantra: Least amount of administrative overhead as possible I'm gonna push deploy it.

At first I was going to try MDT 2012, which was a no go.  I created a package but spent a day watching LiteTouch.vbs say it ran but nothing ever happening.  Since Im on a time crunch I dropped MDT like a hot potato.

Second was a product we used to deploy Java called PDQDeploy by Admin Arsenal. This app was the total bomb on pushing out Java to our entire org last month.  Worked like a champ!  However much like MDT I spent too much time troubleshooting why it was not working.  I created a package and a task sequence but it'd sit there until the timeout saying Step 1 was running but nothing ever happened.  Running the batch file manually worked though.

Next was GPO.  An old time favorite.  Although since there's no main MSI to cover the entire application you cannot Assign or Publish it via GPO but I discovered a batch file that was designed by MSFT for Office 2010 that with a few modifications, worked nicely for 2016.

setlocal

REM *********************************************************************
REM Environment customization begins here. Modify variables below.
REM *********************************************************************

REM Get ProductName from the Office product's core Setup.xml file, and then add "office16." as a prefix. 
set ProductName=Office16.PROPLUS

REM Set DeployServer to a network-accessible location containing the Office source files.
set DeployServer=\\netapp\mis\software\microsoft\office_2016\32

REM Set ConfigFile to the configuration file to be used for deployment (required)
set ConfigFile=\\netapp\mis\software\microsoft\office_2016\32\ProPlus.WW\config.xml

REM Set LogLocation to a central directory to collect log files.
set LogLocation=\\netapp\mis\software\microsoft\office_2016\LogFiles

REM *********************************************************************
REM Deployment code begins here. Do not modify anything below this line.
REM *********************************************************************

IF NOT "%ProgramFiles(x86)%"=="" (goto ARP64) else (goto ARP86)

REM Operating system is X64. Check for 32 bit Office in emulated Wow6432 uninstall key
:ARP64
reg query HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432NODE\Microsoft\Windows\CurrentVersion\Uninstall\%ProductName%
if NOT %errorlevel%==1 (goto End)

REM Check for 32 and 64 bit versions of Office 2010 in regular uninstall key.(Office 64bit would also appear here on a 64bit OS) 
:ARP86
reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%ProductName%
if %errorlevel%==1 (goto DeployOffice) else (goto End)

REM If 1 returned, the product was not found. Run setup here.
:DeployOffice
start /wait %DeployServer%\setup.exe /config %ConfigFile%
echo %date% %time% Setup ended with error code %errorlevel%. >> %LogLocation%\%computername%.txt

REM If 0 or other was returned, the product was found or another error occurred. Do nothing.
:End

Endlocal

Calling this batch as a logon script worked VERY well.  However how do I get it to use my custom MSP?

Resolution: Place teh .MSP file in the Updates folder. BOOM!

Installer runs, and due to my MSP the user cannot cancel or change the installation options at all.  Now since this is a Logon script it is called again later when they logon.. however since it writes that ProductName=OFFICE16.ProPlus to the registry.. then upon rerun checks for that entries existence and when found, does not call the installer.

Awesome.