Friday, June 5, 2020

Corona and the Church

Corona and the Church

As a Church we have allowed ourselves to be complacent to the real battles happening around us. We talk about the Spiritual war that is being fought, but we tend to shy from the reality of it, and even try to be ignorant to its affects, and the strategies being used to take ground.

According to Ephesians 6:12 For we do not wrestle against flesh and blood, but against the rulers, against the authorities, against the cosmic powers over this present darkness, against the spiritual forces of evil in the heavenly places.

The chapter goes on to explain how we can put on the armor of God, and be truly prepared for Spiritual battle. Which is a critical, yet often times neglected part of our Christian lives.

Currently we are living through an incredibly significant world event, and as a Church we are being tested on how we handle it. This test is very visible to ourselves, our neighbors, and our nations; but more importantly the enemy. There are Christians that would criticize me for calling this a Spiritual battle; but make no mistake, everything going on around us has a spiritual significance. It is easy to go about our daily lives and pretend that our mundane decisions have no meaning, yet 1 Cor 10:31 talks about glorifying God in everything we do, even eating!
So, if every mundane thing we do has significance to the spiritual world around us, then how much more so would an event like what we are going through now?

Satan has one goal, to oppose God. In this opposition his greatest achievement would be the destruction of God’s creation, and the being that was created in God’s image. Satan is also the greatest of deceivers and a strategist unlike anything we can comprehend. Don’t get me wrong here, God is infinitely greater, and infinitely more wise; but as humans, if we don’t rely completely and totally on God, and from a place of honesty, I find myself lacking that reliance more times that I would care to admit, then we are falling victim to our limited humanity. According to 1 Corinthians, human wisdom would consider the cross pure foolishness, and if our wisdom would consider something so fundamentally important to our relationship with God foolish, then how easily could we be duped by the great deceiver?

How then does all this tie in to the pandemic our world is facing right now? As a Christian I must believe that this is all part of a larger Spiritual Battle. It would be ignorance to believe otherwise. Throughout history, every great general, every great strategist uses everything to their advantage that they can. This includes the natural, the political, and yes, the viral. If human strategists with their incredibly limited scope of vision have won wars using what is already around them, what is already happening, why then wouldn’t the enemy? I cannot say if he is the mastermind behind the entire thing, if he manipulated it into being, or if he is simply taking advantage of it; but, I know without a doubt that he is using it, simply by what the Bible tells me about him, and about the spiritual.

One of the more frequently quoted versus of the Bible to describe the enemy, and our redemption is John 10:10
The thief comes only to steal and kill and destroy. I came that they may have life and have it abundantly.

The Greek word for thief here is kleptēs, which, according to Strongs, is also used figuratively as the word for false teacher.
The Greek word for kill here is thuo, which literally means to kill, or slaughter.
The Greek word for destroy here is apollumi, which literally means to destroy, but figuratively means to render useless.

When I dig into this verse the depth of its meaning is so incredible! The word meanings show just how serious we should be taking the enemy.

On a most basic level, he wants to kill us; but the nuances of his strategy are to trick us, render us useless, and then destroy us.

The American Church, and in many other places around the world, has been allowing this to occur for more years than I have been alive. We have slowly let ourselves be silenced to the point of where other Christians are offended for the lost when we speak the Truth, Love and Hope of Christ. That’s just the good stuff, if you even mention condemnation, or fighting what’s wrong you can be ostracized by your own brothers and sisters in Christ.

With the virus this has moved from a battle of simply silencing alternate opinions, to taking away rights and privileges. In the United States we separated the government’s ability to rule the Church and force a specific religion on the people, then we allowed the government to separate us completely from itself, now we are allowing the government to separate us from each other and essentially negate the original intention of removing the government’s ability to make decisions over the Church. This virus is absolutely being used as a tool by the enemy, and it is proving to be incredibly effective and incredibly dangerous to the Church. It is dividing us from our neighbors, and dividing the very Church itself. It is sowing distrust, hatred, and rebellion against God. Pastor Ken Peters of Covenant Christian in Spokane recently said that “Romans 13:1 only applies when we are not in disobedience to God when Mans’ rule doesn’t contradict God’s,” paraphrase. In Daniel we can read about Shadrach, Meshach, and Abednego who had no choice but to disobey the king in order to follow God’s law. We also read in Acts 5:29-32 we are admonished to obey God over man.

