<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Servers Archives - VirtJunkie</title>
	<atom:link href="/category/servers/feed/" rel="self" type="application/rss+xml" />
	<link>/category/servers/</link>
	<description>Virtualization, Automation, and anything else that might be on my mind</description>
	<lastBuildDate>Mon, 04 May 2020 13:00:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.2</generator>

<image>
	<url>/wp-content/uploads/2020/04/cropped-vj4-150x150.png</url>
	<title>Servers Archives - VirtJunkie</title>
	<link>/category/servers/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Jitsi for Just in Time Conferencing using Terraform on Vultr with Route 53</title>
		<link>/2020/05/04/jitsi-jit-conferencing-tf-vultr-route53/</link>
					<comments>/2020/05/04/jitsi-jit-conferencing-tf-vultr-route53/#respond</comments>
		
		<dc:creator><![CDATA[Jon]]></dc:creator>
		<pubDate>Mon, 04 May 2020 13:00:00 +0000</pubDate>
				<category><![CDATA[Automation]]></category>
		<category><![CDATA[BASH]]></category>
		<category><![CDATA[Hashicorp]]></category>
		<category><![CDATA[InfrastructureAsCode]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Terraform]]></category>
		<guid isPermaLink="false">http://www.virtjunkie.com/?p=1304</guid>

					<description><![CDATA[<p>With everything going on in the world with COVID-19 and the social distancing that is happening, people are looking to connect with friends, family and co-workers via Video conferencing more than ever. Recent vulnerabilities in Zoom have made people more cognizant than ever that security needs to be considered when using these platforms no matter [&#8230;]</p>
<p>The post <a href="/2020/05/04/jitsi-jit-conferencing-tf-vultr-route53/">Jitsi for Just in Time Conferencing using Terraform on Vultr with Route 53</a> appeared first on <a href="/">VirtJunkie</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>With everything going on in the world with COVID-19 and the social distancing that is happening, people are looking to connect with friends, family and co-workers via Video conferencing more than ever. Recent vulnerabilities in Zoom have made people more cognizant than ever that security needs to be considered when using these platforms no matter what you are using them for.</p>



<p><a href="https://jitsi.org/" target="_blank" rel="noreferrer noopener">Jitsi is an open source video conferencing platform</a> that I&#8217;ve been hearing about a lot lately, and finally had a chance to look into. In this post I&#8217;ll explain how to use Terraform to provision a Jitsi instance when you need a conference and tear it down when you are done. We&#8217;ll be using Vultr and their Jitsi &#8220;application&#8221; and AWS Route 53 for DNS.</p>



<span id="more-1304"></span>



<h2 class="wp-block-heading">Why Am I Writing This Article, and What Does It Accomplish?</h2>



<p>Why am I writing this article?</p>



<ol><li>We <strong>always</strong> want to have our apps and infrastructure defined in code</li><li>We pay for traditional web conferencing software 24 hours a day, 7 days a week, regardless of if we are are using running a conference or not. Why don&#8217;t we spin up conference infrastructure <strong>when we need it, and tear it down when we don&#8217;t</strong>?</li></ol>



<p>At a high level, this project will accomplish the following:</p>



<ol><li>Provision a Vultr VPS that is pre-configured with Jitsi</li><li>Take the IP Address that Vultr assigns the VPS and use it to create an A Record in Route 53</li><li>Copy a script to your VPS that will be used to finish the Jitsi configuration</li><li>Run the script that we copied and pass a few command line arguments that are specific to our environment</li></ol>



<h2 class="wp-block-heading">Prerequisites</h2>



<p>In addition to having Terraform downloaded and installed, we&#8217;ll need the following items:</p>



<h3 class="wp-block-heading">Vultr Account + API Access</h3>



<p>Vultr is definitely my go-to for VPS&#8217;s these days. Not only because of their price/performance/feature availability ratio, but because they provide a number of pre-configured applications that are ready, or near ready for use. <a rel="noreferrer noopener" href="https://www.vultr.com/docs/one-click-jitsi" target="_blank">Jitsi is one of these applications</a>. If you do use Vultr, please do me a favor and use&nbsp;<a rel="noreferrer noopener" href="https://www.vultr.com/?ref=8531966-6G" target="_blank">this link</a>&nbsp;to sign up. I’ll get a little kickback, but you’ll get $100 USD to use on the site in your first month.</p>



<div class="wp-block-media-text alignwide has-media-on-the-right is-stacked-on-mobile"><figure class="wp-block-media-text__media"><img fetchpriority="high" decoding="async" width="1024" height="450" src="https://www.virtjunkie.com/wp-content/uploads/2020/05/2020-05-02_19-45-1024x450.png" alt="" class="wp-image-1305" srcset="/wp-content/uploads/2020/05/2020-05-02_19-45-1024x450.png 1024w, /wp-content/uploads/2020/05/2020-05-02_19-45-300x132.png 300w, /wp-content/uploads/2020/05/2020-05-02_19-45-768x338.png 768w, /wp-content/uploads/2020/05/2020-05-02_19-45.png 1273w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure><div class="wp-block-media-text__content">
<p class="has-normal-font-size">Once you have a Vultr account, you&#8217;ll need to generate and record an API key to use with Terraform. Use the steps below to generate it.</p>



<ol><li>Log into Vultr</li><li>Navigate to Settings, and then API</li><li>Generate an API key, and copy it somewhere safe, we&#8217;ll be using it later</li></ol>
</div></div>



<h3 class="wp-block-heading">AWS Account + API Access</h3>



<p>We&#8217;ll be using <a rel="noreferrer noopener" href="https://aws.amazon.com/route53/" target="_blank">AWS&#8217;s Route 53 service</a>, which is really just a fancy DNS service that&#8217;s hooked into AWS.  In order to automate Route 53 with Terraform, we&#8217;ll need to enable API access.</p>



<div class="wp-block-media-text alignwide has-media-on-the-right is-stacked-on-mobile" style="grid-template-columns:auto 70%"><figure class="wp-block-media-text__media"><img decoding="async" width="1024" height="400" src="https://www.virtjunkie.com/wp-content/uploads/2020/05/2020-05-02_20-13-1024x400.png" alt="" class="wp-image-1307" srcset="/wp-content/uploads/2020/05/2020-05-02_20-13-1024x400.png 1024w, /wp-content/uploads/2020/05/2020-05-02_20-13-300x117.png 300w, /wp-content/uploads/2020/05/2020-05-02_20-13-768x300.png 768w, /wp-content/uploads/2020/05/2020-05-02_20-13-1536x599.png 1536w, /wp-content/uploads/2020/05/2020-05-02_20-13-1568x612.png 1568w, /wp-content/uploads/2020/05/2020-05-02_20-13.png 1607w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure><div class="wp-block-media-text__content">
<p><a rel="noreferrer noopener" href="https://console.aws.amazon.com/iam/home?#security_credential" target="_blank">Use this link to access the IAM Management page</a></p>



<ol><li>Expand the &#8220;Access Keys&#8221; blade</li><li>Select &#8220;Create New Access Key</li><li>Save the resulting file, as we&#8217;ll use the contents later</li></ol>
</div></div>



<h3 class="wp-block-heading">Domain Registrar Using Custom Nameservers</h3>



<p>In addition to the above, the domain you want to use will need to be configured to use the Route 53 Name Servers. Route 53 will provide you the nameservers when you create a zone, and you&#8217;ll simply plug those into your registrar DNS settings page. I&#8217;m not going to explain how to create a zone in Route 53, or how to configure your registrar, but if you have questions, throw them in the comments and I&#8217;ll do my best to help.</p>



<h2 class="wp-block-heading">Getting Started</h2>



<h3 class="wp-block-heading">Run This Project</h3>



<ol><li>Grab the files below, or copy them from my <a rel="noreferrer noopener" href="https://github.com/jonhowe/Virtjunkie.com/tree/master/Jitsi-JIT-Conferencing-TF-Vultr-Route53" target="_blank">Github Repository</a></li><li>Enter the directory that contains the files</li><li>At a minimum, modify the fields in the auto.tfvars file<ol><li>vultr_api_key</li></ol><ol><li>aws_access_key</li><li>aws_secret_key</li><li>domain</li><li>email</li></ol></li><li>Initialize Terraform by running <strong><code>terraform init</code></strong></li><li>Create a terraform plan by running <strong><code>terraform plan</code></strong></li><li>Apply the configuration by running <strong><code>terraform apply</code></strong></li><li>Voila! In less than 5 minutes, you&#8217;ve got a functional, secure Jitsi instance, running on a server and domain you control. Upon successful creation, you&#8217;ll see text like what we see below giving you the URL and credentials. When you are done with your conference, just run <code><strong>terraform destroy</strong></code> to stop from receiving charges on a server/service you aren&#8217;t using.</li></ol>



<pre class="urvanov-syntax-highlighter-plain-tag">null_resource.jitsi_config (remote-exec): ------------------------------
null_resource.jitsi_config (remote-exec): |                            |
null_resource.jitsi_config (remote-exec): |   JITSI SETUP COMPLETED!   |
null_resource.jitsi_config (remote-exec): |                            |
null_resource.jitsi_config (remote-exec): ------------------------------
null_resource.jitsi_config (remote-exec): JITSI URL: https://conference.yourdomain.com/

null_resource.jitsi_config (remote-exec): USERNAME: admin
null_resource.jitsi_config (remote-exec): PASSWORD: @#$asdfahgsd34579--23%4asdf</pre>



<h2 class="wp-block-heading">Code</h2>



<h3 class="wp-block-heading">Main.tf</h3>



<p>This file does all of the work.</p>



<pre class="urvanov-syntax-highlighter-plain-tag">#main.tf
#https://www.virtjunkie.com/jitsi-jit-conferencing-tf-vultr-route53/
#https://github.com/jonhowe/Virtjunkie.com/tree/master/Jitsi-JIT-Conferencing-TF-Vultr-Route53

#Conifugre the Vultr provider
provider &quot;vultr&quot; {
  api_key = var.vultr_api_key
  rate_limit = 700
  retry_limit = 3
}

#Configure the AWS Provider
provider &quot;aws&quot; {
  #profile    = &quot;default&quot;
  #shared_credentials_file = &quot;/home/jhowe/storage/btsync/folders/Sync/awscredentials/credentials&quot;
  region     = var.aws_region
  access_key = var.aws_access_key
  secret_key = var.aws_secret_key
}

#https://www.terraform.io/docs/providers/aws/d/route53_zone.html
data &quot;aws_route53_zone&quot; &quot;selected&quot; {
  name         = &quot;${var.domain}.&quot;
  private_zone = false
}

#Provision Vultr Server
resource &quot;vultr_server&quot; &quot;my_server&quot; {
    plan_id = var.vultr_plan_id
    region_id = var.vultr_region
    app_id = var.vultr_app_id
    label = &quot;${var.hostname}.${var.domain}&quot;
    tag = var.vultr_tag
    hostname = &quot;${var.hostname}.${var.domain}&quot;
    enable_ipv6 = false
    auto_backup = false
    ddos_protection = false
    notify_activate = false

    connection {
        type     = &quot;ssh&quot;
        user     = &quot;root&quot;
        
        #https://www.terraform.io/docs/providers/vultr/r/server.html#default_password
        password = self.default_password

        #https://www.terraform.io/docs/provisioners/connection.html#the-self-object
        host     = self.main_ip
    }

    provisioner &quot;local-exec&quot; {
      command = &quot;echo SSH to this server with the command: ssh root@${vultr_server.my_server.main_ip} with the password '${vultr_server.my_server.default_password}'&quot;
    }
}

#Create the Route 53 A Record
#https://www.terraform.io/docs/providers/aws/r/route53_record.html
resource &quot;aws_route53_record&quot; &quot;conference&quot; {
  zone_id = data.aws_route53_zone.selected.zone_id
  name    = &quot;${var.hostname}.${data.aws_route53_zone.selected.name}&quot;
  type    = &quot;A&quot;
  ttl     = &quot;300&quot;
  records = &amp;#91;&quot;${vultr_server.my_server.main_ip}&quot;]
}

#This null resource exists to handle configuration of the Vultr VPS after Route 53
resource &quot;null_resource&quot; &quot;jitsi_config&quot; {
    
    connection {
        type     = &quot;ssh&quot;
        user     = &quot;root&quot;
        
        #https://www.terraform.io/docs/providers/vultr/r/server.html#default_password
        password = vultr_server.my_server.default_password

        #https://www.terraform.io/docs/provisioners/connection.html#the-self-object
        host     = vultr_server.my_server.main_ip
    }

    provisioner &quot;file&quot; {
        source      = &quot;./configure_jitsi_param.sh&quot;
        destination = &quot;/root/configure_jitsi_param.sh&quot;
    }

    provisioner &quot;remote-exec&quot; {
        inline = &amp;#91;
            &quot;chmod +x /root/configure_jitsi_param.sh&quot;,
            &quot;/root/configure_jitsi_param.sh ${var.hostname}.${var.domain} ${var.email} y&quot;
        ]
    }
}</pre>



<h3 class="wp-block-heading">Variables.tf</h3>



<p>This file defines the variables that we will use in main.tf</p>



<pre class="urvanov-syntax-highlighter-plain-tag">#variables.tf
#https://www.virtjunkie.com/jitsi-jit-conferencing-tf-vultr-route53/
#https://github.com/jonhowe/Virtjunkie.com/tree/master/Jitsi-JIT-Conferencing-TF-Vultr-Route53

variable &quot;vultr_api_key&quot; {
    description = &quot;API Key Used by Vultr (https://my.vultr.com/settings/#settingsapi)&quot;
}

variable &quot;vultr_region&quot; {
    description = &quot;Vultr Region Selection (curl https://api.vultr.com/v1/regions/availability?DCID=1)&quot;
    default = 1
}

variable &quot;vultr_plan_id&quot; {
    description = &quot;Vultr Plan for the VPS to use (curl https://api.vultr.com/v1/plans/list)&quot;
    default = 202
}

variable &quot;vultr_tag&quot; {
    description = &quot;Vultr Tag to apply to the new VPS&quot;
    default = &quot;jitsi-conference&quot;
}

variable &quot;vultr_app_id&quot; {
    description = &quot;Vultr App to pre-install. This should always be '47', if jitsi is being provisioned (curl https://api.vultr.com/v1/app/list)&quot;
    default = 47
}

variable &quot;hostname&quot; {
    description = &quot;Hostname to be used&quot;
    default = &quot;conferences&quot;
}

variable &quot;email&quot; {
    description = &quot;email to be used for let's encrypt acme config&quot;
    default = &quot;john.doe@email.com&quot;
}

variable &quot;domain&quot; {
    description = &quot;domain to be used&quot;
    default = &quot;aremyj.am&quot;
}

variable &quot;aws_access_key&quot; {
    description = &quot;AWS Access Key - get it here: (https://console.aws.amazon.com/iam/home?#security_credential)&quot;
}

variable &quot;aws_secret_key&quot; {
    description = &quot;AWS Secret Key - get it here: (https://console.aws.amazon.com/iam/home?#security_credential)&quot;
}

variable &quot;aws_region&quot; {
    description = &quot;AWS Region&quot;
    default = &quot;us-east-1&quot;
}</pre>



<h3 class="wp-block-heading">[yourdomain].auto.tfvars</h3>



<p>The auto.tfvars file provides values to the variables defined in the variables.tf file. You&#8217;ll have to create this file from scratch, and terraform best practices dictate that you exclude this file from source control. Here&#8217;s an example you can use. Modify this for your environment. The name doesn&#8217;t matter, as long as it ends with auto.tfvars.</p>



<pre class="urvanov-syntax-highlighter-plain-tag">vultr_api_key = &quot;&amp;#91;fill this in]&quot;
vultr_region = 1
vultr_plan_id = 202
vultr_app_id = 47
vultr_tag = &quot;jitsi-conference&quot;
hostname = &quot;conference&quot;
email = &quot;your.email@address.org&quot;
domain = &quot;your-domain.com&quot;
aws_region = &quot;us-east-1&quot;
aws_access_key = &quot;&amp;#91;fill this in]&quot;
aws_secret_key = &quot;&amp;#91;fill this in]&quot;</pre>



<h3 class="wp-block-heading">configure_jitsi_param.sh</h3>



<p>Full disclosure, I did not create this script. Vultr created it, and provides it on your Jitsi VPS when you request it. Unfortunately, the version they provide is intended to be executed interactively, so I made a few very minor modifications to allow for us to run it with parameters.</p>



<pre class="urvanov-syntax-highlighter-plain-tag">#!/bin/bash
#This script was copied from /opt/vultr/configure_jitsi.sh on a Vultr VPS that has the one-click Jitsi App
#I added lines 7-9 to allow for adding parameters on the CLI and commented lines 11-13 to force the variables to be provided on the CLI
#https://www.vultr.com/docs/one-click-jitsi
#https://www.virtjunkie.com/jitsi-jit-conferencing-tf-vultr-route53/
#https://github.com/jonhowe/Virtjunkie.com/tree/master/Jitsi-JIT-Conferencing-TF-Vultr-Route53
HOSTNAME=$1
EMAIL=$2
response=$3
# User choices
#read -ep &quot;Please specify which domain you would like to use: &quot; HOSTNAME
#read -ep &quot;Please enter your email address for Let's Encrypt Registration: &quot; EMAIL
#read -r -p &quot;Would you like to enable password authorization? &amp;#91;y/N] &quot; response
case &quot;$response&quot; in
    &amp;#91;yY]&amp;#91;eE]&amp;#91;sS]|&amp;#91;yY])
        AUTH=1
        ;;
    *)
        AUTH=0
        ;;
esac


PROSODYPATH=/etc/prosody/conf.avail/${HOSTNAME}.cfg.lua
JITSIPATH=/etc/jitsi/meet/${HOSTNAME}-config.js
JICOFOPATH=/etc/jitsi/jicofo/sip-communicator.properties

# Remove and purge (Stop first and wait to avoid race condition)
purgeold() {        
        /opt/vultr/stopjitsi.sh
        sleep 5
        apt -y purge jigasi jitsi-meet jitsi-meet-web-config jitsi-meet-prosody jitsi-meet-turnserver jitsi-meet-web jicofo jitsi-videobridge2 jitsi*
}

# Reinstall
reinstalljitsi() {
        echo &quot;jitsi-videobridge2 jitsi-videobridge/jvb-hostname string ${HOSTNAME}&quot; | debconf-set-selections
        echo &quot;jitsi-meet-web-config jitsi-meet/cert-choice string Generate a new self-signed certificate (You will later get a chance to obtain a Let's encrypt certificate)&quot; | debconf-set-selections
        apt-get -y install jitsi-meet
}

# Remove nginx defaults
wipenginx() {
        rm -f /etc/nginx/sites-enabled/default
}

# Configure Lets Encrypt
configssl(){
    systemctl restart nginx
    sed -i -e 's/echo.*Enter your email and press.*/EMAIL=$1/' /usr/share/jitsi-meet/scripts/install-letsencrypt-cert.sh
    sed -i -e 's/read EMAIL//'  /usr/share/jitsi-meet/scripts/install-letsencrypt-cert.sh
    /usr/share/jitsi-meet/scripts/install-letsencrypt-cert.sh ${EMAIL}
}

configprosody() {
  AUHTLINE='authentication = &quot;internal_plain&quot;'
  sed -i &quot;s/authentication\ \=\ \&quot;anonymous\&quot;/${AUTHLINE}/g&quot; ${PROSODYPATH}
  cat &amp;lt;&amp;lt; EOT &gt;&gt; ${PROSODYPATH}

VirtualHost &quot;guest.${HOSTNAME}&quot;
    authentication = &quot;anonymous&quot;
    c2s_require_encryption = false

EOT
}

configjitsi() {
        sed -i &quot;s/\/\/\ anonymousdomain\:\ 'guest.example.com',/anonymousdomain\:\ 'guest.${HOSTNAME}',/g&quot; ${JITSIPATH}
}

configjicofo() {
        echo &quot;org.jitsi.jicofo.auth.URL=XMPP:${HOSTNAME}&quot; &gt;&gt; ${JICOFOPATH}
}

registeruser(){
        PASSWORD=$(&amp;lt; /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-16};echo;)
        prosodyctl register admin ${HOSTNAME} ${PASSWORD}
}

restartjitsi() {
        /opt/vultr/stopjitsi.sh
        /opt/vultr/startjitsi.sh
}

completedsetup(){
    echo &quot;&quot;
    echo &quot;------------------------------&quot;
    echo &quot;|                            |&quot;
    echo &quot;|   JITSI SETUP COMPLETED!   |&quot;
    echo &quot;|                            |&quot;
    echo &quot;------------------------------&quot;
    echo &quot;JITSI URL: https://${HOSTNAME}&quot;/
    echo &quot;&quot;
}

outputUser(){
    echo &quot;USERNAME: admin&quot;
    echo &quot;PASSWORD: ${PASSWORD}&quot;
    echo &quot;&quot;
}

# Script start

purgeold
reinstalljitsi
wipenginx
configssl
if &amp;#91; &quot;$AUTH&quot; == &quot;1&quot; ]; then
    configprosody
    configjitsi
    configjicofo
    registeruser
    restartjitsi    
fi
completedsetup
if &amp;#91; &quot;$AUTH&quot; == &quot;1&quot; ]; then
    outputUser
fi</pre>



<h2 class="wp-block-heading">Summary + More Reading</h2>



<p>There you have it! With this project you can have a fully functional Jitsi instance on your own domain with end to end encryption in less than 5 minutes. When you are done, there&#8217;s no harm in deleting it so you aren&#8217;t charged.</p>



<p>Here are some references I used while creating this:</p>



<ul><li><a href="https://github.com/jonhowe/Virtjunkie.com/tree/master/Jitsi-JIT-Conferencing-TF-Vultr-Route53">https://github.com/jonhowe/Virtjunkie.com/tree/master/Jitsi-JIT-Conferencing-TF-Vultr-Route53</a></li><li><a href="https://www.vultr.com/docs/one-click-jitsi">https://www.vultr.com/docs/one-click-jitsi</a></li><li><a href="https://www.terraform.io/docs/providers/aws/d/route53_zone.html">https://www.terraform.io/docs/providers/aws/d/route53_zone.html</a></li><li><a href="https://www.terraform.io/docs/providers/aws/r/route53_record.html">https://www.terraform.io/docs/providers/aws/r/route53_record.html</a></li><li><a href="https://www.terraform.io/docs/providers/vultr/r/server.html#default_password">https://www.terraform.io/docs/providers/vultr/r/server.html#default_password</a></li><li><a href="https://www.terraform.io/docs/provisioners/connection.html#the-self-object">https://www.terraform.io/docs/provisioners/connection.html#the-self-object</a></li><li>Create Vultr API Key: <a href="https://my.vultr.com/settings/#settingsapi">https://my.vultr.com/settings/#settingsapi</a></li><li>Create AWS Access/Secret Key: <a href="https://console.aws.amazon.com/iam/home?#security_credential">https://console.aws.amazon.com/iam/home?#security_credential</a></li><li>Vultr API Reference &#8211; has examples that will get you plan, region, and app IDs. <a href="https://www.vultr.com/api/">https://www.vultr.com/api/</a></li></ul>
<p>The post <a href="/2020/05/04/jitsi-jit-conferencing-tf-vultr-route53/">Jitsi for Just in Time Conferencing using Terraform on Vultr with Route 53</a> appeared first on <a href="/">VirtJunkie</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>/2020/05/04/jitsi-jit-conferencing-tf-vultr-route53/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Set Up Enpass With HTTPS Protected WebDAV and Ditch LastPass</title>
		<link>/2020/04/27/ditch-lastpass-for-enpass-webdav-https-traefik/</link>
					<comments>/2020/04/27/ditch-lastpass-for-enpass-webdav-https-traefik/#respond</comments>
		
		<dc:creator><![CDATA[Jon]]></dc:creator>
		<pubDate>Mon, 27 Apr 2020 13:00:00 +0000</pubDate>
				<category><![CDATA[Docker]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Servers]]></category>
		<guid isPermaLink="false">http://www.virtjunkie.com/?p=1249</guid>

					<description><![CDATA[<p>It's time to ditch cloud based password managers. There.. I said it. What we are doing when we use them is giving ownership and management of our trusted secrets to someone else, and hoping that they will be able to protect them from bad guys, and make sure they are available when we need them.</p>
<p>The post <a href="/2020/04/27/ditch-lastpass-for-enpass-webdav-https-traefik/">Set Up Enpass With HTTPS Protected WebDAV and Ditch LastPass</a> appeared first on <a href="/">VirtJunkie</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>It&#8217;s time to ditch cloud based password managers. There.. I said it. What we are doing when we use them is giving ownership and management of our trusted secrets to someone else, and hoping that they will be able to protect them from bad guys, and make sure they are available when we need them.</p>



<p>That&#8217;s a heck of an ask, isn&#8217;t it? I&#8217;ve been a LastPass customer for a very, very long time.. I use it to share secrets with my family, I use it on my mobile device to log into apps. It&#8217;s a safe bet to say it&#8217;s a critical piece of how I operate, and they have never once let me down. That said, if they asked for money to continue using their service, I&#8217;d have to pay. If they had a security event where secrets were compromised or if they lost my data, I&#8217;d be in very, very bad shape.</p>



<p>In this article, I will talk about how to set up a WebDAV share that&#8217;s protected by HTTPS using Traefik, Let&#8217;s Encrypt, and a WebDAV container on your own server, and use it to sync your secrets with devices.</p>



<span id="more-1249"></span>



<p>Before I begin, it&#8217;s important to understand that using WebDAV isn&#8217;t the only way to sync your secrets with Enpass. <a rel="noreferrer noopener" href="https://www.enpass.io/docs/manual-desktop/sync.html#supclouds" target="_blank">There are others</a>:</p>



<ul><li>Dropbox</li><li>Google Drive</li><li>OneDrive (Personal/Business)</li><li>iCloud</li><li>Box</li><li>Folder sync</li></ul>



<h2 class="wp-block-heading">Base Server Set Up</h2>



<h3 class="wp-block-heading">Get a VPS</h3>



<p>First thing we need is a server that is public internet facing. The easiest way to do this is to use a service that provides virtual private servers. I like Vultr because of their price/performance/feature availability ratio. They are cheaper than DigitalOcean and AWS, as easy, if not easier to manage, and have the scale you need to put your data pretty much wherever you want. If you do use Vultr, please do me a favor and use <a rel="noreferrer noopener" href="https://www.vultr.com/?ref=8531966-6G" target="_blank">this link</a> to sign up. I&#8217;ll get a little kickback, but you&#8217;ll get $100 USD to use on the site in your first month.</p>



<div class="wp-block-media-text alignwide is-stacked-on-mobile is-vertically-aligned-center" style="grid-template-columns:24% auto"><figure class="wp-block-media-text__media"><a href="https://www.vultr.com/?ref=8531966-6G" target="_blank" rel="noopener noreferrer"><img decoding="async" width="283" height="252" src="https://new.virtjunkie.com/wp-content/uploads/2020/04/2020-04-26_09-57.png" alt="" class="wp-image-1252"/></a></figure><div class="wp-block-media-text__content">
<p class="has-text-align-left has-normal-font-size">The OS doesn&#8217;t really matter, as long as you can install docker on it. A very small VPS will suffice, and mine costs $3.50 USD/Month.</p>
</div></div>



<h3 class="wp-block-heading">Harden the OS</h3>



<p>I won&#8217;t go into very much depth with this subject, but here are a few general guidelines:</p>



<ul><li>Disable root login via SSH</li><li>Require public key authentication for SSH sessions</li><li>Enable multi factor authentication for your remote user</li><li>Only install packages you need</li><li>Ensure all updates are installed, and continue to do so on a regular basis</li></ul>



<h2 class="wp-block-heading">Set Up Docker, Traefik, and WebDAV</h2>



<p>All code is on the GitHub repository I use to share all code for this site. You can find it here: <a href="https://github.com/jonhowe/Virtjunkie.com/tree/master/DitchLastPass">https://github.com/jonhowe/Virtjunkie.com/tree/master/DitchLastPass</a></p>



<p>First and foremost, this will not be a tutorial on how to administer Docker, WebDAV, or especially Traefik, but I&#8217;ll give you the exact steps and code for setting this up yourself, and provide some links at the end you can use to learn more about these topics.</p>



<p>All of the following steps will be executed on your VPS, so please sure you are connected to it via SSH or a similar terminal window.</p>



<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<p>We&#8217;ll be using an external docker bridge network in this configuration, the following command will create it</p>



<pre class="urvanov-syntax-highlighter-plain-tag">docker network create proxy</pre>
</div></div>
</div></div>
</div></div>
</div></div>
</div></div>
</div></div>



<h3 class="wp-block-heading">Create Traefik Configuration</h3>



<p>First of all, let&#8217;s create the directory structure we&#8217;ll need for Traefik (line 1). We&#8217;ll also be creating a file that will be used for storing SSL certificates (line 2), and setting permissions on it (line 3).</p>



<pre class="urvanov-syntax-highlighter-plain-tag">mkdir -p $HOME/docker/traefik/data
touch $HOME/docker/traefik/data/acme.json
chmod 600 $HOME/docker/traefik/data/acme.json</pre>



<h4 class="wp-block-heading">Create Traefik Configuration</h4>



<p>Create a new file in the <strong><code>traefik/data</code></strong> directory we just created called <code><strong>traefik.yml</strong></code> with the contents below.</p>



<p>Changes Required:</p>



<ul><li>Line 24: Modify your email address</li></ul>



<pre class="urvanov-syntax-highlighter-plain-tag">#File Path
#$HOME/docker/traefik/data/traefik.yml

#http://www.virtjunkie.com/ditch-lastpass-for-enpass-webdav-https-traefik/
#https://github.com/jonhowe/Virtjunkie.com/tree/master/DitchLastPass

api:
  dashboard: false

entryPoints:
  http:
    address: &quot;:80&quot;
  https:
    address: &quot;:443&quot;

providers:
  docker:
    endpoint: &quot;unix:///var/run/docker.sock&quot;
    exposedByDefault: false

certificatesResolvers:
  http:
    acme:
      email: your.email@domain.com
      storage: acme.json
      httpChallenge:
        entryPoint: http</pre>



<h4 class="wp-block-heading">Define Traefik Container</h4>



<p>Create a new file in the <strong><code>traefik/data</code></strong> directory called <code><strong>docker-compose.yml</strong></code></p>



<p>Changes Required:</p>



<ul><li>Line 30: Modify to fit the hostname of your server</li><li>Line 31: Add in credentials compatible with basic auth. You can use the output from the command below to achieve this.<ul><li><code><strong>echo $(htpasswd -nb [your user] [your pass]) | sed -e s/\$/\$\$/g</strong></code></li></ul></li><li>Line 35: Modify to fit the hostname of your server</li></ul>



<pre class="urvanov-syntax-highlighter-plain-tag">#File Path
#$HOME/docker/traefik/docker-compose.yml

#http://www.virtjunkie.com/ditch-lastpass-for-enpass-webdav-https-traefik/
#https://github.com/jonhowe/Virtjunkie.com/tree/master/DitchLastPass

version: '3'

services:
  traefik:
    image: traefik:v2.0
    container_name: traefik
    restart: unless-stopped
    security_opt:
      - no-new-privileges:true
    networks:
      - proxy
    ports:
      - 80:80
      - 443:443
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./data/traefik.yml:/traefik.yml:ro
      - ./data/acme.json:/acme.json
      - ./data/logs/:/logs/
    labels:
      - &quot;traefik.enable=true&quot;
      - &quot;traefik.http.routers.traefik.entrypoints=http&quot;
      - &quot;traefik.http.routers.traefik.rule=Host(`custom.hostname.com`)&quot;
      - &quot;traefik.http.middlewares.traefik-auth.basicauth.users=traefikuser:htpasswd-encrypted-string&quot;
      - &quot;traefik.http.middlewares.traefik-https-redirect.redirectscheme.scheme=https&quot;
      - &quot;traefik.http.routers.traefik.middlewares=traefik-https-redirect&quot;
      - &quot;traefik.http.routers.traefik-secure.entrypoints=https&quot;
      - &quot;traefik.http.routers.traefik-secure.rule=Host(`custom.hostname.com`)&quot;
      - &quot;traefik.http.routers.traefik-secure.middlewares=traefik-auth&quot;
      - &quot;traefik.http.routers.traefik-secure.tls=true&quot;
      - &quot;traefik.http.routers.traefik-secure.tls.certresolver=http&quot;
      - &quot;traefik.http.routers.traefik-secure.service=api@internal&quot;

networks:
  proxy:</pre>



<h4 class="wp-block-heading">Start Traefik Container</h4>



<pre class="urvanov-syntax-highlighter-plain-tag">cd $HOME/docker/traefik
docker-compose up -d</pre>



<h3 class="wp-block-heading">Create WebDAV Configuration</h3>



<p>Before we begin, we need to create the directory structure for the WebDAV container. Use the following command to do so.</p>



<pre class="urvanov-syntax-highlighter-plain-tag">mkdir -p $HOME/docker/webdav/dav/</pre>



<p>We&#8217;ll be using a <a rel="noreferrer noopener" href="https://hub.docker.com/r/bytemark/webdav/" target="_blank">container authored by bytemark</a> for this project. It&#8217;s essentially just apache with the webdav module installed. As of today, the container is less than 100MB.</p>



<h4 class="wp-block-heading">Define WebDAV Application Configuration</h4>



<p>Changes Required:</p>



<ul><li>Line 15: Username used to authenticate to the WebDAV service.</li><li>Line 16: Password you&#8217;ll use to authenticate to the WebDAV service. This is stored in plaintext in this example, but storing the variable in an external file is best practice.</li><li>Line 17: Modify to fit the hostname of your server</li><li>Line 27: Modify to fit the hostname of your server</li><li>Line 31: Modify to fit the hostname of your server</li></ul>



<pre class="urvanov-syntax-highlighter-plain-tag">#File path
#$HOME/docker/webdav/docker-compose.yml

#http://www.virtjunkie.com/ditch-lastpass-for-enpass-webdav-https-traefik/
#https://github.com/jonhowe/Virtjunkie.com/tree/master/DitchLastPass

version: '3'
services:
  webdav:
    image: bytemark/webdav
    container_name: webdav
    restart: unless-stopped
    environment:
      AUTH_TYPE: Basic
      USERNAME: your-username
      PASSWORD: secure-passsword
      SERVER_NAMES: your-dav.domain.com
    networks:
      - proxy
    security_opt:
      - no-new-privileges:true
    volumes:
      - ./dav:/var/lib/dav
    labels:
      - &quot;traefik.enable=true&quot;
      - &quot;traefik.http.routers.webdav.entrypoints=http&quot;
      - &quot;traefik.http.routers.webdav.rule=Host(`your-dav.domain.com`)&quot;
      - &quot;traefik.http.middlewares.webdav-https-redirect.redirectscheme.scheme=https&quot;
      - &quot;traefik.http.routers.webdav.middlewares=webdav-https-redirect&quot;
      - &quot;traefik.http.routers.webdav-secure.entrypoints=https&quot;
      - &quot;traefik.http.routers.webdav-secure.rule=Host(`your-dav.domain.com`)&quot;
      - &quot;traefik.http.routers.webdav-secure.tls=true&quot;
      - &quot;traefik.http.routers.webdav-secure.tls.certresolver=http&quot;
      - &quot;traefik.http.routers.webdav-secure.service=webdav&quot;
      - &quot;traefik.http.services.webdav.loadbalancer.server.port=80&quot;
      - &quot;traefik.docker.network=proxy&quot;
networks:
  proxy:
    external: true</pre>



<h4 class="wp-block-heading">Start the WebDAV Container</h4>



<p>Run the following command to bring up the webdav container</p>



<pre class="urvanov-syntax-highlighter-plain-tag">cd $HOME/docker/webdav
docker-compose up -d</pre>



<h3 class="wp-block-heading">Bringing it all together</h3>



<h4 class="wp-block-heading">Summary</h4>



<p>At this point you should have  two containers running on your VPS. Traefik is acting as a reverse proxy for the WebDAV container, and is providing SSL encryption to it. The SSL certificate is provided by <a rel="noreferrer noopener" href="https://letsencrypt.org/" target="_blank">Let&#8217;s Encrypt</a>.</p>



<h4 class="wp-block-heading">Final Directory Structure</h4>



<pre class="urvanov-syntax-highlighter-plain-tag">user@webdav-server:~/docker$ tree
.
├── traefik
│&amp;nbsp;&amp;nbsp; ├── data
│&amp;nbsp;&amp;nbsp; │&amp;nbsp;&amp;nbsp; ├── acme.json
│&amp;nbsp;&amp;nbsp; │&amp;nbsp;&amp;nbsp; └── traefik.yml
│&amp;nbsp;&amp;nbsp; └── docker-compose.yml
└── webdav
    ├── dav
    │&amp;nbsp;&amp;nbsp; ├── data
    │&amp;nbsp;&amp;nbsp; │&amp;nbsp;&amp;nbsp; └── Enpass
    │&amp;nbsp;&amp;nbsp; │&amp;nbsp;&amp;nbsp;     └── vault.enpassdbsync
    │&amp;nbsp;&amp;nbsp; ├── DavLock
    │&amp;nbsp;&amp;nbsp; ├── DavLock.dir
    │&amp;nbsp;&amp;nbsp; └── DavLock.pag
    └── docker-compose.yml

6 directories, 8 files</pre>



<h2 class="wp-block-heading">Migrate to Enpass Using WebDAV</h2>



<p>Now that we&#8217;ve got a functional and secure WebDAV instance, we just need to migrate to it. These steps are pretty easy, but I want to include them to be comprehensive.</p>



<h3 class="wp-block-heading">Export Secrets From Lastpass</h3>



<p>To make our transition from Lastpass as seamless as possible, we&#8217;ll export our secrets so we can import them into Enpass. The easiest way to do this is from the Lastpass Vault.</p>



<div class="wp-block-media-text alignwide has-media-on-the-right is-stacked-on-mobile"><figure class="wp-block-media-text__media"><img loading="lazy" decoding="async" width="359" height="444" src="https://www.virtjunkie.com/wp-content/uploads/2020/04/2020-04-26_11-51.png" alt="" class="wp-image-1271" srcset="/wp-content/uploads/2020/04/2020-04-26_11-51.png 359w, /wp-content/uploads/2020/04/2020-04-26_11-51-243x300.png 243w" sizes="(max-width: 359px) 100vw, 359px" /></figure><div class="wp-block-media-text__content">
<p class="has-large-font-size">Step 1 &#8211; Open Your Vault</p>
</div></div>



<hr class="wp-block-separator"/>



<div class="wp-block-media-text alignwide has-media-on-the-right is-stacked-on-mobile"><figure class="wp-block-media-text__media"><img loading="lazy" decoding="async" width="574" height="986" src="https://www.virtjunkie.com/wp-content/uploads/2020/04/2020-04-26_11-55.png" alt="" class="wp-image-1272" srcset="/wp-content/uploads/2020/04/2020-04-26_11-55.png 574w, /wp-content/uploads/2020/04/2020-04-26_11-55-175x300.png 175w" sizes="(max-width: 574px) 100vw, 574px" /></figure><div class="wp-block-media-text__content">
<p class="has-large-font-size">Step 2 &#8211; Export Secrets</p>



<ol><li>Select &#8220;More Options&#8221;</li><li>Select &#8220;Advanced&#8221;</li><li>Select &#8220;Export&#8221;</li><li>If prompted, enter your Master Password, and note where the CSV export file name and path.</li></ol>
</div></div>



<h3 class="wp-block-heading">Import Secrets To Enpass</h3>



<p>Pretty easy stuff here, just open enpass, and kick off the import.</p>



<div class="wp-block-media-text alignwide has-media-on-the-right is-stacked-on-mobile"><figure class="wp-block-media-text__media"><img loading="lazy" decoding="async" width="883" height="949" src="https://www.virtjunkie.com/wp-content/uploads/2020/04/Peek-2020-04-26-12-55.gif" alt="" class="wp-image-1287"/></figure><div class="wp-block-media-text__content">
<p class="has-normal-font-size">Import Steps:</p>



<ol><li>Open Enpass</li><li>Select Menu</li><li>Select File</li><li>Select Import</li><li>When prompted to &#8220;Select from where you want to import your data into Enpass&#8221;, select Lastpass</li><li>Navigate to the directory you exported the CSV to</li><li>Select continue to finish the import</li></ol>
</div></div>



<h3 class="wp-block-heading">Connect EnPass To WebDav Share</h3>



<p>At this point you&#8217;ve got a functioning WebDAV service protected by SSL, as well as a local instance of Enpass that has your lastpass secrets. We just need to connect EnPass to your Webdav instance to allow us to sync to it. Once you have <a rel="noreferrer noopener" href="https://www.enpass.io/downloads/" target="_blank">EnPass Installed</a>, follow the steps below to connect it to your WebDAV Service.</p>



<div class="wp-block-media-text alignwide has-media-on-the-right is-stacked-on-mobile"><figure class="wp-block-media-text__media"><img loading="lazy" decoding="async" width="881" height="558" src="https://www.virtjunkie.com/wp-content/uploads/2020/04/Peek-2020-04-26-12-20.gif" alt="" class="wp-image-1278"/></figure><div class="wp-block-media-text__content">
<p>Connection Steps:</p>



<ol><li>Open Enpass</li><li>Select Settings</li><li>Select Vaults</li><li>Select the Vault you&#8217;d like to sync</li><li>Enter the URL of your server, and ensure to include the https:// prefix</li><li>Enter the username and password created in Section 2.2.1</li><li>Ensure that the checkbox for &#8220;Bypass SSL Certificate Validation&#8221; is unchecked. We want to validate the SSL certificate since we are using Let&#8217;s Encrypt.</li></ol>
</div></div>



<h2 class="wp-block-heading">Risks</h2>



<p>There are some things that LastPass does for us that we don&#8217;t get with this solution. In particular, we are somewhat exposed to brute force attempts to the webdav service. Also, LastPass has a number of email notifications that go out when things happen in your vault. We are really only notified when a new client joins the vault in Enpass.</p>



<h2 class="wp-block-heading">Trafeik Resources</h2>



<p><a href="https://medium.com/@containeroo/traefik-2-0-docker-a-simple-step-by-step-guide-e0be0c17cfa5">https://medium.com/@containeroo/traefik-2-0-docker-a-simple-step-by-step-guide-e0be0c17cfa5</a><br><a href="https://containo.us/blog/traefik-2-0-docker-101-fc2893944b9d/">https://containo.us/blog/traefik-2-0-docker-101-fc2893944b9d/</a></p>
<p>The post <a href="/2020/04/27/ditch-lastpass-for-enpass-webdav-https-traefik/">Set Up Enpass With HTTPS Protected WebDAV and Ditch LastPass</a> appeared first on <a href="/">VirtJunkie</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>/2020/04/27/ditch-lastpass-for-enpass-webdav-https-traefik/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>PowerCli &#8211; Deploy Linked Clone with Static IP</title>
		<link>/2019/07/18/powercli-linked-clone-static-ip/</link>
					<comments>/2019/07/18/powercli-linked-clone-static-ip/#respond</comments>
		
		<dc:creator><![CDATA[Jon]]></dc:creator>
		<pubDate>Fri, 19 Jul 2019 02:36:32 +0000</pubDate>
				<category><![CDATA[Automation]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[VMware]]></category>
		<guid isPermaLink="false">http://www.virtjunkie.com/?p=774</guid>

					<description><![CDATA[<p>I'm not sure why it's been so hard to find a snippet online that gives me the ability to create a linked clone while selecting a static IP address, but it was. I ended up writing a quick function to help.</p>
<p>The post <a href="/2019/07/18/powercli-linked-clone-static-ip/">PowerCli &#8211; Deploy Linked Clone with Static IP</a> appeared first on <a href="/">VirtJunkie</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>I&#8217;m not sure why it&#8217;s been so hard to find a snippet online that gives me the ability to create a linked clone while selecting a static IP address, but it was. I ended up writing a quick function to help.</p>



<span id="more-774"></span>



<p>It should be pretty self explanatory.. just edit the variables in the parameter section and call the function.<br><br>Cheers!</p>



<p>Github: <a href="https://github.com/jonhowe/Virtjunkie.com/blob/master/Deploy-VM.ps1">https://github.com/jonhowe/Virtjunkie.com/blob/master/Deploy-VM.ps1</a></p>



<pre class="urvanov-syntax-highlighter-plain-tag">function New-VirtJunkieLinkedClone {
    [CmdletBinding()]
    &amp;lt;#
    Github: https://github.com/jonhowe/Virtjunkie.com/blob/master/Deploy-VM.ps1
    Link: https://www.virtjunkie.com/?p=774
    #&gt;
    param (
        #vCenter Info
        $vCenter            = 'vcsa.home.lab',
        $username           = 'administrator@vsphere.local',
        $password           = 'VMWare1!',
        $TemplateCustomSpec = 'WS16to19',

        #Parent VM Info
        $ParentVMName       = 'WS16-GUI',
        $SnapshotName       = &quot;Base&quot;,

        #New VM Info
        $VMName             = &quot;vra-iaas-2&quot;,
        $VMIP               = &quot;192.168.86.214&quot;,
        $VMNetmask          = &quot;255.255.255.0&quot;,
        $VMGateway          = &quot;192.168.86.1&quot;,
        $VMDNS              = &quot;192.168.86.232&quot;
    )
    
    begin {
        $vc_conn = Connect-VIServer -Server $vCenter -User $username -Password $password
    }
    
    process {
        # Get the OS CustomizationSpec and clone
        $OSCusSpec = Get-OSCustomizationSpec -Name $TemplateCustomSpec | 
            New-OSCustomizationSpec -Name 'tempcustomspec' -Type NonPersistent

        #Update Spec with IP information
        Get-OSCustomizationNicMapping -OSCustomizationSpec $OSCusSpec |
            Set-OSCustomizationNicMapping -IPMode UseStaticIP `
                -IPAddress $VMIP `
                -SubnetMask $VMNetmask  `
                -DefaultGateway $VMGateway `
                -Dns $VMDNS

        $mySourceVM = Get-VM -Name $ParentVMName
        $myReferenceSnapshot = Get-Snapshot -VM $mySourceVM -Name $SnapshotName 
        $Cluster = Get-Cluster 'Cluster'
        $myDatastore = Get-Datastore -Name 'Shared'

        New-VM -Name $VMName -VM $mySourceVM -LinkedClone -ReferenceSnapshot $myReferenceSnapshot -ResourcePool $Cluster `
        -Datastore $myDatastore -OSCustomizationSpec $OSCusSpec
    }
    
    end {
        Get-OSCustomizationSpec -Name $OSCusSpec | Remove-OSCustomizationSpec -Confirm:$false
    }
}</pre>
<p>The post <a href="/2019/07/18/powercli-linked-clone-static-ip/">PowerCli &#8211; Deploy Linked Clone with Static IP</a> appeared first on <a href="/">VirtJunkie</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>/2019/07/18/powercli-linked-clone-static-ip/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Quick Tips for freeing up space in Linux</title>
		<link>/2019/06/25/freeing-up-space-in-linux/</link>
					<comments>/2019/06/25/freeing-up-space-in-linux/#respond</comments>
		
		<dc:creator><![CDATA[Jon]]></dc:creator>
		<pubDate>Tue, 25 Jun 2019 13:26:31 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Servers]]></category>
		<guid isPermaLink="false">http://www.virtjunkie.com/?p=766</guid>

					<description><![CDATA[<p>Practice what you preach, right? As a former sysadmin, I try to keep my root partition on my personal machine pretty anemic.. usually between 40G and 60G. However, lately I've been running out of space and I wasn't sure why. Here are a few tips and tricks for finding the culprit, and freeing up some space.</p>
<p>The post <a href="/2019/06/25/freeing-up-space-in-linux/">Quick Tips for freeing up space in Linux</a> appeared first on <a href="/">VirtJunkie</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Practice what you preach, right? I try to keep my root partition on my personal machine pretty anemic.. usually between 40G and 60G. However, lately I&#8217;ve been running out of space and I wasn&#8217;t sure why. Here are a few tips and tricks for finding the culprit, and freeing up some space.</p>



<span id="more-766"></span>



<p><strong>Identify Large Files</strong><br>First thing&#8217;s first.. let&#8217;s figure out what&#8217;s taking up the space. The snippet below will locate large files</p>



<pre class="urvanov-syntax-highlighter-plain-tag">sudo find / -mount -ls | awk '{print $7, $11}' | sort -rn | less</pre>



<p><strong>Duplicate Snaps</strong><br>Snapd by default keeps 2 copies of your snaps. Unfortunately, you can&#8217;t set the default amount to keep to anything less than 2. Since this is my personal machine, and some of my snaps are pretty large (~1G in come cases), I only want to keep a single copy of them. The snippet below will remove all but the latest copy of a snap.</p>



<pre class="urvanov-syntax-highlighter-plain-tag">snap list --all | while read snapname ver rev trk pub notes; do if [[ $notes = *disabled* ]]; then snap remove &quot;$snapname&quot; --revision=&quot;$rev&quot;; fi; done</pre>



<p>If you want to keep more than the default of 2 snaps, you can use this snippet:</p>



<pre class="urvanov-syntax-highlighter-plain-tag">sudo snap set system refresh.retain=5</pre>



<p><strong>Snapd Snapshots?</strong><br>For some reason I had a number of snapd snapshots on my system. You can list them like this:</p>



<pre class="urvanov-syntax-highlighter-plain-tag">snap saved</pre>



<p>The &#8220;Saved&#8221; column is a unique identifier that is required when removing a snap. To remove a snapshot with ID of 1, run the following snippet:</p>



<pre class="urvanov-syntax-highlighter-plain-tag">snap forget 1</pre>



<p><strong>Docker Logs Are Out Of Control!</strong><br>When I identified the large files, I saw that a docker container was using &gt;20G of space. I stopped the container, removed the log file, and then started the container again. To prevent this issue from happening in the future, start your container while specifying the max-file and max-size parameters like the snippet below:</p>



<pre class="urvanov-syntax-highlighter-plain-tag">docker run --log-opt max-size=15m --log-opt max-file=2 dockerapp</pre>



<p><strong>Journal is using way too much space</strong><br>Since this is a personal workstation and logging isn&#8217;t my biggest priority, we can limit the journal. To see how much space you&#8217;re currently using, run the following snippet</p>



<pre class="urvanov-syntax-highlighter-plain-tag">journalctl --disk-usage</pre>



<p>There are three ways you can limit the journal:</p>



<ol><li>Limit by size of all journal files</li><li>Limit by amount of journal files</li><li>Limit by age of journal files</li></ol>



<p>You can handle each one of these using the snippets below</p>



<pre class="urvanov-syntax-highlighter-plain-tag"># By Size - Specify values in bytes or use K, M, G, T, P, E as units 
# for the specified sizes
journalctl --vacuum-size=200M

# By amount of files
journalctl --vacuum-files=15

# By age of files - specified with the usual &quot;s&quot;, &quot;m&quot;, &quot;h&quot;, &quot;days&quot;, 
# &quot;months&quot;, &quot;weeks&quot; and &quot;years&quot; suffixes
journalctl --vacuum-time=7days</pre>



<p><a href="https://www.freedesktop.org/software/systemd/man/journalctl.html" target="_blank" rel="noreferrer noopener" aria-label=" (opens in a new tab)">You can check the manpage online here</a></p>



<p><strong>Spotify Cache in Snap</strong><br>I recently noticed that Spotify has been caching tons of data on my desktop. Since I pay them to be a streaming service, I don&#8217;t really appreciate this. Fortunately, there&#8217;s a way to limit how much they cache on my machine. The changes below will limit Spotify to only cache 256MB locally.</p>



<pre class="urvanov-syntax-highlighter-plain-tag">edit this file:
/home/$USER/snap/spotify/current/.config/spotify/prefs

add the line:
storage.size=256</pre>



<p><strong>In Conclusion</strong><br>It should go without saying that you should adhere to completely different standards if you&#8217;re running out of space on a server, and that you should test these snippets on a mission critical system. These steps should all be non-intrusive on a desktop, if you&#8217;re concerned, test them on a less critical system first.</p>
<p>The post <a href="/2019/06/25/freeing-up-space-in-linux/">Quick Tips for freeing up space in Linux</a> appeared first on <a href="/">VirtJunkie</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>/2019/06/25/freeing-up-space-in-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>VMware Horizon Workspace &#8211; Part 2 &#8211; Configure Nginx as Frontend with Microsoft CA</title>
		<link>/2013/08/01/vmware-horizon-workspace-part-2-configure-nginx-as-frontend-with-microsoft-ca/</link>
					<comments>/2013/08/01/vmware-horizon-workspace-part-2-configure-nginx-as-frontend-with-microsoft-ca/#comments</comments>
		
		<dc:creator><![CDATA[Jon]]></dc:creator>
		<pubDate>Fri, 02 Aug 2013 02:45:23 +0000</pubDate>
				<category><![CDATA[Horizon Workspace]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[VMware]]></category>
		<guid isPermaLink="false">http://45.63.13.214/?p=528</guid>

					<description><![CDATA[<p>So yesterday, VMware released Horizon Workspace 1.5. HUGE improvement over the GA release&#8230; Holey smokes. Any further tutorials will reference this version. Anyways, more to the point. In this post I will demonstrate how to do a base configuration of Horizon Workspace using an internal Microsoft Certificate Authority with Nginx as a frontend. This setup [&#8230;]</p>
<p>The post <a href="/2013/08/01/vmware-horizon-workspace-part-2-configure-nginx-as-frontend-with-microsoft-ca/">VMware Horizon Workspace &#8211; Part 2 &#8211; Configure Nginx as Frontend with Microsoft CA</a> appeared first on <a href="/">VirtJunkie</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>So yesterday, <a title="VMware® Horizon Workspace 1.5 Release Notes" href="https://www.vmware.com/support/horizon_workspace/doc/hw_release_notes_15.html">VMware released Horizon Workspace 1.5</a>. HUGE improvement over the GA release&#8230; Holey smokes. Any further tutorials will reference this version.</p>
<p>Anyways, more to the point. In this post I will demonstrate how to do a base configuration of Horizon Workspace using an internal Microsoft Certificate Authority with Nginx as a frontend. This setup is only acceptable for setting up workspace in a lab environment, since in a production environment you&#8217;ll need a trusted third party cert. Doing this in a lab environment is important because it will allow you to set up and test every feature you&#8217;ll be using in a production environment.</p>
<p>Requirements:</p>
<ul>
<li><span style="line-height: 16px;">Microsoft Active Directory Certificate Services</span></li>
<li>Linux Machine running Nginx</li>
<li>Horizon Workspace 1.5 Downloaded and installed with no configuration.
<ul>
<li>We&#8217;ll be using the workspace FQDN of hzn.test.in (This obviously assumes the domain of test.in)</li>
</ul>
</li>
</ul>
<p><span id="more-528"></span></p>
<ol>
<li>On Linux machine, generate private key(1) and CSR(2)
<ol>
<li><pre class="urvanov-syntax-highlighter-plain-tag">openssl genrsa -out hzn.test.in.key 1024</pre></li>
<li><pre class="urvanov-syntax-highlighter-plain-tag">openssl req -new -key hzn.test.in.key -out hzn.test.in.csr</pre></li>
</ol>
</li>
<li>Take CSR and get a certificate from your internal Domain CA. Download the certificate. Rename it as hzn.test.in.crt</li>
<li>Download your internal Domain CA root key
<ol>
<li>On the machine running AD Cert Services, open the command line and type the following command:</li>
<li>[text]certutil -ca.cert %userprofile%\Desktop\test.in-root.cer[/text]</li>
</ol>
</li>
<li>Ensure that Nginx is forwarding traffic correctly to the gateway-va. Below is a snippet (Entries in square brackets need to be changed]:
<ol>
<li>[text]<br />
server {<br />
listen [load balancer IP];<br />
server_name hzn.test.in;<br />
ssl on;<br />
ssl_certificate [path to]hzn.test.in.crt<br />
ssl_certificate_key [path to]hzn.test.in.key</p>
<p>location / {<br />
proxy_pass https://gateway-va.test.in:443/;<br />
proxy_set_header Host $host;<br />
proxy_set_header X-Real-IP $remote_addr;<br />
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br />
proxy_read_timeout 1800;<br />
proxy_connect_timeout 1800;<br />
}<br />
[/text]</li>
</ol>
</li>
<li>Place your domain root ca key (gathered in step 3) into the <a href="https://configurator-va.test.in/" target="_blank" rel="noopener noreferrer">configurator web interface</a>
<ol>
<li>Open the web interface and navigate to the FQDN &amp; SSL section</li>
<li>Select Yes under External Load Balancer</li>
<li>Enter: hzn.test.in:443 in the Horizon Workspace FQDN section</li>
<li>Paste the domain root ca key in the &#8220;Load Balancer Root CA Certificate&#8221; section.</li>
</ol>
</li>
<li>You&#8217;re all set!  You can now log into the Horizon Workspace Admin page by navigating to https://hzn.test.in/admin</li>
</ol>
<p>I&#8217;d be happy to answer any questions on this. Feel free to post a comment if you like. I&#8217;ll answer any questions I can.</p>
<p>The post <a href="/2013/08/01/vmware-horizon-workspace-part-2-configure-nginx-as-frontend-with-microsoft-ca/">VMware Horizon Workspace &#8211; Part 2 &#8211; Configure Nginx as Frontend with Microsoft CA</a> appeared first on <a href="/">VirtJunkie</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>/2013/08/01/vmware-horizon-workspace-part-2-configure-nginx-as-frontend-with-microsoft-ca/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>VMware Horizon Workspace &#8211; Part 0 &#8211; Intro</title>
		<link>/2013/07/30/vmware-horizon-workspace-part-0-intro/</link>
					<comments>/2013/07/30/vmware-horizon-workspace-part-0-intro/#comments</comments>
		
		<dc:creator><![CDATA[Jon]]></dc:creator>
		<pubDate>Tue, 30 Jul 2013 20:54:46 +0000</pubDate>
				<category><![CDATA[Horizon Workspace]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[VMware]]></category>
		<guid isPermaLink="false">http://45.63.13.214/?p=522</guid>

					<description><![CDATA[<p>I&#8217;ve been working with Horizon Workspace since it went GA in March. At this point in time, I&#8217;m happy to say that I&#8217;ve got Workspace set up in a production environment. In this series, I will be covering how I configured each part of this suite. I would expect that this process will become exponentially [&#8230;]</p>
<p>The post <a href="/2013/07/30/vmware-horizon-workspace-part-0-intro/">VMware Horizon Workspace &#8211; Part 0 &#8211; Intro</a> appeared first on <a href="/">VirtJunkie</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I&#8217;ve been working with Horizon Workspace since it went GA in March. At this point in time, I&#8217;m happy to say that I&#8217;ve got Workspace set up in a production environment.</p>
<p>In this series, I will be covering how I configured each part of this suite. I would expect that this process will become exponentially easier as time goes on. One thing to note is that I will write these posts assuming that you are at least moderately familiar with linux and Workspace. I will not go into details on how to install packages, deploy the VA, use the web interface. Use Google if you&#8217;re looking for that boring stuff <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Here we go!</p>
<p><span id="more-522"></span></p>
<p>Due to the reliance that the business will put on the Workspace, my definition of Production is as follows:</p>
<ol>
<li>Externally Accessible
<ol>
<li>One URL to rule them all, both internal and external</li>
</ol>
</li>
<li><a title="VMware Horizon Workspace – Part 2 – Configure Nginx as Frontend with Microsoft CA" href="http://45.63.13.214/?p=528"><span style="line-height: 13px;">Load Balanced from within DMZ</span></a>
<ol>
<li>Multiple Load Balancers &#8211; no single point of failure!</li>
</ol>
</li>
<li>Multiple Virtual Appliances
<ol>
<li>At LEAST 2 of every VA that comes with Workspace (Gateway, Connector, Service, Data)</li>
</ol>
</li>
<li><a title="VMware Horizon Workspace – Part 3 – Configure VMware vPostgres External Database" href="http://45.63.13.214/?p=549" target="_blank" rel="noopener">External Postres SQL Database</a></li>
<li><a title="VMware Horizon Workspace – Part 2 – Configure Nginx as Frontend with Microsoft CA" href="http://45.63.13.214/?p=528" target="_blank" rel="noopener">Third Party SSL Certificate</a>
<ol>
<li>I used Godaddy, but if I had to do it again, I&#8217;d go with Verisign, or a more reputable CA. This should be fixed in Workspace 1.5, which should be released by the end of July.</li>
</ol>
</li>
<li>Data is stored on NFS rather than on local vmdk</li>
</ol>
<p>Throughout this (we&#8217;ll call it an adventure) I&#8217;ve learned a lot about the product.Most importantly, it&#8217;s become clear to me that this is not a product easily administered by a &#8220;VMware Admin&#8221;. Horizon Workspace is built on top of Suse Enterprise Linux 11, relies heavily on Zimbra for the data component, and uses nginx for everything else.</p>
<p>Sound like greek? Don&#8217;t panic, you can set up a good amount of Horizon Workspace without being a linux guru, however, imho, most of the things you&#8217;ll need to do in a production environment will require at least a moderate familiarity with the linux command line.</p>
<p>The post <a href="/2013/07/30/vmware-horizon-workspace-part-0-intro/">VMware Horizon Workspace &#8211; Part 0 &#8211; Intro</a> appeared first on <a href="/">VirtJunkie</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>/2013/07/30/vmware-horizon-workspace-part-0-intro/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>NetApp: Get Statistics from Multiple Filers With One Command</title>
		<link>/2013/07/11/netapp-get-statistics-from-multiple-filers-with-one-command/</link>
					<comments>/2013/07/11/netapp-get-statistics-from-multiple-filers-with-one-command/#respond</comments>
		
		<dc:creator><![CDATA[Jon]]></dc:creator>
		<pubDate>Fri, 12 Jul 2013 02:05:56 +0000</pubDate>
				<category><![CDATA[NetApp]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Servers]]></category>
		<guid isPermaLink="false">http://45.63.13.214/?p=510</guid>

					<description><![CDATA[<p>Does anyone actually find NetApp OnCommand System Commander to be fast enough for normal operation? I&#8217;ll admit, I still create a good amount of Volumes and LUNs using it, but it leaves a lot to be desired in the performance category. &#160;If you follow my blog at all, you know that I&#8217;m in the middle [&#8230;]</p>
<p>The post <a href="/2013/07/11/netapp-get-statistics-from-multiple-filers-with-one-command/">NetApp: Get Statistics from Multiple Filers With One Command</a> appeared first on <a href="/">VirtJunkie</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Does anyone actually find NetApp OnCommand System Commander to be fast enough for normal operation? I&#8217;ll admit, I still create a good amount of Volumes and LUNs using it, but it leaves a lot to be desired in the performance category. &nbsp;If you follow my blog at all, you know that I&#8217;m in the middle of a migration from a non-ha exchange environment to a DAG. Being the sensible admin that I am, I have multiple copies of my Exchange databases on different storage arrays, controlled by different NetApp filers. Using System Manager to monitor the space usage of the Volumes hosting my mailbox databases is way to slow for my comfort.</p>
<p><span id="more-510"></span></p>
<p>While I could use PowerShell to get the status of volumes from only each individual filer replacing &nbsp;using the following snippet:</p><pre class="urvanov-syntax-highlighter-plain-tag">if (!(Get-Module dataontap)) { Import-Module DataOnTAP }
$filer1 = Connect-NaController filer1 -Credential (Get-Credential)
$filer2 = Connect-NaController filer2 -Credential (Get-Credential)
Get-NaVol -controller $filer1
Get-NaVol -controller $filer2</pre><p>But that&#8217;s two commands&#8230; why would you want to enter two commands when you can enter one?! &nbsp;Assuming you set up the controller objects in lines 2 and 3 above, you can simply run the command below to get all volumes from both Filer1 and Filer2:</p><pre class="urvanov-syntax-highlighter-plain-tag">($filer1,$filer2) | % { Get-NaVol -Controller $_ }</pre><p>While this gets volumes from all controllers, why on EARTH would you want to see the size in bytes?? Seriously&#8230;</p>
<p>Below is a finished script that gathers volume information from multiple filers, but also formats the output in a human readable format. If you have uniform naming convention for volumes in your filers, you can un-comment (remove the &lt;# and #&gt; ) and enter the prefix of your volume on line 15.</p><pre class="urvanov-syntax-highlighter-plain-tag"># ========================================================================
# Created on:	7/11/2013 9:10 PM
# Created by:	Jon Howe
# URL: http://45.63.13.214/?p=510
# Filename:		Get-MultipleFilerVolStats.ps1
# ========================================================================

if (!(Get-Module dataontap)) { Import-Module DataOnTAP }

$filer1 = Connect-NaController filer1 -Credential (Get-Credential)
$filer2 = Connect-NaController filer2 -Credential (Get-Credential)
#$filer3 = Connect-NaController filer3 -Credential (Get-Credential)

($filer1,$filer2) | 
Foreach-object { Get-NaVol &lt;#-name volPrefix #&gt; -Controller $_ } | 
Select-Object Name,Used,Available | 
Format-Table -AutoSize -Property <code>
@{label="Volume";Expression={$_.Name}}, 
@{label="Percent Used";expression={$_.Used}}, `
@{label="Available";expression={[math]::round($_.Available / 1gb, 2)}
}</pre><p></p>
<p>The post <a href="/2013/07/11/netapp-get-statistics-from-multiple-filers-with-one-command/">NetApp: Get Statistics from Multiple Filers With One Command</a> appeared first on <a href="/">VirtJunkie</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>/2013/07/11/netapp-get-statistics-from-multiple-filers-with-one-command/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Use PowerShell to get Service Auto-Start Status Along with Human Readable Service Name</title>
		<link>/2013/06/18/473/</link>
					<comments>/2013/06/18/473/#respond</comments>
		
		<dc:creator><![CDATA[Jon]]></dc:creator>
		<pubDate>Wed, 19 Jun 2013 02:30:55 +0000</pubDate>
				<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Windows Stuff]]></category>
		<guid isPermaLink="false">http://45.63.13.214/?p=473</guid>

					<description><![CDATA[<p>This falls into the &#8220;Come on Microsoft&#8221; category. I have been writing a script that will gather a bunch of information from servers, and returns an object with the information.  Part of what I&#8217;m gathering is the servers that are set to auto start, and have their corresponding service stopped. While you can get a [&#8230;]</p>
<p>The post <a href="/2013/06/18/473/">Use PowerShell to get Service Auto-Start Status Along with Human Readable Service Name</a> appeared first on <a href="/">VirtJunkie</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This falls into the &#8220;Come on Microsoft&#8221; category.</p>
<p>I have been writing a script that will gather a bunch of information from servers, and returns an object with the information.  Part of what I&#8217;m gathering is the servers that are set to auto start, and have their corresponding service stopped.</p>
<p>While you can get a list of services that meet part of this criteria like this:</p>
<p><span id="more-473"></span></p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">Get-Service -ComputerName &quot;computername&quot; |
Where-Object { $_.status -eq &quot;Stopped&quot; } |
select-object DisplayName</pre><p></p>
<p>The obvious problem here is that this will not return services that are set to. You can run the following command to find the service name (not the human friendly name above) as well as the startup type using the command below</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">Get-WmiObject win32_service |
where {$_.state -eq &quot;stopped&quot; -and $_.startmode -eq &quot;auto&quot;}</pre><p></p>
<p>Now, if only Microsoft allowed us get all 3 (Service Descriptive Name, Service Status, Autostart Status) in one command, that would be great!  Until they get around to it, you can use this command:</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">Get-WmiObject win32_service |
where {$_.state -eq &quot;stopped&quot; -and $_.startmode -eq &quot;auto&quot;} |
Get-Service |
select displayname</pre><p></p>
<p>The post <a href="/2013/06/18/473/">Use PowerShell to get Service Auto-Start Status Along with Human Readable Service Name</a> appeared first on <a href="/">VirtJunkie</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>/2013/06/18/473/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Use PowerShell to Update Specific AD User&#8217;s Description Field with Last Login Time</title>
		<link>/2013/04/19/use-powershell-to-change-specific/</link>
					<comments>/2013/04/19/use-powershell-to-change-specific/#respond</comments>
		
		<dc:creator><![CDATA[Jon]]></dc:creator>
		<pubDate>Fri, 19 Apr 2013 16:00:31 +0000</pubDate>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Windows Stuff]]></category>
		<guid isPermaLink="false">http://45.63.13.214/?p=419</guid>

					<description><![CDATA[<p>I encountered a challenge today that was fun to fix.  There&#8217;s an Organizational Unit in my AD setup that has historically been used to store disabled AD objects instead of deleting them. When an employee leaves the organization, our standard procedure  is as followed: Disable User Object Move to separate OU (IE AD://internal.msd/disabled/users) Update Description [&#8230;]</p>
<p>The post <a href="/2013/04/19/use-powershell-to-change-specific/">Use PowerShell to Update Specific AD User&#8217;s Description Field with Last Login Time</a> appeared first on <a href="/">VirtJunkie</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I encountered a challenge today that was fun to fix.  There&#8217;s an Organizational Unit in my AD setup that has historically been used to store disabled AD objects instead of deleting them.</p>
<p>When an employee leaves the organization, our standard procedure  is as followed:</p>
<ol>
<li><span style="line-height: 13px;">Disable User Object</span></li>
<li>Move to separate OU (IE AD://internal.msd/disabled/users)</li>
<li>Update Description field with something like: Disabled by [username] on [date]</li>
<li>Retain user object for x amount of days, then tombstone it.</li>
</ol>
<p>Best laid plans of mice and men&#8230; yada yada&#8230;</p>
<p><span id="more-419"></span></p>
<p>I was able to go through all of these user objects that didn&#8217;t get their description updated with the one liner below. I&#8217;ll explain this beginning with script line 3 below:</p>
<ul>
<li><span><span>(Line 3) Find all users in the OU: </span></span><span style="line-height: 19px;">&#8216;OU=Users,OU=Disabled,DC=internal,DC=msd&#8217; &#8211; customize this to your environment</span></li>
<li><span style="line-height: 19px;">(Line 4) Exclude objects where the description does not contain the word &#8220;disabled&#8221;.</span></li>
<li>(Lines 5-7) Loop through each object that remains and update the description with the same object&#8217;s last login date.</li>
</ul>
<p>FYI &#8211; this script requires the Quest ActiveRoles Powershell Toolkit (<a href="http://www.quest.com/powershell/activeroles-server.aspx">http://www.quest.com/powershell/activeroles-server.aspx</a>)</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">#This script requires Quest AD Tools
add-pssnapin Quest.ActiveRoles.ADManagement

#Everything below this is on one line
get-QADUser -searchroot 'OU=Users,OU=Disabled,DC=internal,DC=msd'
| Where-Object { $_.Description -notlike &amp;quot;*disabled*&amp;quot; }
| ForEach-Object { set-qaduser -identity
(get-qaduser $_.samaccountname) -description
(&amp;quot;Last Login: &amp;quot; + (get-qaduser $_.samaccountname).lastlogon})</pre><p></p>
<p>I&#8217;m sure there&#8217;s a more elegant way to handle this, but in 30 minutes I created this one liner, and updated <em>a lot</em> of user objects.</p>
<p>Cheers!</p>
<p>The post <a href="/2013/04/19/use-powershell-to-change-specific/">Use PowerShell to Update Specific AD User&#8217;s Description Field with Last Login Time</a> appeared first on <a href="/">VirtJunkie</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>/2013/04/19/use-powershell-to-change-specific/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>vCenter 5.1 &#8211; Unable to Log in to vSphere Web Client</title>
		<link>/2013/04/10/vcenter-5-1-unable-to-log-in-to-vsphere-web-client/</link>
					<comments>/2013/04/10/vcenter-5-1-unable-to-log-in-to-vsphere-web-client/#respond</comments>
		
		<dc:creator><![CDATA[Jon]]></dc:creator>
		<pubDate>Wed, 10 Apr 2013 23:00:30 +0000</pubDate>
				<category><![CDATA[Servers]]></category>
		<category><![CDATA[VMware]]></category>
		<guid isPermaLink="false">http://45.63.13.214/?p=404</guid>

					<description><![CDATA[<p>In a new installation of vCenter 5.1, when trying to access the vSphere Web Client for the first time, you will encounter the following message: [text] In order for this direct link to work, you must first log in to the vSphere Web Client at least once from https://{webclient/ -host}:{webclient-https-port}. [/text] You can resolve this [&#8230;]</p>
<p>The post <a href="/2013/04/10/vcenter-5-1-unable-to-log-in-to-vsphere-web-client/">vCenter 5.1 &#8211; Unable to Log in to vSphere Web Client</a> appeared first on <a href="/">VirtJunkie</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In a new installation of vCenter 5.1, when trying to access the vSphere Web Client for the first time, you will encounter the following message:</p>
<p>[text]<br />
In order for this direct link to work, you must first log in to the<br />
vSphere Web Client at least once from https://{webclient/<br />
-host}:{webclient-https-port}.<br />
[/text]</p>
<p>You can resolve this error and fix the issue using the following steps:<br />
<span id="more-404"></span></p>
<p>Let&#8217;s say the name of your vCenter server is vCenter. As long as your SSO configuration was done correctly, and you kept the default ports during installation you can log in using the following URL:</p>
<p><a href="https://vcenter-test:9443/vsphere-client">https://vcenter-test:9443/vsphere-client</a></p>
<p>Once you log in using that URL, log out, and then try accessing the URL that originally provided the error (which is: https://vcenter-test/vsphere-client/), and it works!</p>
<p><img loading="lazy" decoding="async" class="alignleft size-full wp-image-406" alt="vcenter1" src="https://new.virtjunkie.com/wp-content/uploads/2013/04/vcenter1.png" width="736" height="515" srcset="/wp-content/uploads/2013/04/vcenter1.png 736w, /wp-content/uploads/2013/04/vcenter1-300x210.png 300w" sizes="(max-width: 736px) 100vw, 736px" /></p>
<p>The post <a href="/2013/04/10/vcenter-5-1-unable-to-log-in-to-vsphere-web-client/">vCenter 5.1 &#8211; Unable to Log in to vSphere Web Client</a> appeared first on <a href="/">VirtJunkie</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>/2013/04/10/vcenter-5-1-unable-to-log-in-to-vsphere-web-client/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
