<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.2">Jekyll</generator><link href="https://theevolvingadmin.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://theevolvingadmin.com/" rel="alternate" type="text/html" /><updated>2022-11-21T18:22:03-05:00</updated><id>https://theevolvingadmin.com/feed.xml</id><title type="html">The Evolving Admin</title><subtitle>My technical/IT related musings and learning experiences</subtitle><author><name>Damien Solodow</name><email>bookwyrm79@gmail.com</email><uri>https://theevolvingadmin.com</uri></author><entry><title type="html">Declining MECM updates that aren’t visible in WSUS</title><link href="https://theevolvingadmin.com/2020/08/06/mecm-wsus" rel="alternate" type="text/html" title="Declining MECM updates that aren’t visible in WSUS" /><published>2020-08-06T00:00:00-04:00</published><updated>2020-08-06T00:00:00-04:00</updated><id>https://theevolvingadmin.com/2020/08/06/mecm-wsus</id><content type="html" xml:base="https://theevolvingadmin.com/2020/08/06/mecm-wsus">&lt;p&gt;Ever need to decline an update or updates from MECM, and then get stuck because the update isn’t visible in the WSUS console?&lt;/p&gt;

&lt;p&gt;This is pretty common with items from 3rd party catalogs, but sometimes you know &lt;strong&gt;exactly&lt;/strong&gt; which update you want to get rid of and don’t want to scroll through &lt;em&gt;all&lt;/em&gt; the updates in the WSUS console to find it?&lt;/p&gt;

&lt;p&gt;As is so often the case, PowerShell to the rescue! 😃&lt;/p&gt;

&lt;p&gt;You’ll need access to both the &lt;em&gt;ConfigurationManager&lt;/em&gt; and &lt;em&gt;UpdateServices&lt;/em&gt; modules, and the account you’re running the script as will need at least Read access to Software Updates in MECM and membership in the &lt;strong&gt;WSUS Administrators&lt;/strong&gt; group on the WSUS server that your root SUP talks to.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;ConfigurationManager&lt;/em&gt; module comes with the MECM Console install, and the &lt;em&gt;UpdateServices&lt;/em&gt; module is part of the WSUS RSAT feature.
Or if you’re feeling fancy, you can implicit remote these from your site server. 😃&lt;/p&gt;

&lt;p&gt;The embedded code (thanks Gist!) is a rough sketch that will do the trick for you; the first few lines will need to be customized for your environment per the comments.&lt;/p&gt;

&lt;p&gt;Down on line 36 is where you’ll put the article ID of the update you want to decline. &lt;em&gt;&lt;strong&gt;PLEASE BE CAUTIOUS HERE&lt;/strong&gt;&lt;/em&gt; as some vendors will use the same article ID for multiple updates.&lt;/p&gt;

&lt;p&gt;You can modify the &lt;strong&gt;Get-CMSoftwareUpdate&lt;/strong&gt; section to go by other attributes; the important bit is that the &lt;em&gt;CI_UniqueID&lt;/em&gt; of the &lt;em&gt;CMSoftwareUpdate&lt;/em&gt; is the &lt;em&gt;UpdateID&lt;/em&gt; that &lt;strong&gt;Get-WSUSUpdate&lt;/strong&gt; is looking for.&lt;/p&gt;

&lt;script src=&quot;https://gist.github.com/dsolodow/aa097124803f08d9b1da0e8d1ff4a877.js&quot;&gt;&lt;/script&gt;</content><author><name>Damien Solodow</name><email>bookwyrm79@gmail.com</email><uri>https://theevolvingadmin.com</uri></author><category term="PowerShell" /><category term="Configuration Manager" /><summary type="html">Using ConfigurationManager &amp; UpdateService PS modules to decline updates</summary></entry><entry><title type="html">MMSMOA Tips and Tricks</title><link href="https://theevolvingadmin.com/2019/05/08/mmsmoa-tips" rel="alternate" type="text/html" title="MMSMOA Tips and Tricks" /><published>2019-05-08T00:00:00-04:00</published><updated>2019-05-08T00:00:00-04:00</updated><id>https://theevolvingadmin.com/2019/05/08/mmsmoa-tips</id><content type="html" xml:base="https://theevolvingadmin.com/2019/05/08/mmsmoa-tips">&lt;h2 id=&quot;whats-this-about&quot;&gt;What’s this about?&lt;/h2&gt;

&lt;p&gt;The &lt;a href=&quot;https://mms2019.sched.com/event/N6gG/tips-tricks-showcase&quot;&gt;“Tips &amp;amp; Tricks Showcase”&lt;/a&gt; session seemed like a must attend event (especially as it was the only one in the time slot :wink:)&lt;/p&gt;

&lt;p&gt;And when they said there were some awesome Surface Laptops to giveaway, I figured, may as well get up and share something.&lt;/p&gt;

&lt;p&gt;A big thanks to the community for being some encouraging and welcoming to a first time attendee and presenter (and for the extra 10 seconds of speaking time) :thumbsup:&lt;/p&gt;

&lt;h2 id=&quot;enough-buttering-get-to-the-meat&quot;&gt;Enough buttering, get to the meat!&lt;/h2&gt;

&lt;p&gt;The tip that I shared was around the PowerShell Module &lt;a href=&quot;https://www.powershellgallery.com/packages/EditorServicesCommandSuite&quot;&gt;&lt;em&gt;EditorCommandServicesSuite&lt;/em&gt;&lt;/a&gt;. Just install it from the gallery with&lt;/p&gt;

&lt;div class=&quot;language-powershell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;Install-Module&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;EditorCommandServicesSuite&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-Scope&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;CurrentUser&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You’ll also need to add the following to your VSCode PowerShell Profile so it auto-loads:&lt;/p&gt;

&lt;div class=&quot;language-powershell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;Import-Module&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;EditorServicesCommandSuite&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Import-EditorCommand&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-Module&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;EditorServicesCommandSuite&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Once it’s installed and loaded, you can activate by either:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Selecting &lt;em&gt;PowerShell: Show Additional Commands from PowerShell Modules&lt;/em&gt;&lt;/li&gt;
  &lt;li&gt;pressing Shift-Alt-S while editing a PowerShell file&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This provides a number of very useful capabilities, but my current favorite is &lt;strong&gt;Convert Command to Splat Expression&lt;/strong&gt;
&lt;a href=&quot;https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_splatting?view=powershell-6&quot;&gt;Splatting&lt;/a&gt; is a very handy way to make long PowerShell commands more readable, and more easily re-usable.&lt;/p&gt;

&lt;p&gt;Unfortunately it has two drawbacks:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;VSCode PowerShell auto-complete/intellisense doesn’t help you with parameter names/values when splatting&lt;/li&gt;
  &lt;li&gt;I usually forget something in the syntax/formatting.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This function from the &lt;strong&gt;EditorServicesCommandSuite&lt;/strong&gt; module solves both those problems; just write out the command as one long line, and then let it convert it to a splat for you.&lt;/p&gt;