As Christians, in this time, and in these circumstances, what does this mean for us?

·         First and most importantly, we are under attack every second of every day. This has been the case since the very beginning. Be aware, be cognizant of your surroundings, and above all live by being led by the Holy Spirit in actions and in words.

·         Second, don’t use any circumstance to act out in civil disobedience just for the sake of a human cause. This can only lead to further damaging the Church, our testimony, and our ability to speak truth into the lives of the lost.

·         Third, be strong in your faith don’t make compromises to what is Biblical, yet as 1 Cor 16:14 states Let all that you do be done in Love.

·         Fourth, be considerate of those that have health problems, or are considered vulnerable. The Bible talks over and over about loving one another, considering your neighbor over yourself, and in Philippians 2:3-4 The Bible talks about not using selfish ambition to act, but rather to consider others interests above your own.

·         Fifth, my final point is to not live in fear, fear is from the enemy and can drive us to do things that are contrary to Christ. The Bible is full of passages about giving Him your burdens, and giving Him your fears. 1 Peter 5:7 says it simply, yet beautifully Cast your fears on Him, because He cares for you

As a Church we must do what’s right before God; but walk delicately and in Spiritual wisdom. We must not trample on our fellow man, yet we also must not give an inch to the enemy.

 

Kristopher C. Roy 26May2020


Wednesday, September 20, 2017

O365 Security & Compliance Center PowerShell (MFA)

As many admins get used to using the Security and Compliance in O365 they will find that certain tasks, like purging mail, require the use of PowerShell(POSH). Unfortunately this can be difficult if you have MultiFactor Authentication enabled(MFA), 98% of the articles I have found contain the old connection method which does not work for MFA.

The good news is that MS has released a new version of the Exchange Online Module, which contains native commands to both connect and use the Security & Compliance Center functions and supports MFA.

Solution:
1. Download the new Module.
  • Log-in to O365 Admin Center
  • Select the link in the bottom left, under Admin centers, labeled Exchange
  • Click the Hybrid Link on the left panel
  • Click the Configure Button under the Exchange Online PowerShell Module, this should install the new module.
  • If You can not get the Download Module to work, check out this article Support.Microsoft.Com
2. Run the Module
  • The new Module should install to your Start Menu, simple search and run "Microsoft Exchange Online Powershell Module.
3. Connect to the Security & Compliance center
  • Run the following command:
    Connect-IPPSSession -UserPrincipalName "yourlogon"
  • At this point your MFA Pop-Up should occur and you will be prompted to continue entering credentials.
4. If you wish to now Purge any email you must first build the rules and run the search. See this article on Support.Microsoft.Com


5. And the Final Step, run the purge from the POSH Session.
  • Run the following command:
    New-ComplianceSearchAction -SearchName "The Name that you gave your Search" -Purge -PurgeType SoftDelete

Wednesday, October 22, 2014

Multiple Prompts SharePoint

If you are like me and many other SharePoint admins out there, you have run into this problem.

Scenario One: User launches SharePoint page from inside the domain and they get prompted for credentials.
Scenario Two: User launches SharePoint through VPN and gets prompted for credentials.
Scenario Three: Every resource or new site prompts the user for credentials.
Scenario Four: Extranet SharePoint site continually prompts for credentials.

In this days and age of (SSO) Single Sign On, users expect to log in once and then never be prompted again. Personally I have my Facebook and Google+ connected all over the place so that I can get into just about everything with-out prompting. Unfortunately internal corporate solutions require a little more security. Even more unfortunately SharePoint is extremely sensitive to security configurations, everything from the servers registry to the security on the databases. If you do a quick Google search you will see page after page of possible solutions, and for the most part they are all correct; but. they are correct for different causes. In most cases you are actually being plagued by several issues causing the same problem. So I will do my best to consolidate all of the solutions out there.

Solutions:
1. Internet Security - Ensure that your local security policy, group policy, or basic internet settings have your SharePoint site set in Trusted sites, or Local intranet. This is probably the easiest and least invasive thing you can do.

  • Make sure that you have a couple things configured properly for your local intranet, or trusted sites setting. First, ensure that 'Automatic Logon' is enabled. If your SharePoint URL contains periods then IE automatically assumes that it is on the internet. You can read more on the Technet site

2.Verify that you have correctly configured your alternate access mappings in SharePoint - 2013, 2010

3. Modify your Web.Config

<system.webServer> 
  <security> 
    <requestFiltering allowDoubleEscaping="true"> 
      <verbs allowUnlisted="true"> 
           <add verb="OPTIONS" allowed="false" /> 
          <add verb="PROPFIND" allowed="false" /> 
       </verbs> </requestFiltering> 
     </security> 
</system.webServer>


4. In IIS modify the web application to use NTLM instead of Kerboros

5. Dealing with an Extranet requires a little more configuration to your servers if you wish to avoid credential prompting.
From Technet
"Extranet users that want direct editing:
Use Forms Based Authentication (FBA) with persistent cookies – The only way to maintain direct-edit functionality and also not be prompted by the Office application is to implement a proxy/firewall server by using Forms Based Authentication with persistent cookies such as an Internet Security and Acceleration (ISA) server or a Forefront Threat Management Gateway.
Extranet users and direct editing is not needed:
Disable Client Integration or the OPTIONS/PROPFIND Verbs  -  If the site provides WebDAV functionality through another extension, the provider of that extension should be engaged. For example, to do this with Windows SharePoint Services (WSS), the site should be configured to disable Client Integration, or the OPTIONS and PROPFIND verb should be inhibited. (To inhibit the OPTIONS and PROPFIND verbs on Internet Information Services (IIS) version 6, remove the verbs from the registration line in the web.config file. On IIS 7.0, use the HTTP Verbs tab of the Request Filtering feature to deny the verbs.) Be aware that this approach will open the content in read-only mode because this approach disables direct-edit functionality."

Monday, June 9, 2014

How-To Automate boring Repetitive Android Tasks

Step 1: Install an Android Virtualization app called Bluestacks http://www.bluestacks.com/ or Andy http://www.andyroid.net/
note: you do not need an android phone to do this
Step 2: install your program or application inside of your emulator
Step 3: Install Ghost Mouse http://www.ghost-mouse.com/ or find another mouse click recorder that you like
Step 4: Run your app inside of your Android emulator
Step 5: Get to a point in the game or application process that can be repeated.
Step 6: Start your mouse recorder and complete the task in the application from start to finish, make sure that you end on the same screan as you started.
Step 7: Run your recorded Mouse macro as many times as you wish.

Monday, April 7, 2014

Cloud SharePoint Storage Reporting

Recently we had an issue with our Dynamics CRM pegging site quotas on our Cloud SharePoint. We had no monitoring, and nothing besides error messages notifying us that we could no longer add anything to our sites. I have personally tried to avoid our Cloud SharePoint solution, and focus on our On-Prem, but this became a very high priority to our management, very quickly. They asked me about any time of storage monitoring solutions, so of course I went out and "Googled" it, or if you drink the MS Kool Aid "Bing" it, lol. What I found was that most of the solutions for accomplishing what they wanted, came as part of a solution package. So I decided, lets try and save some money. My first thought was, "I know I can pull these stats on-prem, but who knows with cloud." Cloud SharePoint Powershell can be somewhat limited, but this time we lucked out.
So with that, lets get to the good stuff.
Step 1: If you haven't already done so,Download and set-up the "SharePoint On-Line Management Shell"
Step 2: If you want to schedule this then you need to set up an SPO Credential Script:

#Import the SharePoint Online Module
Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking
#Hardcode your Credentials - Remember these must be your Cloud Creds
   $UserName = "TankCR@MyCreds.Com" $Password = "IWishIHadAG00d1"
#Set the Cred String
   $cred = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $userName, $(convertto-securestring $Password -asplaintext -force)
#Set your Cloud Admin URL
   $Url = "https://mysite-admin.sharepoint.com"
#And Finally Connect your Session
Connect-SPOService -url $url -Credential $cred 