&lt;h2 id=&quot;didnt-you-also-say-something-about-powershell-profiles&quot;&gt;Didn’t you also say something about PowerShell Profiles?&lt;/h2&gt;

&lt;p&gt;Yep! I didn’t have time to go into it (didn’t want the bear to growl at me!), but fortunately it’s something I’ve previously written about: &lt;a href=&quot;/2014/10/21/powershell-profile-tips-tricks&quot;&gt;PowerShell Profile Tips and Tricks&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That post is a bit old, but aside from not mentioning VSCode, it all still applies to Windows PowerShell, and almost all should apply to PowerShell Core.&lt;/p&gt;

&lt;p&gt;I did however update the sample profile linked in it (and &lt;a href=&quot;https://github.com/dsolodow/IndyPoSH/blob/master/Profile.ps1&quot;&gt;here&lt;/a&gt; as well) to be more current.&lt;/p&gt;

&lt;p&gt;Hopefully this has been useful, and if there is more you’d like me to write about, just click the &lt;strong&gt;Suggest Topic&lt;/strong&gt; link at the top of the page, and tell me about it!&lt;/p&gt;</content><author><name>Damien Solodow</name><email>bookwyrm79@gmail.com</email><uri>https://theevolvingadmin.com</uri></author><category term="Conventions" /><category term="Off-Topic" /><category term="MMS" /><category term="VSCode" /><summary type="html">Tip (and a bit extra) shared at MMSMOA</summary></entry><entry><title type="html">Out-State -Destination ‘MMS @MOA 2019’</title><link href="https://theevolvingadmin.com/2019/05/04/mmsmoa" rel="alternate" type="text/html" title="Out-State -Destination ‘MMS @MOA 2019’" /><published>2019-05-04T00:00:00-04:00</published><updated>2019-05-04T00:00:00-04:00</updated><id>https://theevolvingadmin.com/2019/05/04/mmsmoa</id><content type="html" xml:base="https://theevolvingadmin.com/2019/05/04/mmsmoa">&lt;h2 id=&quot;what-is-mms&quot;&gt;What is MMS?&lt;/h2&gt;

&lt;blockquote&gt;
  &lt;p&gt;The Midwest Management Summit is a 4-day conference purposely capped to just 750 attendees so that nobody gets lost in the crowd.
Speakers have time to meet and talk to you. No rushing people out of a session to get the next speaker going. Time to absorb what you see and talk it over with speakers and other attendees.
A true learning experience. Real networking. Real-life issues discussed.
And no, you don’t have to be from the Midwest to attend. It’s just the name.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2 id=&quot;interesting&quot;&gt;Interesting…&lt;/h2&gt;

&lt;p&gt;Since the other SysAdmin at $WORK had already scheduled for this years Ignite (and is part of the Krewe), it made sense for me to go to a different conference.
As I’m the resident ConfigMgr admin at $WORK, MMS seemed like a good fit. Especially as I’ve interacted with a number of the community members on Twitter, Slack, etc.&lt;/p&gt;

&lt;p&gt;I should probably as SolarWinds if they’ll give me any kickback for advertisements as my backpack, and almost all of the shirts I packed are from them or their community THWACK.. :smile:&lt;/p&gt;</content><author><name>Damien Solodow</name><email>bookwyrm79@gmail.com</email><uri>https://theevolvingadmin.com</uri></author><category term="Conventions" /><category term="Off-Topic" /><category term="MMS" /><summary type="html">Heading to Microsoft Management Summit 2019</summary></entry><entry><title type="html">PowerShell MSSQL cron job</title><link href="https://theevolvingadmin.com/2019/01/16/powershell-mssql-cron-job" rel="alternate" type="text/html" title="PowerShell MSSQL cron job" /><published>2019-01-16T21:45:00-05:00</published><updated>2019-01-16T21:45:00-05:00</updated><id>https://theevolvingadmin.com/2019/01/16/powershell-mssql-cron-job</id><content type="html" xml:base="https://theevolvingadmin.com/2019/01/16/powershell-mssql-cron-job">&lt;h1 id=&quot;i-did-what&quot;&gt;I did &lt;em&gt;what&lt;/em&gt;&lt;/h1&gt;

&lt;blockquote class=&quot;twitter-tweet&quot; data-lang=&quot;en&quot;&gt;&lt;p lang=&quot;en&quot; dir=&quot;ltr&quot;&gt;
Just setup a cron job that runs a PowerShell script to build an htpasswd file from the results of an Mssql query. Cross platform ftw. Thanks &lt;a href=&quot;https://twitter.com/cl?ref_src=twsrc%5Etfw&quot;&gt;@cl&lt;/a&gt;
&lt;a href=&quot;https://twitter.com/PowerShell_Team?ref_src=twsrc%5Etfw&quot;&gt;@PowerShell_Team&lt;/a&gt;
&lt;a href=&quot;https://twitter.com/hashtag/PowerShell?src=hash&amp;amp;ref_src=twsrc%5Etfw&quot;&gt;#PowerShell&lt;/a&gt; &lt;a href=&quot;https://twitter.com/hashtag/dbatools?src=hash&amp;amp;ref_src=twsrc%5Etfw&quot;&gt;#dbatools&lt;/a&gt;&lt;/p&gt;&amp;mdash;
Damien Solodow (@DSolodow) &lt;a href=&quot;https://twitter.com/DSolodow/status/1085308282993037318?ref_src=twsrc%5Etfw&quot;&gt;January 15, 2019&lt;/a&gt;
&lt;/blockquote&gt;
&lt;script async=&quot;&quot; src=&quot;https://platform.twitter.com/widgets.js&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;

&lt;h2 id=&quot;why-i-did-that&quot;&gt;&lt;em&gt;Why&lt;/em&gt; I did that&lt;/h2&gt;

&lt;p&gt;TL;DR - wanted to get rid of a manual process on a legacy system. :smiley:&lt;/p&gt;

&lt;h3 id=&quot;longer-version&quot;&gt;Longer version&lt;/h3&gt;

&lt;p&gt;One of our few remaining legacy servers at &lt;strong&gt;$WORK&lt;/strong&gt; is a Server 2008 R2 VM that is eating far more disk than is called for.&lt;/p&gt;

&lt;p&gt;Just about the &lt;em&gt;only&lt;/em&gt; thing the server does is host a pretty basic website. The sticky wicket though is that a few directories on the site need to require authentication. Since not all of the users have accounts in our Active Directory, the credentials are based on data from their ERP record.&lt;/p&gt;

&lt;p&gt;The solution used on this legacy server was a 3rd party HTML “locker” that was last updated to support &lt;strong&gt;Windows 8&lt;/strong&gt;. :open_mouth:&lt;/p&gt;

&lt;p&gt;The process to update the credential list involves a SQL Agent job that emails a file to someone, who then has to follow a nearly &lt;em&gt;30 step&lt;/em&gt; &lt;strong&gt;manual process&lt;/strong&gt; that involves carefully modifying and saving the file, logging into the web server via RDP, and running a GUI app to import said file and update the credential list. :sob: :scream: :dizzy_face:&lt;/p&gt;

&lt;h2 id=&quot;how-i-did-that&quot;&gt;&lt;em&gt;How&lt;/em&gt; I did that&lt;/h2&gt;

&lt;h3 id=&quot;new-solution&quot;&gt;New solution&lt;/h3&gt;

&lt;p&gt;This sounded like a good place for a Linux VM running Apache, and using htaccess and htpasswd. I have some prior experience with Apache, and it looked like the easier path compared to using IIS and having to deal with scripting the creation/management of IIS users, or getting IIS to authenticate directly against a database.&lt;/p&gt;

&lt;p&gt;Main reasons for that were:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;I’m not a web developer by &lt;strong&gt;any&lt;/strong&gt; stretch of the imagination&lt;/li&gt;
  &lt;li&gt;The IIS PowerShell module (WebAdministration) is &lt;em&gt;in my experience&lt;/em&gt; an ugly PITA&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I went with an Ubuntu LTS install, since I have prior experience there, they’ve been playing very nice with Microsoft of late, and it’s what I have in my &lt;a href=&quot;https://docs.microsoft.com/en-us/windows/wsl/faq&quot;&gt;WSL&lt;/a&gt; install.&lt;/p&gt;

&lt;h3 id=&quot;basic-setup&quot;&gt;Basic setup&lt;/h3&gt;

&lt;p&gt;So it was time to:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Copy web content to new server&lt;/li&gt;
  &lt;li&gt;Add SSL certificate to server&lt;/li&gt;
  &lt;li&gt;Configure Apache for site, SSL redirection&lt;/li&gt;
  &lt;li&gt;Create sample htpasswd for site&lt;/li&gt;
  &lt;li&gt;Configure Apache to do forms authentication for the required directories using the sample htpasswd
    &lt;ol&gt;
      &lt;li&gt;this was in the main apache config instead of using .htaccess as it’s better that way if you have control of the server&lt;/li&gt;
    &lt;/ol&gt;
  &lt;/li&gt;
  &lt;li&gt;Test it out&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;Most&lt;/em&gt; of this was from &lt;a href=&quot;https://httpd.apache.org/docs/2.4/howto/auth.html&quot;&gt;Apache docs&lt;/a&gt; and some Googling, and a healthy dose of trial and error. :wink:&lt;/p&gt;

&lt;h3 id=&quot;getting-the-data&quot;&gt;Getting the data&lt;/h3&gt;

&lt;p&gt;I created a SQL login in the database for the script to use, and granted it SELECT access to the appropriate view and table.
Then I used that login in &lt;a href=&quot;https://docs.microsoft.com/en-us/sql/ssms/sql-server-management-studio-ssms&quot;&gt;SSMS&lt;/a&gt; to run a test query:&lt;/p&gt;

&lt;div class=&quot;language-sql highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;top&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;username&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;password&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;erp_db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;..&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;view_user&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This ran successfully; so credentials, security, and query are good, so time to run that via PowerShell on the Linux server.
I’d selected to install PowerShell Core during the initial Ubuntu install, but instructions for existing installs are here: &lt;a href=&quot;https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-6#ubuntu-1804&quot;&gt;Install PowerShell on Ubuntu&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The SQLServer PowerShell module is cross-platform, so it can be installed in PowerShell Core on Linux. :+1:&lt;/p&gt;

&lt;p&gt;Unfortunately, installing this revealed that only a subset of cmdlets are available when installed in Core, and &lt;strong&gt;Invoke-Sqlcmd&lt;/strong&gt; isn’t one of them. :anguished:&lt;/p&gt;

&lt;p&gt;I remembered a recent tweet from Chrissy LeMaire (@cl) about the &lt;a href=&quot;https://dbatools.io/&quot;&gt;dbatools module&lt;/a&gt; going cross-platform, so I gave that one a try:&lt;/p&gt;

&lt;div class=&quot;language-powershell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;Install-Module&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;dbatools&apos;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-Scope&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;CurrentUser&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Get-Command&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-Module&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;dbatools&apos;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-Noun&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;*query*&apos;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Invoke-DbaQuery&lt;/strong&gt; looks like a winner, so time to read the &lt;a href=&quot;https://docs.dbatools.io/#Invoke-DbaQuery&quot;&gt;documentation&lt;/a&gt; for it.&lt;/p&gt;

&lt;p&gt;Looked like the commands to run were:&lt;/p&gt;

&lt;div class=&quot;language-powershell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$login&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Get-Credential&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-UserName&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;SQLLOGIN&apos;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Invoke-DbaQuery&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-SqlCredential&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$login&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-SqlInstance&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;SQLSERVER&apos;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-Database&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;erp_db&apos;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-Query&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;SELECT top 10 username, password FROM view_user&apos;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Unfortunately, I got a warning instead of results:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://theevolvingadmin.com/assets/images/powershell-mssql-cron-job/warning.png&quot; alt=&quot;Yellow text warning message&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Doh! :astonished:&lt;/p&gt;

&lt;p&gt;Maybe this was something wonky with running the module under PowerShell Core on Linux… So I tried the same PowerShell on my Windows box, using Windows PowerShell instead of Core.&lt;/p&gt;

&lt;p&gt;Nope, same error. :-1: Smells like a bug in the module, so off to their &lt;a href=&quot;https://github.com/sqlcollaborative/dbatools/issues&quot;&gt;issues page&lt;/a&gt;…&lt;/p&gt;

&lt;p&gt;Searching through there didn’t show any previous reports of this issue, so I used their handy Issues template and submitted a new one: &lt;a href=&quot;https://github.com/sqlcollaborative/dbatools/issues/4946&quot;&gt;Issue-4946&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Within a couple hours&lt;/strong&gt; it had been confirmed, and a fix merged. :heart_eyes:&lt;/p&gt;

&lt;p&gt;So I updated my systems to the fixed module version (0.9.741), and re-tried my query. This time I got results back! :+1::+1:&lt;/p&gt;

&lt;h3 id=&quot;building-htaccess-from-the-data&quot;&gt;Building htaccess from the data&lt;/h3&gt;

&lt;p&gt;Now that I could pull from the database, it was time to turn that into an htpassword file.&lt;/p&gt;

&lt;p&gt;I gave the user that would be running the script via cron the ability to edit the htpassword file:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;setfacl &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; u:cron_user:rw htpassword
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This seemed a more minimal course than giving cron_user the ability to run ‘sudo htpasswd’ without a password.&lt;/p&gt;

&lt;p&gt;The htpasswd utility allows you to pass both the username and password as part of the command line, so it was a simple PowerShell bit to do that:&lt;/p&gt;

&lt;div class=&quot;language-powershell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$login&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Get-Credential&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-UserName&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;SQLLOGIN&apos;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$creds&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Invoke-DbaQuery&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-SqlCredential&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$login&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-SqlInstance&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;SQLSERVER&apos;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-Database&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;erp_db&apos;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-Query&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;SELECT top 10 username, password FROM view_user&apos;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$creds&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ForEach-Object&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;htpasswd&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-b&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;/path/to/htpassword&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;$_&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;username&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;$_&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;password&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That looked to have worked; it ran without error and I was able to use one of the username, password combos from the SQL query to login to the protected directories. :raised_hands:&lt;/p&gt;

&lt;p&gt;Only catch was, the new lines were being &lt;em&gt;added&lt;/em&gt; to the htpassword file, so I was going to need to either blank out the file or recycle it before building it; otherwise it would get oversized, and have multiple (potentially different) entries for each person. :worried:&lt;/p&gt;

&lt;h3 id=&quot;fleshing-it-out-and-polishing-it&quot;&gt;Fleshing it out and polishing it&lt;/h3&gt;

&lt;p&gt;Now that I had a &lt;strong&gt;working&lt;/strong&gt; proof of concept, just had to do a few more things:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Flush out the file before re-filling it (Linux has a handy &lt;strong&gt;truncate&lt;/strong&gt; command)&lt;/li&gt;
  &lt;li&gt;Make sure I didn’t flush out the file if I didn’t have data to put in&lt;/li&gt;
  &lt;li&gt;Add some error reporting&lt;/li&gt;
  &lt;li&gt;Make it pretty&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So here’s what it ended up like:&lt;/p&gt;

&lt;div class=&quot;language-powershell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#Requires -Modules @{ModuleName=&quot;dbatools&quot;; ModuleVersion=&quot;0.9.741&quot;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$username&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;SQLLOGIN&apos;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$password&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ConvertTo-SecureString&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-String&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;SQLPASSWORD&apos;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-AsPlainText&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-Force&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$cred&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;New-Object&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-typename&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;System.Management.Automation.PSCredential&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-ArgumentList&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$username&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$password&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$invokeDbaQuerySplat&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;@{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;SqlInstance&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;   &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;SQLSERVER&apos;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Database&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;erp_db&apos;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;SqlCredential&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$cred&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Query&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;         &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;SELECT username,password FROM view_user&apos;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$results&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Invoke-DbaQuery&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;invokeDbaQuerySplat&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kr&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$results&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;c&quot;&gt;#clear file to avoid duplicate entries&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;truncate&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;--size&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;/path/to/htpassword&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$results&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ForEach-Object&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;htpasswd&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-b&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;/path/to/htpassword&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;$_&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;username&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;$_&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;password&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kr&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$servername&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;system.net.dns&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;GetHostEntry&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;hostname&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;hostname&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$sendMailMessageSplat&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;@{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Subject&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Script error on &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$servername&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;From&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;       &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;cron@SERVER&apos;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;To&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;         &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;sysadmins@WORK.COM&apos;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;SmtpServer&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;SMTPSERVER&apos;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Body&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;       &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Script: &lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;$PSCommandPath&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;`n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; Threw: &lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;$Error&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;[0]&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Send-MailMessage&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;sendMailMessageSplat&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Success! :relieved: :sunglasses:&lt;/p&gt;</content><author><name>Damien Solodow</name><email>bookwyrm79@gmail.com</email><uri>https://theevolvingadmin.com</uri></author><category term="SQL" /><category term="PowerShell" /><category term="Linux" /><summary type="html">Setting up a cron job that runs a PowerShell script to build an htpasswd file from the results of an Mssql query</summary></entry><entry><title type="html">What’s on that port?</title><link href="https://theevolvingadmin.com/2019/01/10/whats-on-that-port" rel="alternate" type="text/html" title="What’s on that port?" /><published>2019-01-10T17:25:00-05:00</published><updated>2019-01-10T17:25:00-05:00</updated><id>https://theevolvingadmin.com/2019/01/10/whats-on-that-port</id><content type="html" xml:base="https://theevolvingadmin.com/2019/01/10/whats-on-that-port">&lt;h1 id=&quot;whats-on-that-port&quot;&gt;What’s on that port?&lt;/h1&gt;

&lt;p&gt;Today, the network admin at $WORK contacted me, saying while running a ZenMap on part of one of the offices, he found several Windows PCs in the AP and Payroll departments that were listening on 80/tcp. This gave him the willies, so he reached out to me to find out WTF. :anguished:&lt;/p&gt;

&lt;p&gt;Once the IPs of the PCs were converted to names, it was time to investigate.&lt;/p&gt;

&lt;p&gt;First, let’s make sure they’re still online and listening as expected:&lt;/p&gt;

&lt;div class=&quot;language-powershell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$PCs&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;PC1&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;PC2&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;PC3&apos;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$PCS&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Foreach-object&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Test-NetConnection&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-ComputerName&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;$_&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-CommonPort&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;HTTP&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;(Had to use the Foreach as Test-NetConnection doesn’t allow an array for ComputerName) :persevere:&lt;/p&gt;

&lt;p&gt;This showed that yes, all three were online, reachable and accepting connections for inbound HTTP traffic.
Now let’s see what process is listening on the port:&lt;/p&gt;

&lt;div class=&quot;language-powershell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;Invoke-Command&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-ComputerName&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$PCs&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-ScriptBlock&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;netstat&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-ano&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;findstr&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;80&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;https://theevolvingadmin.com/assets/images/whats-on-that-port/process.jpg&quot; alt=&quot;Table of TCP ports, status and PID&quot; /&gt;&lt;/p&gt;

&lt;p&gt;On each computer, the process listening on port 80 had PID 4 (far right column). On a Windows machine, PID 4 is SYSTEM, aka the kernel.
This meant that it wasn’t a user process listening on port 80, so the odds of it being malware or the like went down &lt;strong&gt;&lt;em&gt;dramatically&lt;/em&gt;&lt;/strong&gt;. :relieved:
It &lt;em&gt;also&lt;/em&gt; meant that it was almost definitely from the Windows built-in, kernel level HTTP listener (http.sys)&lt;/p&gt;

&lt;p&gt;Maybe they had something like IIS, MSMQ, etc. installed?&lt;/p&gt;

&lt;div class=&quot;language-powershell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;Invoke-Command&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-ComputerName&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$pcs&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-Credential&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$admin&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-ScriptBlock&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Get-WindowsOptionalFeature&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-Online&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Where-Object&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;$_&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;FeatureName&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-like&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;*web*&apos;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-or&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;$_&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;FeatureName&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-like&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;*http*&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-and&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;$_&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-eq&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Enabled&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Nope, no hits there. :frowning:&lt;/p&gt;

&lt;p&gt;A bit of Googling for ‘http.sys show http listener’ revealed the handy command &lt;strong&gt;netsh http show urlacl&lt;/strong&gt;, so…&lt;/p&gt;

&lt;div class=&quot;language-powershell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;Invoke-Command&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-ComputerName&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$pcs&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-ScriptBlock&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;netsh&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;http&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;show&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;urlacl&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;findstr&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;80&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;https://theevolvingadmin.com/assets/images/whats-on-that-port/listener.jpg&quot; alt=&quot;Image of URL strings&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Those look like GUIDs. To the Google!&lt;/p&gt;

&lt;p&gt;And one of the first hits was: &lt;a href=&quot;https://blogs.msdn.microsoft.com/oldnewthing/20180703-00/?p=99145&quot;&gt;How can I determine why the System process is listening on port 80?&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This indicated BranchCache, which is harmless but maybe undesirable now.&lt;/p&gt;</content><author><name>Damien Solodow</name><email>bookwyrm79@gmail.com</email><uri>https://theevolvingadmin.com</uri></author><category term="Troubleshooting" /><category term="Security" /><category term="PowerShell" /><summary type="html">Why are these PCs listening on port 80?</summary></entry><entry><title type="html">Exchange Schema Upgrade</title><link href="https://theevolvingadmin.com/2018/07/17/exchange-schema-upgrade" rel="alternate" type="text/html" title="Exchange Schema Upgrade" /><published>2018-07-17T11:00:00-04:00</published><updated>2018-07-17T11:00:00-04:00</updated><id>https://theevolvingadmin.com/2018/07/17/exchange-schema-upgrade</id><content type="html" xml:base="https://theevolvingadmin.com/2018/07/17/exchange-schema-upgrade">&lt;h1 id=&quot;what-and-why&quot;&gt;What and why&lt;/h1&gt;

&lt;p&gt;One of the things I discovered at new $WORK was that we have all our mailboxes in Exchange Online, and are using ADFS and directory synchronization.&lt;/p&gt;

&lt;p&gt;Pretty common and normal.
The catch?
&lt;em&gt;No on-premise Exchange server.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This isn’t supported, and prevents you from modifying most of the Exchange properties on your objects. &lt;a href=&quot;https://blogs.technet.microsoft.com/exchange/2012/12/05/decommissioning-your-exchange-2010-servers-in-a-hybrid-deployment/&quot;&gt;Reference&lt;/a&gt; :frowning:&lt;/p&gt;

&lt;p&gt;The first step was to find out what version of Exchange had last been present and get the schema upgraded to Exchange 2016.&lt;/p&gt;

&lt;p&gt;I ran the following and then looked up the result on &lt;a href=&quot;https://eightwone.com/references/schema-versions/&quot;&gt;this site&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;language-powershell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;Get-ADObject&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;CN=ms-Exch-Schema-Version-Pt,&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Get-ADRootDSE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;schemaNamingContext&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-Property&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;RangeUpper&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This told me the last Exchange versions installed was 2007 SP1.&lt;/p&gt;

&lt;p&gt;This would require a few upgrades in succession to get to 2016 as 2007 SP1 and 2016 can’t coexist or direct upgrade.&lt;/p&gt;

&lt;h2 id=&quot;the-plan&quot;&gt;The plan&lt;/h2&gt;

&lt;p&gt;Since we were getting ready to decommission our last Windows 2008 DC, I decided to use it for the upgrade.&lt;/p&gt;

&lt;p&gt;The plan was:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Make the 2008 DC the schema master&lt;/li&gt;
  &lt;li&gt;Add my admin account to &lt;em&gt;Schema Admins&lt;/em&gt;&lt;/li&gt;
  &lt;li&gt;Disable outbound replication from the 2008 DC&lt;/li&gt;
  &lt;li&gt;Apply Exchange 2010 schema upgrade and domain prep&lt;/li&gt;
  &lt;li&gt;Apply Exchange 2013 schema upgrade and domain prep&lt;/li&gt;
  &lt;li&gt;Verify things went ok&lt;/li&gt;
  &lt;li&gt;Re-enable outbound replication from 2008 DC&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The idea here was that if something went badly with the upgrade, I could kill the 2008 DC and seize the schema master role without hosing the forest.&lt;/p&gt;

&lt;h2 id=&quot;the-reality&quot;&gt;The reality&lt;/h2&gt;

&lt;p&gt;Steps 1..4 went basically as expected.&lt;/p&gt;

&lt;p&gt;However I ran into a few snags for the Exchange 2013 schema:&lt;/p&gt;

&lt;p&gt;First, Exchange 2013 setup (including /prepareAD) won’t run on Server 2008.&lt;/p&gt;

&lt;p&gt;So I had to create a temporary pair of 32 bit AD subnets for the 2008 DC and my PC, and put those two subnets with a temporary AD site.&lt;/p&gt;

&lt;p&gt;This was necessary because the schema upgrade expects the schema master to be in the same site.&lt;/p&gt;

&lt;p&gt;The next snag was the schema upgrade threw an error on the pre-req checks. :frowning:
According to the logs, there was still an Exchange 2003 server in the environment.&lt;/p&gt;

&lt;p&gt;This turned out to be due to the Exchange 2000/3 server not having been properly decommissioned upon upgrade to Exchange 2007. Judging by what I saw, it looked like Exchange hadn’t uninstalled as there were still objects in the Configuration partition such as the Exchange Server object, Recipient Update Service, etc.&lt;/p&gt;

&lt;p&gt;Once these were removed via ADSIEdit, the Exchange 2013 schema upgrade completed without issue. :thumbsup:&lt;/p&gt;

&lt;h2 id=&quot;next-steps&quot;&gt;Next steps&lt;/h2&gt;

&lt;p&gt;The Exchange 2016 schema upgrade required a Windows 2008 R2 domain and forest functional levels, so I wasn’t able to apply that schema upgrade yet. So it was necessary to:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Re-enable outbound replication from the 2008 domain controller&lt;/li&gt;
  &lt;li&gt;Verify replication completed successfully&lt;/li&gt;
  &lt;li&gt;Transfer Schema Master FSMO role to another DC&lt;/li&gt;
  &lt;li&gt;Demote Windows 2008 domain controller&lt;/li&gt;
  &lt;li&gt;Raise forest and domain functional levels (was able to go to 2012 R2)&lt;/li&gt;
  &lt;li&gt;Run Exchange 2016 schema upgrade on new Schema Master&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;guess-what-they-forgot-to-do&quot;&gt;Guess what they forgot to do?&lt;/h2&gt;

&lt;p&gt;The Exchange 2016 schema upgrade failed saying there was still an Exchange 2007 server in the environment.
A bit of checking in ADSIEdit showed the Exchange Server object for the Exchange 2007 server. Once this was removed, the Exchange 2016 schema upgrade completed successfully.&lt;/p&gt;

&lt;p&gt;With all this done, it was now possible to actually (&lt;em&gt;finally&lt;/em&gt;) install Exchange Server 2016.&lt;/p&gt;

&lt;p&gt;Fortunately that went without hiccup and we were in business. :smile:&lt;/p&gt;</content><author><name>Damien Solodow</name><email>bookwyrm79@gmail.com</email><uri>https://theevolvingadmin.com</uri></author><category term="Troubleshooting" /><category term="Exchange" /><summary type="html">Bringing Exchange schema up to date</summary></entry><entry><title type="html">New Work PC</title><link href="https://theevolvingadmin.com/2018/04/22/new-work-pc" rel="alternate" type="text/html" title="New Work PC" /><published>2018-04-22T11:00:00-04:00</published><updated>2018-04-22T11:00:00-04:00</updated><id>https://theevolvingadmin.com/2018/04/22/new-work-pc</id><content type="html" xml:base="https://theevolvingadmin.com/2018/04/22/new-work-pc">&lt;p&gt;One of the perks of a new job was a new computer. :smile:
My boss told me they’re a Dell shop currently, and turned me loose on what I wanted to order.&lt;/p&gt;

&lt;p&gt;I wanted a powerful laptop (I tend to run local VMs for testing), and prefer a 15” screen. It turned out that they already used the &lt;a href=&quot;http://www.dell.com/en-us/work/shop/cty/pdp/spd/precision-15-5520-laptop#features&quot;&gt;Precision 5520&lt;/a&gt; for a few cases, like CAD and other design work. So after taking a look at the information for that model and being &lt;em&gt;really&lt;/em&gt; impressed, I pulled up the info to customize one.&lt;/p&gt;

&lt;p&gt;There are a lot of reviews and info on this model already, but the highlights are:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;15” LCD; either 1080 standard or 4k touch&lt;/li&gt;
  &lt;li&gt;Choice of i7 7th Generation or Xeon E3-1505&lt;/li&gt;
  &lt;li&gt;Up to 32 GB RAM&lt;/li&gt;
  &lt;li&gt;M.2 PCIe SSD&lt;/li&gt;
  &lt;li&gt;Height: 0.44” (11.1mm), Width: 14.05” (357mm), Depth: 9.26” (235.3mm), Weight: 3.93lbs (1.78kg)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I also ordered the Thunderbolt Dock &lt;a href=&quot;http://www.dell.com/en-us/shop/dell-business-thunderbolt-dock-tb16-with-240w-adapter/apd/452-bcnu/pc-accessories#overview&quot;&gt;(TB16)&lt;/a&gt; to go with it to hook up the pair of 24” 1080 monitors, as well as gigabit Ethernet, etc.&lt;/p&gt;

&lt;p&gt;I like that the dock has a pair of USB3 ports on the front as well as a 3.5mm headphone jack, along with a nice complement of ports on the back.
It is rather annoying that while it has multiple display outputs on the back, they’re all different kinds.&lt;/p&gt;

&lt;hr /&gt;
&lt;p&gt;While I was waiting for the new PC to arrive, I made a customized Windows 10 USB stick to install from. This was both as a proof of a concept and to save me some work for the actual install. :smile:&lt;/p&gt;

&lt;p&gt;Here’s how I did it:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Download the Windows 10 1709 x64 ISO from the VLSC&lt;/li&gt;
  &lt;li&gt;Extract the ISO&lt;/li&gt;
  &lt;li&gt;Open the extract folder in &lt;a href=&quot;https://www.ntlite.com/&quot;&gt;NTLite&lt;/a&gt; and mount install.wim&lt;/li&gt;
  &lt;li&gt;Remove the images from the wim except for Enterprise&lt;/li&gt;
  &lt;li&gt;Modify the installed Windows components (added WSL, Hyper-V, IIS Manager, etc.)&lt;/li&gt;
  &lt;li&gt;Pre-configured a few preferences and settings&lt;/li&gt;
  &lt;li&gt;Apply the current Windows 10 cumulative update and Adobe Flash update&lt;/li&gt;
  &lt;li&gt;Add the drivers for the model from the Dell site&lt;/li&gt;
  &lt;li&gt;Apply the changes to the WIM and save&lt;/li&gt;
  &lt;li&gt;Save to ISO (button in NTLite)&lt;/li&gt;
  &lt;li&gt;Write the ISO to USB for a UEFI install (shout-out to [Rufus])&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After the hardware arrived, I made sure the BIOS was set for UEFI and the various virtualization and TPM settings were enabled.
Then booted the USB stick and did the install.
Turned out I missed a few drivers (some for the dock) and needed a firmware update or two as well.
Fortunately, Dell Command is an excellent and handy tool for dealing with those.&lt;/p&gt;

&lt;p&gt;Then just had to load up a few extra things like RSAT, IIS Remote Manager, etc.&lt;/p&gt;

&lt;p&gt;Will see how things go after time, but so far I’ve been pretty happy with the PC. :thumbsup:&lt;/p&gt;</content><author><name>Damien Solodow</name><email>bookwyrm79@gmail.com</email><uri>https://theevolvingadmin.com</uri></author><category term="Off-Topic" /><summary type="html">New job, new PC</summary></entry><entry><title type="html">New Job</title><link href="https://theevolvingadmin.com/2018/03/23/new-job" rel="alternate" type="text/html" title="New Job" /><published>2018-03-23T11:00:00-04:00</published><updated>2018-03-23T11:00:00-04:00</updated><id>https://theevolvingadmin.com/2018/03/23/new-job</id><content type="html" xml:base="https://theevolvingadmin.com/2018/03/23/new-job">&lt;p&gt;Today, after almost 10 years I’ve put in my papers to change jobs. :pensive:&lt;/p&gt;

&lt;p&gt;On March 22, 2018 I accepted an offer from a new employer in a different industry, and today (March 23rd) I put in my notice.&lt;/p&gt;

&lt;p&gt;This will be my 6th job in 21 years, so I’m not exactly a frequent changer, and this wasn’t the easiest decision.&lt;/p&gt;

&lt;p&gt;But, there are a number of positive things coming as part of the new position:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;em&gt;Much&lt;/em&gt; shorter commute (about 15 miles less one way)&lt;/li&gt;
  &lt;li&gt;Several co-workers I already know (although with those characters that might be mixed :sunglasses:)&lt;/li&gt;
  &lt;li&gt;An escape from cubicles :+1:&lt;/li&gt;
  &lt;li&gt;A nice mix of things I’m already familiar with and new products/experiences.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In discussions with IT leadership at the new employer, the main things I’ll be working on to start with are:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Implementing ConfigMgr/SCCM&lt;/li&gt;
  &lt;li&gt;Deploying Solarwinds Orion&lt;/li&gt;
  &lt;li&gt;Helping the current team:
    &lt;ul&gt;
      &lt;li&gt;pay off technical debt&lt;/li&gt;
      &lt;li&gt;clear out backlogged requests/projects&lt;/li&gt;
      &lt;li&gt;homogenize and stabilize environment&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I’ll be starting the new position on April 9th, so after that expect some new posts on the new environment and my projects. :metal:&lt;/p&gt;</content><author><name>Damien Solodow</name><email>bookwyrm79@gmail.com</email><uri>https://theevolvingadmin.com</uri></author><category term="Off-Topic" /><summary type="html">Checking out new pastures</summary></entry><entry><title type="html">What is THWACK?</title><link href="https://theevolvingadmin.com/2018/02/21/whats-thwack" rel="alternate" type="text/html" title="What is THWACK?" /><published>2018-02-21T12:40:00-05:00</published><updated>2018-02-21T12:40:00-05:00</updated><id>https://theevolvingadmin.com/2018/02/21/whats-thwack</id><content type="html" xml:base="https://theevolvingadmin.com/2018/02/21/whats-thwack">&lt;p&gt;You may have (hopefully) noticed the &lt;a href=&quot;https://thwack.solarwinds.com/welcome&quot;&gt;THWACK&lt;/a&gt; link in my author profile on the left there, and wondered &lt;em&gt;what’s that?&lt;/em&gt;
I mean, sure, &lt;strong&gt;everyone&lt;/strong&gt; knows about email, Twitter, LinkedIn, GitHub and StackOverflow, but &lt;a href=&quot;https://thwack.solarwinds.com/welcome&quot;&gt;THWACK&lt;/a&gt;?&lt;/p&gt;

&lt;p&gt;The TL;DR version: &lt;a href=&quot;https://thwack.solarwinds.com/welcome&quot;&gt;THWACK&lt;/a&gt; is the user community for &lt;a href=&quot;https://www.solarwinds.com&quot;&gt;Solarwinds&lt;/a&gt; (we’ll get to who they are in just a minute.)&lt;/p&gt;

&lt;p&gt;A more detailed version from their site is:&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;Simply put, THWACK connects you with more than 130,000 IT professionals and community members, who’ve contributed to help us make superior products, provide educational IT content, and, most importantly, help IT professionals do their jobs better.  Here we put you in direct contact with the people who manage and develop our products. THWACK is a place where you have a say in the direction of those products, and where you get support and answers, on the fly, without having to pick up the phone.  Crazy, huh?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Crazy indeed.&lt;/p&gt;

&lt;p&gt;Obviously, it’s most useful for those who are (or are planning to be) Solarwinds customers, but it still has value for other IT pros. If nothing else, there are lots of opportunities to collect points to redeem for &lt;a href=&quot;https://thwack.solarwinds.com/store&quot;&gt;swag&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;so-whowhat-is-this-solarwinds-anyway&quot;&gt;So who/what is this “&lt;a href=&quot;https://www.solarwinds.com&quot;&gt;Solarwinds&lt;/a&gt;” anyway?&lt;/h2&gt;

&lt;p&gt;I told you we’d get to them in a minute. :smile:&lt;/p&gt;

&lt;p&gt;The short version is that they’re a company that develops software products for IT pros. The largest piece of the pie is their Orion suite, which is a group of web-based products that integrate together and provide things like:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.solarwinds.com/network-performance-monitor&quot;&gt;device monitoring&lt;/a&gt; (up-time, resource usage, hardware status)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.solarwinds.com/server-application-monitor&quot;&gt;application/service monitoring&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.solarwinds.com/network-configuration-manager&quot;&gt;network device configuration management&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.solarwinds.com/ip-address-manager&quot;&gt;IP address/DNS/DHCP management&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.solarwinds.com/user-device-tracker&quot;&gt;user device mapping&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.solarwinds.com/netflow-traffic-analyzer&quot;&gt;network traffic analysis&lt;/a&gt; (NetFLOW and NBAR)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.solarwinds.com/log-event-manager-software&quot;&gt;Log and Event Management&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.solarwinds.com/voip-network-quality-manager&quot;&gt;VoIP and QoS monitoring&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.solarwinds.com/storage-resource-monitor&quot;&gt;storage monitoring/management&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.solarwinds.com/virtualization-manager&quot;&gt;virtualization monitoring/management&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.solarwinds.com/database-performance-analyzer&quot;&gt;database performance management/monitoring&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.solarwinds.com/patch-manager&quot;&gt;patch management&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.solarwinds.com/downloads&quot;&gt;and more!&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A more detailed “who we are” is on their website: &lt;a href=&quot;https://www.solarwinds.com/company/home&quot;&gt;Link&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;whats-great-about-them&quot;&gt;What’s great about them&lt;/h2&gt;

&lt;p&gt;I’ve been a user of Solarwinds products since 2009, and a member of Thwack since late that same year. During that time we’ve added several of their products to our environment, and have seen a &lt;strong&gt;lot&lt;/strong&gt; of changes and enhancements to the suite.&lt;/p&gt;

&lt;p&gt;I’ve seen first-hand (and in some cases been directly involved in) them making changes/fixes to their products based on user requests and feedback. They have opportunities for those interested to participate in user studies and feedback sessions while new versions/products are still in development.&lt;/p&gt;

&lt;p&gt;They also make release candidate versions of new releases available in advance of GA, and most importantly, those release candidates are &lt;strong&gt;fully supported in production&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The community (&lt;a href=&quot;https://thwack.solarwinds.com/welcome&quot;&gt;THWACK&lt;/a&gt;) is pretty active, and employees (including product managers and engineers) are frequent posters and active. One of the major benefits of this is that there are a lot of community created and contributed templates, reports, SNMP pollers, etc, in addition to all of the out of the box ones.&lt;/p&gt;

&lt;p&gt;So to wrap it all up :gift:, &lt;a href=&quot;https://www.solarwinds.com&quot;&gt;Solarwinds&lt;/a&gt; makes good, solid products, and they know who their target market/audience is (IT pros). This shows in their interactions, and most especially in their community (&lt;a href=&quot;https://thwack.solarwinds.com/welcome&quot;&gt;THWACK&lt;/a&gt;). So if you’re in IT pro, especially one interested in or already using &lt;a href=&quot;https://www.solarwinds.com&quot;&gt;Solarwinds&lt;/a&gt; tools (even the &lt;a href=&quot;https://www.solarwinds.com/free-tools&quot;&gt;free ones&lt;/a&gt;), come join us and check it out!&lt;/p&gt;</content><author><name>Damien Solodow</name><email>bookwyrm79@gmail.com</email><uri>https://theevolvingadmin.com</uri></author><category term="Solarwinds" /><summary type="html">Intro to THWACK and Solarwinds</summary></entry><entry><title type="html">Code to joy</title><link href="https://theevolvingadmin.com/2018/02/19/vscode" rel="alternate" type="text/html" title="Code to joy" /><published>2018-02-19T14:05:00-05:00</published><updated>2018-02-19T14:05:00-05:00</updated><id>https://theevolvingadmin.com/2018/02/19/vscode</id><content type="html" xml:base="https://theevolvingadmin.com/2018/02/19/vscode">&lt;h1 id=&quot;why-i-love-vscode-and-you-might-too&quot;&gt;Why I love VSCode (and you might too)&lt;/h1&gt;

&lt;h2 id=&quot;what-is-vscode&quot;&gt;What is VSCode?&lt;/h2&gt;

&lt;p&gt;Visual Studio Code (VSCode for short) is:&lt;/p&gt;

&lt;p&gt;From &lt;a href=&quot;https://code.visualstudio.com/docs&quot;&gt;VSCode Docs:&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;…a lightweight but powerful source code editor which runs on your desktop and is available for Windows, macOS and Linux. It comes with built-in support for JavaScript, TypeScript and Node.js and has a rich ecosystem of extensions for other languages (such as C++, C#, Java, Python, PHP, Go) and runtimes (such as .NET and Unity).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It’s a powerful text/code editor from Microsoft that’s:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;a href=&quot;https://code.visualstudio.com/license&quot;&gt;Free&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/microsoft/vscode&quot;&gt;Open Source&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://code.visualstudio.com/docs/supporting/requirements&quot;&gt;Cross platform&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://code.visualstudio.com/docs#top-extensions&quot;&gt;Extensible&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://code.visualstudio.com/docs/getstarted/tips-and-tricks#_customization&quot;&gt;Customizable&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://code.visualstudio.com/updates&quot;&gt;Regularly updated&lt;/a&gt; (more so if you use the &lt;a href=&quot;https://code.visualstudio.com/insiders&quot;&gt;Insiders&lt;/a&gt; track)&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;why-i-switched&quot;&gt;Why I switched&lt;/h2&gt;

&lt;p&gt;When VSCode first came out (announced in April 2015), I didn’t pay too much attention. For one, it was a preview; (1.0 was released in April 2016), two it was focused more on web development (HTML, CSS, JS, etc.), three I’d been using Notepad++ for years and it met my needs.&lt;/p&gt;

&lt;p&gt;What finally drove me over was the really slick &lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=ms-vscode.PowerShell&quot;&gt;PowerShell extension&lt;/a&gt;, and the news that going forward VSCode + PowerShell extension would be “preferred” (aka maintained) over the PowerShell ISE.&lt;/p&gt;

&lt;p&gt;So with that, I downloaded a copy, grabbed a few extensions and started kicking the tires.&lt;/p&gt;

&lt;h2 id=&quot;why-i-love-it&quot;&gt;Why I love it&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Built-in &lt;a href=&quot;https://code.visualstudio.com/docs/editor/versioncontrol&quot;&gt;version control&lt;/a&gt; (out of the box Git, extension for &lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=ms-vsts.team&quot;&gt;VSTS&lt;/a&gt;) - helps good habits&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://code.visualstudio.com/updates/v1_20#_save-files-that-need-admin-privileges&quot;&gt;Save as admin&lt;/a&gt; (new in 1.20) - if the file requires elevated rights to write, it will prompt you for UAC/sudo&lt;/li&gt;
  &lt;li&gt;Extensions! - lots of ways to enhance/expand. Favorites so far:
    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint&quot;&gt;markdownlint&lt;/a&gt; (warn about sloppy Markdown)&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=ms-vscode.PowerShell&quot;&gt;PowerShell&lt;/a&gt; (code completion, linting, console, and more!)&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=ms-mssql.mssql&quot;&gt;mssql&lt;/a&gt; (connect to MSSQL servers and write/run code)&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=ms-vsts.team&quot;&gt;Visual Studio Team Services&lt;/a&gt; (source control for VSTS/TFS)&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=DotJoshJohnson.xml&quot;&gt;XML Tools&lt;/a&gt; (properly format XML; includes turning long string into a tree)&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://code.visualstudio.com/docs/getstarted/settings&quot;&gt;Customizable&lt;/a&gt; - you can change almost anything; the settings are in JSON files that you can port around/backup easily.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette&quot;&gt;Command Palette&lt;/a&gt; - instead of digging around in menus, just press F1 and type&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://code.visualstudio.com/docs&quot;&gt;Well documented&lt;/a&gt; - Microsoft (and the VSCode community) have put together a &lt;strong&gt;lot&lt;/strong&gt; of documentation, howtos, getting started, etc. for VSCode.&lt;/li&gt;
  &lt;li&gt;Side by side editors or previews - open two files side by side, or a file and preview (can we say Markdown or HTML?)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;sounds-nice-how-can-i-get-started&quot;&gt;Sounds nice, how can I get started?&lt;/h2&gt;

&lt;p&gt;Go &lt;a href=&quot;https://code.visualstudio.com/Download&quot;&gt;download&lt;/a&gt; a copy for your OS, and install.&lt;/p&gt;

&lt;p&gt;After that, Microsoft has several &lt;a href=&quot;https://code.visualstudio.com/docs/getstarted/introvideos&quot;&gt;Introductory Videos&lt;/a&gt; to help you get off the ground.
If you’re currently used to or experience with another editor and don’t want your muscle memory to get in the way, VSCode has several &lt;a href=&quot;https://code.visualstudio.com/docs/getstarted/keybindings#_keymap-extensions&quot;&gt;keymap extensions&lt;/a&gt; available so you can use the same hotkeys/keyboard shortcuts for your current editor.&lt;/p&gt;

&lt;p&gt;You can also:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Follow &lt;a href=&quot;https://twitter.com/code&quot;&gt;@code&lt;/a&gt; on Twitter&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.github.com/Microsoft/vscode/issues&quot;&gt;Report issues with VSCode&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://go.microsoft.com/fwlink/?LinkID=533482&quot;&gt;Request new features/changes&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Anything you love/hate/need with VSCode? Questions, comments? Feel free to comment below. :smile:&lt;/p&gt;</content><author><name>Damien Solodow</name><email>bookwyrm79@gmail.com</email><uri>https://theevolvingadmin.com</uri></author><category term="Conceptual" /><category term="Tools" /><category term="VSCode" /><summary type="html">Intro to Visual Studio Code</summary></entry></feed>