Step 3: Build your reporting Script, a few things of note:

  •    I wrote this Script to create an excel specifically formatted XML file, then convert it to an XLSX, obviously there are more direct ways to accomplish this, but I am only a scripter, not a programmer ;)
  •    There are Patterns in this script that are necessary for formatting your output, you will need to modify these to your environment, and I will point them out when we get to them, Also here is a great tool to help you format and test your patterns. http://regex101.com/

#The First thing we must do is call our SPOCreds Script
$SPOCred = "PathToScriptFile such as C:\Scripts\SPOCreds.PS1"
invoke-expression -Command $SPOCred
#Now Set your Output File Locations, use your temp folder
$File = "$env:TEMP\usage.xml"
$File2 = "$env:TEMP\usage.xlsx"
#Now as I want this to be scheduled and Faced on my On-Prem SharePoint I set a net location to put the final copy
$NetLoc = "\\myonpremsharepoint.local\sites\reporting\Shared Documents\"


This is our first Pattern, in this Pattern I am grabbing three different sections of the URL's so that I can sort my report automatically based on the core part that is similar across my sites. You will need to modify this to your site use http://regex101.com/ if you need help doing so...

$Pat = "(.*)(CRM.*_?)(_.*)"

Now we grab and store our sites in a sorted manner, I am first sorting by the pattern we set up top, then I am sorting by the sites using the highest percentage of their quotas.
$Sites = (Get-SPOSite -Detailed -ErrorAction Ignore -limit all)|sort -Descending -Property {$_.URL -replace $Pat,'$2'},@{e={[INT]($_.StorageUsageCurrent)/[INT]($_.StorageQuota)}}

Now the Excel formatting requires a proper count on our Rows or it will error out, so we are going to grab a count on how many sites we have:
$Number = $Sites.Count
OK, lets create our XML File, this is the initial formatting that it will need to understand what it is, and what styles we are using.
(
 '<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
 xmlns:o="urn:schemas-microsoft-com:office:office"
 xmlns:x="urn:schemas-microsoft-com:office:excel"
 xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
 xmlns:html="http://www.w3.org/TR/REC-html40"
 xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml"
 xmlns:udc="http://schemas.microsoft.com/data/udc"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile">
 <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
  <Author>Kristopher Roy</Author>
  <LastAuthor>'+$env:USERNAME+'</LastAuthor>
  <Created>'+(get-date)+'</Created>
   <Version>15.00</Version>
 </DocumentProperties>
 <OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">
  <AllowPNG/>
 </OfficeDocumentSettings>
 <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
  <WindowHeight>12435</WindowHeight>
  <WindowWidth>25500</WindowWidth>
  <WindowTopX>0</WindowTopX>
  <WindowTopY>0</WindowTopY>
  <ProtectStructure>False</ProtectStructure>
  <ProtectWindows>False</ProtectWindows>
 </ExcelWorkbook>
 <Styles>
  <Style ss:ID="Default" ss:Name="Normal">
   <Alignment ss:Vertical="Bottom"/>
   <Borders/>
   <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000"/>
   <Interior/>
   <NumberFormat/>
   <Protection/>
  </Style>
  <Style ss:ID="s27" ss:Name="Bad">
   <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#800000"/>
   <Interior ss:Color="#FFC7CE" ss:Pattern="Solid"/>
  </Style>
  <Style ss:ID="s26" ss:Name="Good">
   <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#008000"/>
   <Interior ss:Color="#C6EFCE" ss:Pattern="Solid"/>
  </Style>
  <Style ss:ID="s62" ss:Name="Hyperlink">
   <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#0066CC"
    ss:Underline="Single"/>
  </Style>
  <Style ss:ID="s28" ss:Name="Neutral">
   <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#993300"/>
   <Interior ss:Color="#FFEB9C" ss:Pattern="Solid"/>
  </Style>
  <Style ss:ID="s63">
   <Borders>
    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/>
    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2"/>
    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"/>
    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2"/>
   </Borders>
   <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000"
    ss:Bold="1"/>
   <Interior ss:Color="#D0CECE" ss:Pattern="Solid"/>
  </Style>
  <Style ss:ID="s64">
   <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
  </Style>
  <Style ss:ID="s66" ss:Parent="s62">
   <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
  </Style>
  <Style ss:ID="s68" ss:Parent="s26">
   <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
   <NumberFormat ss:Format="0%"/>
  </Style>
  <Style ss:ID="s70" ss:Parent="s28">
   <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
   <NumberFormat ss:Format="0%"/>
  </Style>
  <Style ss:ID="s72" ss:Parent="s27">
   <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
   <NumberFormat ss:Format="0%"/>
  </Style>
    <Style ss:ID="s90" ss:Parent="s62">
   <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
   <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#0066CC"
    ss:Bold="1" ss:Underline="Single"/>
   <Interior ss:Color="#FFE699" ss:Pattern="Solid"/>
  </Style>
 </Styles>
 <Worksheet ss:Name="Site Quotas">
  <Table ss:ExpandedColumnCount="9" ss:ExpandedRowCount="'+($Number+1)+'" x:FullColumns="1"
   x:FullRows="1" ss:DefaultRowHeight="15">
   <Column ss:AutoFitWidth="0" ss:Width="100.5"/>
   <Column ss:Width="441.75"/>
   <Column ss:Width="247.5"/>
   <Column ss:Width="33.75"/>
   <Column ss:Width="41.25"/>
   <Column ss:Width="73.5"/>
   <Column ss:Width="77.25"/>
   <Column ss:Width="117.75"/>
   <Column ss:Width="105"/>
   <Row ss:AutoFitHeight="0">
    <Cell ss:StyleID="s63"><Data ss:Type="String">Title</Data></Cell>
    <Cell ss:StyleID="s63"><Data ss:Type="String">URL</Data></Cell>
    <Cell ss:StyleID="s63"><Data ss:Type="String">Owner</Data></Cell>
    <Cell ss:StyleID="s63"><Data ss:Type="String">Quota</Data></Cell>
    <Cell ss:StyleID="s63"><Data ss:Type="String">Percent</Data></Cell>
    <Cell ss:StyleID="s63"><Data ss:Type="String">QuotaWarning</Data></Cell>
    <Cell ss:StyleID="s63"><Data ss:Type="String">ResourceQuota</Data></Cell>
    <Cell ss:StyleID="s63"><Data ss:Type="String">ResourceQuotaWarning</Data></Cell>
    <Cell ss:StyleID="s63"><Data ss:Type="String">StorageUsageCurrent</Data></Cell>
   </Row>')> $file


We are now going to iterate through each site collection and write them to our xml file. But of course we first need to set some parameters on how this will occur so that we can get the results we want.
FOREACH ($Site in $Sites){ 
#Gets the Site Owner, if it can't for some reason it sets the variable to just "Farm"
$Owner = if(($Site.Owner -eq $NULL) -or ($site.Owner -eq "")){$Owner = "Farm"}ELSE{$Site.Owner}

#Another Pattern, this one is to break down the URL's so that we can set the Title if one doesn't exist
$Pat = "(https?.\/\/)(\w*-?\w*)(.*)?"
if($Site.Title -eq $NULL -or $Site.Title -eq ""){$Title = ($Site.url -replace $pat,'$2')}ELSE{$Title = $Site.Title}

#Gets the Usage Percentage then sets the excel style so that higher percentages get color coded
$BasePercent = ($Site.StorageUsageCurrent / $Site.StorageQuota)
If ($BasePercent -ge ".75"){$Percent = ''+$BasePercent+''}
If (($BasePercent -lt ".75") -and ($BasePercent -ge ".60")){$Percent = ''+$BasePercent+''}
If ($BasePercent -lt ".60"){$Percent = ''+$BasePercent+''}


Now Lets write our rows formatted to our XML file.
#I wanted any sites with Prod in them to be highlighted, you can change this to whatever you like $URLCODE = IF($Site.URL -ilike "*Prod*"){"s90"}ELSE{"s66"} add-content $File ('') add-content $File (''+($Title)+'') add-content $File (''+''+($Site.url)+'') add-content $File (''+($Owner)+'') add-content $File (''+($Site.StorageQuota)+'') add-content $file $Percent add-content $File (''+($Site.StorageQuotaWarningLevel)+'') add-content $File (''+($Site.ResourceQuota)+'') add-content $File (''+($Site.ResourceQuotaWarningLevel)+'') add-content $File (''+($Site.StorageUsageCurrent)+'') add-content $File '' }

The last thing that we will write to our XML file is an XML component that closes it out.
add-content $file (
'    </Table>
  <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
   <Unsynced/>
   <Print>
    <ValidPrinterInfo/>
    <HorizontalResolution>600</HorizontalResolution>
    <VerticalResolution>600</VerticalResolution>
   </Print>
   <Selected/>
   <LeftColumnVisible>1</LeftColumnVisible>
   <FreezePanes/>
   <FrozenNoSplit/>
   <SplitHorizontal>1</SplitHorizontal>
   <TopRowBottomPane>1</TopRowBottomPane>
   <ActivePane>2</ActivePane>
   <Panes>
    <Pane>
     <Number>3</Number>
     <ActiveCol>1</ActiveCol>
    </Pane>
    <Pane>
     <Number>2</Number>
     <ActiveRow>10</ActiveRow>
     <ActiveCol>2</ActiveCol>
    </Pane>
   </Panes>
   <ProtectObjects>False</ProtectObjects>
   <ProtectScenarios>False</ProtectScenarios>
  </WorksheetOptions>
 </Worksheet>
</Workbook>')


At this point we will grab our file and convert it to a true excel file so that you can use it with the excel viewer web-part, we will also copy it to your network location and then delete it off your hard drive. (Important Note, to convert it to XSLX you must have excel installed on the machine where you run this)
 $objExcel = new-object -comobject excel.application
$UserWorkBook = $objExcel.Workbooks.Open($file)
$UserWorkBook.SaveAs($file2,51)
$UserWorkBook.Close()
copy $file2 $NetLoc
remove-item $file
remove-item $file2


Files:
SCsToExcel.ps1   SPOCreds.ps1

SharePoint 2013 Load Testing

If you have ever wanted to load test your SharePoint Environment I would highly recommend this step by step video done at SPC2014 by Todd Klindt and Shane Young. I will keep my eye out for a non-video step-by-step, or possibly write one out myself.
http://channel9.msdn.com/Events/SharePoint-Conference/2014/SPC381

Friday, September 27, 2013

Setting Environment Variable with Powershell

In this article I will give you a quick little script that will help you set environment variables that you can then call from any other script.
There are two ways to set Environment Variables and a couple ways to call them, we will start with the standard way of doing it.
setx
Lets say that you want to set your Home Environment, for instance you have a Development or QA server farm.

setx /m Home_Env "My_Company_QA"; This particular Command would set a system variable named Home_Env and the value to "My_Company_QA". This value can be seen in
"My Computer-Properties-Advanced System Settings-Environment Variables it is also written to the registry"

The second way, and less used is to write the value directly to the registry, which essentially achieves the same goal. $EnvRegKey01 = "HKLM:\System\ControlSet001\Control\Session Manager\Environment"
cd $EnvRegKey01
New-ItemProperty -Path $EnvRegKey01\ -Name "Home_Env" -Value "My_Company_QA"
This would accomplish the same as the above; however it directly sets it to the registry. Now if the ItemProperty already exists you can use a number of different options to the -ItemProperty such as:
remove-, clear-, and rename-. Just so as to not deal with writing in checks to my script I typically just run the remove first then the new. If your key does not exist it will throw an error though.

Now to Call the value in your other scripts you need to know that the standard call is Get-ChildItem or GCI, but this will not work if it is run in the same session that you set the value, so you will have to close and reopen powershell. However there is a way around that. But first the standard way to grab your value.
Get-ChildItem env:Home_Env
#to actually use it as a variable you will need to store it, I will use the shortened version
$HomeEnv = (GCI env:Home_Env).value
#Now $HomeEnv is -eq to "My_Company_Qa"

Now lets say you need the value in the same session you are in, to do this you will need to directly call the Registry value and write it to your variable
$HomeEnv = (Get-ItemProperty -Path $EnvRegKey01\ -Name "Home_Env").home_env