tag:blogger.com,1999:blog-83942806315374251652024-03-04T23:19:00.924-08:00All Things Techie .netTo err is human; To !err, divine.Justin Bennetthttp://www.blogger.com/profile/08685325767450711504noreply@blogger.comBlogger62125tag:blogger.com,1999:blog-8394280631537425165.post-60296727788502701942017-07-03T14:12:00.002-07:002017-07-03T14:25:04.377-07:00Automate Update of VM Template - Part 2 - Linux<a href="http://www.allthingstechie.net/2016/07/automate-update-of-vm-template.html" target="_blank">Automate Update of VM Template - Part 1 - Windows</a><br />
<a href="http://www.allthingstechie.net/2017/07/automate-update-of-vm-template-part-2.html" target="_blank">Automate Update of VM Template - Part 2 - Linux</a><br />
<br />
The solution I've been using for over a year now to keep my Windows Server 2012 R2 and 2016 VM templates up-to-date I've now tweaked for Linux. I'm using it on a CentOS 7 template, but you can easily tweak it to include whatever flavor distro you prefer.<br />
<br />
You can find the latest version at: <a href="https://github.com/cajeeper/PowerCLI/blob/master/Install-Linux-Update-for-Template-CentOS_Redhat.ps1" target="_blank">https://github.com/cajeeper/PowerCLI/blob/master/Install-Linux-Update-for-Template-CentOS_Redhat.ps1</a><br />
<br />
Here's a breakdown on what this script does:<br />
<br />
<ul>
<li>Converts the VM template to a virtual machine</li>
<li>Starts the virtual machine</li>
<li>Issues PowerShell script block via VMWare Tools to echo the current version of the OS and install any needed Linux updates via yum</li>
<li>Shuts the virtual machine down</li>
<li>Converts the virtual machine back to a VM template</li>
<li>Logs the results</li>
</ul>
<div>
Optionally:</div>
<div>
<ul>
<li>Creates copy of template to another system/site</li>
<li>Shows the progress via the CLI</li>
</ul>
</div>
<div>
Note: Only test with CentOS, so far.<br />
<br />
Requirements for the script to function:</div>
<div>
<ul>
<li>An existing Linux VM template that has VMware Tools installed and a network adapter to recieve updates</li>
<li>VMware vCenter - Tested on vCenter 6.0.0</li>
<li>A user/service account with permissions to Create, Remove, Start, Stop VMs and issue VM scripting commands in vCenter 6.0.0</li>
<li>A user/service account with permissions to install updates in the template virtual machine</li>
<li>Update the parameters with all your relevant template, location, etc. and if you want a post copy of the template to kick off.</li>
</ul>
<div>
Here's a dump of my test CentOS template log:<br />
<br />
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: 300px; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> [Start Batch - 07/03/2017 13:47:18]
Converting Template: CentOS-7-x86_64-Minimal-1611 to VM
Starting VM: CentOS-7-x86_64-Minimal-1611
Giving VM: CentOS-7-x86_64-Minimal-1611 30 seconds to start VMwareTools
Running Script on Guest VM: CentOS-7-x86_64-Minimal-1611
Giving VM: CentOS-7-x86_64-Minimal-1611 Linux Updates Loaded
CentOS Linux release 7.3.1611 (Core)
3.10.0-514.el7.x86_64
Loaded plugins: fastestmirror
Cleaning repos: base extras updates
Cleaning up everything
Cleaning up list of fastest mirrors
Loaded plugins: fastestmirror
Determining fastest mirrors
* base: mirror.hostduplex.com
* extras: centosd6.centos.org
* updates: centos.sonn.com
Resolving Dependencies
--> Running transaction check
---> Package NetworkManager.x86_64 1:1.4.0-12.el7 will be updated
---> Package NetworkManager.x86_64 1:1.4.0-20.el7_3 will be an update
---> Package NetworkManager-libnm.x86_64 1:1.4.0-12.el7 will be updated
---> Package NetworkManager-libnm.x86_64 1:1.4.0-20.el7_3 will be an update
---> Package NetworkManager-team.x86_64 1:1.4.0-12.el7 will be updated
---> Package NetworkManager-team.x86_64 1:1.4.0-20.el7_3 will be an update
---> Package NetworkManager-tui.x86_64 1:1.4.0-12.el7 will be updated
---> Package NetworkManager-tui.x86_64 1:1.4.0-20.el7_3 will be an update
---> Package NetworkManager-wifi.x86_64 1:1.4.0-12.el7 will be updated
---> Package NetworkManager-wifi.x86_64 1:1.4.0-20.el7_3 will be an update
---> Package audit.x86_64 0:2.6.5-3.el7 will be updated
---> Package audit.x86_64 0:2.6.5-3.el7_3.1 will be an update
---> Package audit-libs.x86_64 0:2.6.5-3.el7 will be updated
---> Package audit-libs.x86_64 0:2.6.5-3.el7_3.1 will be an update
---> Package bash.x86_64 0:4.2.46-20.el7_2 will be updated
---> Package bash.x86_64 0:4.2.46-21.el7_3 will be an update
---> Package ca-certificates.noarch 0:2015.2.6-73.el7 will be updated
---> Package ca-certificates.noarch 0:2017.2.14-70.1.el7_3 will be an update
---> Package chkconfig.x86_64 0:1.7.2-1.el7 will be updated
---> Package chkconfig.x86_64 0:1.7.2-1.el7_3.1 will be an update
---> Package chrony.x86_64 0:2.1.1-3.el7.centos will be updated
---> Package chrony.x86_64 0:2.1.1-4.el7.centos will be an update
---> Package device-mapper.x86_64 7:1.02.135-1.el7 will be updated
---> Package device-mapper.x86_64 7:1.02.135-1.el7_3.5 will be an update
---> Package device-mapper-event.x86_64 7:1.02.135-1.el7 will be updated
---> Package device-mapper-event.x86_64 7:1.02.135-1.el7_3.5 will be an update
---> Package device-mapper-event-libs.x86_64 7:1.02.135-1.el7 will be updated
---> Package device-mapper-event-libs.x86_64 7:1.02.135-1.el7_3.5 will be an update
---> Package device-mapper-libs.x86_64 7:1.02.135-1.el7 will be updated
---> Package device-mapper-libs.x86_64 7:1.02.135-1.el7_3.5 will be an update
---> Package dmidecode.x86_64 1:3.0-2.el7 will be updated
---> Package dmidecode.x86_64 1:3.0-2.1.el7_3 will be an update
---> Package dracut.x86_64 0:033-463.el7 will be updated
---> Package dracut.x86_64 0:033-463.el7_3.2 will be an update
---> Package dracut-config-rescue.x86_64 0:033-463.el7 will be updated
---> Package dracut-config-rescue.x86_64 0:033-463.el7_3.2 will be an update
---> Package dracut-network.x86_64 0:033-463.el7 will be updated
---> Package dracut-network.x86_64 0:033-463.el7_3.2 will be an update
---> Package expat.x86_64 0:2.1.0-8.el7 will be updated
---> Package expat.x86_64 0:2.1.0-10.el7_3 will be an update
---> Package firewalld.noarch 0:0.4.3.2-8.el7 will be updated
---> Package firewalld.noarch 0:0.4.3.2-8.1.el7_3.3 will be an update
---> Package firewalld-filesystem.noarch 0:0.4.3.2-8.el7 will be updated
---> Package firewalld-filesystem.noarch 0:0.4.3.2-8.1.el7_3.3 will be an update
---> Package gawk.x86_64 0:4.0.2-4.el7 will be updated
---> Package gawk.x86_64 0:4.0.2-4.el7_3.1 will be an update
---> Package glibc.x86_64 0:2.17-157.el7 will be updated
---> Package glibc.x86_64 0:2.17-157.el7_3.4 will be an update
---> Package glibc-common.x86_64 0:2.17-157.el7 will be updated
---> Package glibc-common.x86_64 0:2.17-157.el7_3.4 will be an update
---> Package grubby.x86_64 0:8.28-18.el7 will be updated
---> Package grubby.x86_64 0:8.28-21.el7_3 will be an update
---> Package initscripts.x86_64 0:9.49.37-1.el7 will be updated
---> Package initscripts.x86_64 0:9.49.37-1.el7_3.1 will be an update
---> Package irqbalance.x86_64 3:1.0.7-6.el7 will be updated
---> Package irqbalance.x86_64 3:1.0.7-6.el7_3.1 will be an update
---> Package kernel.x86_64 0:3.10.0-514.26.1.el7 will be installed
---> Package kernel-tools.x86_64 0:3.10.0-514.el7 will be updated
---> Package kernel-tools.x86_64 0:3.10.0-514.26.1.el7 will be an update
---> Package kernel-tools-libs.x86_64 0:3.10.0-514.el7 will be updated
---> Package kernel-tools-libs.x86_64 0:3.10.0-514.26.1.el7 will be an update
---> Package kpartx.x86_64 0:0.4.9-99.el7 will be updated
---> Package kpartx.x86_64 0:0.4.9-99.el7_3.3 will be an update
---> Package krb5-libs.x86_64 0:1.14.1-26.el7 will be updated
---> Package krb5-libs.x86_64 0:1.14.1-27.el7_3 will be an update
---> Package libblkid.x86_64 0:2.23.2-33.el7 will be updated
---> Package libblkid.x86_64 0:2.23.2-33.el7_3.2 will be an update
---> Package libgcrypt.x86_64 0:1.5.3-12.el7_1.1 will be updated
---> Package libgcrypt.x86_64 0:1.5.3-13.el7_3.1 will be an update
---> Package libgudev1.x86_64 0:219-30.el7 will be updated
---> Package libgudev1.x86_64 0:219-30.el7_3.9 will be an update
---> Package libmount.x86_64 0:2.23.2-33.el7 will be updated
---> Package libmount.x86_64 0:2.23.2-33.el7_3.2 will be an update
---> Package libnetfilter_conntrack.x86_64 0:1.0.4-2.el7 will be updated
---> Package libnetfilter_conntrack.x86_64 0:1.0.6-1.el7_3 will be an update
---> Package libnl3.x86_64 0:3.2.28-2.el7 will be updated
---> Package libnl3.x86_64 0:3.2.28-3.el7_3 will be an update
---> Package libnl3-cli.x86_64 0:3.2.28-2.el7 will be updated
---> Package libnl3-cli.x86_64 0:3.2.28-3.el7_3 will be an update
---> Package libpciaccess.x86_64 0:0.13.4-2.el7 will be updated
---> Package libpciaccess.x86_64 0:0.13.4-3.el7_3 will be an update
---> Package libsemanage.x86_64 0:2.5-4.el7 will be updated
---> Package libsemanage.x86_64 0:2.5-5.1.el7_3 will be an update
---> Package libuuid.x86_64 0:2.23.2-33.el7 will be updated
---> Package libuuid.x86_64 0:2.23.2-33.el7_3.2 will be an update
---> Package lvm2.x86_64 7:2.02.166-1.el7 will be updated
---> Package lvm2.x86_64 7:2.02.166-1.el7_3.5 will be an update
---> Package lvm2-libs.x86_64 7:2.02.166-1.el7 will be updated
---> Package lvm2-libs.x86_64 7:2.02.166-1.el7_3.5 will be an update
---> Package microcode_ctl.x86_64 2:2.1-16.el7 will be updated
---> Package microcode_ctl.x86_64 2:2.1-16.3.el7_3 will be an update
---> Package nspr.x86_64 0:4.11.0-1.el7_2 will be updated
---> Package nspr.x86_64 0:4.13.1-1.0.el7_3 will be an update
---> Package nss.x86_64 0:3.21.0-17.el7 will be updated
---> Package nss.x86_64 0:3.28.4-1.2.el7_3 will be an update
---> Package nss-sysinit.x86_64 0:3.21.0-17.el7 will be updated
---> Package nss-sysinit.x86_64 0:3.28.4-1.2.el7_3 will be an update
---> Package nss-tools.x86_64 0:3.21.0-17.el7 will be updated
---> Package nss-tools.x86_64 0:3.28.4-1.2.el7_3 will be an update
---> Package nss-util.x86_64 0:3.21.0-2.2.el7_2 will be updated
---> Package nss-util.x86_64 0:3.28.4-1.0.el7_3 will be an update
---> Package openssh.x86_64 0:6.6.1p1-31.el7 will be updated
---> Package openssh.x86_64 0:6.6.1p1-35.el7_3 will be an update
---> Package openssh-clients.x86_64 0:6.6.1p1-31.el7 will be updated
---> Package openssh-clients.x86_64 0:6.6.1p1-35.el7_3 will be an update
---> Package openssh-server.x86_64 0:6.6.1p1-31.el7 will be updated
---> Package openssh-server.x86_64 0:6.6.1p1-35.el7_3 will be an update
---> Package openssl.x86_64 1:1.0.1e-60.el7 will be updated
---> Package openssl.x86_64 1:1.0.1e-60.el7_3.1 will be an update
---> Package openssl-libs.x86_64 1:1.0.1e-60.el7 will be updated
---> Package openssl-libs.x86_64 1:1.0.1e-60.el7_3.1 will be an update
---> Package policycoreutils.x86_64 0:2.5-8.el7 will be updated
---> Package policycoreutils.x86_64 0:2.5-11.el7_3 will be an update
---> Package polkit.x86_64 0:0.112-9.el7 will be updated
---> Package polkit.x86_64 0:0.112-12.el7_3 will be an update
---> Package python-firewall.noarch 0:0.4.3.2-8.el7 will be updated
---> Package python-firewall.noarch 0:0.4.3.2-8.1.el7_3.3 will be an update
---> Package python-perf.x86_64 0:3.10.0-514.el7 will be updated
---> Package python-perf.x86_64 0:3.10.0-514.26.1.el7 will be an update
---> Package rdma.noarch 0:7.3_4.7_rc2-5.el7 will be updated
---> Package rdma.noarch 0:7.3_4.7_rc2-6.el7_3 will be an update
---> Package selinux-policy.noarch 0:3.13.1-102.el7 will be updated
---> Package selinux-policy.noarch 0:3.13.1-102.el7_3.16 will be an update
---> Package selinux-policy-targeted.noarch 0:3.13.1-102.el7 will be updated
---> Package selinux-policy-targeted.noarch 0:3.13.1-102.el7_3.16 will be an update
---> Package sudo.x86_64 0:1.8.6p7-20.el7 will be updated
---> Package sudo.x86_64 0:1.8.6p7-23.el7_3 will be an update
---> Package systemd.x86_64 0:219-30.el7 will be updated
---> Package systemd.x86_64 0:219-30.el7_3.9 will be an update
---> Package systemd-libs.x86_64 0:219-30.el7 will be updated
---> Package systemd-libs.x86_64 0:219-30.el7_3.9 will be an update
---> Package systemd-sysv.x86_64 0:219-30.el7 will be updated
---> Package systemd-sysv.x86_64 0:219-30.el7_3.9 will be an update
---> Package tuned.noarch 0:2.7.1-3.el7 will be updated
---> Package tuned.noarch 0:2.7.1-3.el7_3.2 will be an update
---> Package tzdata.noarch 0:2016g-2.el7 will be updated
---> Package tzdata.noarch 0:2017b-1.el7 will be an update
---> Package util-linux.x86_64 0:2.23.2-33.el7 will be updated
---> Package util-linux.x86_64 0:2.23.2-33.el7_3.2 will be an update
---> Package vim-minimal.x86_64 2:7.4.160-1.el7 will be updated
---> Package vim-minimal.x86_64 2:7.4.160-1.el7_3.1 will be an update
---> Package wpa_supplicant.x86_64 1:2.0-20.el7 will be updated
---> Package wpa_supplicant.x86_64 1:2.0-21.el7_3 will be an update
---> Package xfsprogs.x86_64 0:4.5.0-8.el7 will be updated
---> Package xfsprogs.x86_64 0:4.5.0-10.el7_3 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
kernel x86_64 3.10.0-514.26.1.el7 updates 37 M
Updating:
NetworkManager x86_64 1:1.4.0-20.el7_3 updates 2.5 M
NetworkManager-libnm x86_64 1:1.4.0-20.el7_3 updates 443 k
NetworkManager-team x86_64 1:1.4.0-20.el7_3 updates 147 k
NetworkManager-tui x86_64 1:1.4.0-20.el7_3 updates 224 k
NetworkManager-wifi x86_64 1:1.4.0-20.el7_3 updates 176 k
audit x86_64 2.6.5-3.el7_3.1 updates 233 k
audit-libs x86_64 2.6.5-3.el7_3.1 updates 85 k
bash x86_64 4.2.46-21.el7_3 updates 1.0 M
ca-certificates noarch 2017.2.14-70.1.el7_3 updates 438 k
chkconfig x86_64 1.7.2-1.el7_3.1 updates 175 k
chrony x86_64 2.1.1-4.el7.centos updates 281 k
device-mapper x86_64 7:1.02.135-1.el7_3.5 updates 269 k
device-mapper-event x86_64 7:1.02.135-1.el7_3.5 updates 178 k
device-mapper-event-libs x86_64 7:1.02.135-1.el7_3.5 updates 177 k
device-mapper-libs x86_64 7:1.02.135-1.el7_3.5 updates 333 k
dmidecode x86_64 1:3.0-2.1.el7_3 updates 83 k
dracut x86_64 033-463.el7_3.2 updates 318 k
dracut-config-rescue x86_64 033-463.el7_3.2 updates 54 k
dracut-network x86_64 033-463.el7_3.2 updates 96 k
expat x86_64 2.1.0-10.el7_3 updates 81 k
firewalld noarch 0.4.3.2-8.1.el7_3.3 updates 386 k
firewalld-filesystem noarch 0.4.3.2-8.1.el7_3.3 updates 45 k
gawk x86_64 4.0.2-4.el7_3.1 updates 874 k
glibc x86_64 2.17-157.el7_3.4 updates 3.6 M
glibc-common x86_64 2.17-157.el7_3.4 updates 11 M
grubby x86_64 8.28-21.el7_3 updates 70 k
initscripts x86_64 9.49.37-1.el7_3.1 updates 432 k
irqbalance x86_64 3:1.0.7-6.el7_3.1 updates 44 k
kernel-tools x86_64 3.10.0-514.26.1.el7 updates 4.0 M
kernel-tools-libs x86_64 3.10.0-514.26.1.el7 updates 3.9 M
kpartx x86_64 0.4.9-99.el7_3.3 updates 68 k
krb5-libs x86_64 1.14.1-27.el7_3 updates 740 k
libblkid x86_64 2.23.2-33.el7_3.2 updates 170 k
libgcrypt x86_64 1.5.3-13.el7_3.1 updates 263 k
libgudev1 x86_64 219-30.el7_3.9 updates 77 k
libmount x86_64 2.23.2-33.el7_3.2 updates 172 k
libnetfilter_conntrack x86_64 1.0.6-1.el7_3 updates 55 k
libnl3 x86_64 3.2.28-3.el7_3 updates 278 k
libnl3-cli x86_64 3.2.28-3.el7_3 updates 160 k
libpciaccess x86_64 0.13.4-3.el7_3 updates 26 k
libsemanage x86_64 2.5-5.1.el7_3 updates 144 k
libuuid x86_64 2.23.2-33.el7_3.2 updates 76 k
lvm2 x86_64 7:2.02.166-1.el7_3.5 updates 1.1 M
lvm2-libs x86_64 7:2.02.166-1.el7_3.5 updates 987 k
microcode_ctl x86_64 2:2.1-16.3.el7_3 updates 745 k
nspr x86_64 4.13.1-1.0.el7_3 updates 126 k
nss x86_64 3.28.4-1.2.el7_3 updates 872 k
nss-sysinit x86_64 3.28.4-1.2.el7_3 updates 58 k
nss-tools x86_64 3.28.4-1.2.el7_3 updates 496 k
nss-util x86_64 3.28.4-1.0.el7_3 updates 73 k
openssh x86_64 6.6.1p1-35.el7_3 updates 438 k
openssh-clients x86_64 6.6.1p1-35.el7_3 updates 642 k
openssh-server x86_64 6.6.1p1-35.el7_3 updates 440 k
openssl x86_64 1:1.0.1e-60.el7_3.1 updates 713 k
openssl-libs x86_64 1:1.0.1e-60.el7_3.1 updates 959 k
policycoreutils x86_64 2.5-11.el7_3 updates 841 k
polkit x86_64 0.112-12.el7_3 updates 167 k
python-firewall noarch 0.4.3.2-8.1.el7_3.3 updates 301 k
python-perf x86_64 3.10.0-514.26.1.el7 updates 4.0 M
rdma noarch 7.3_4.7_rc2-6.el7_3 updates 30 k
selinux-policy noarch 3.13.1-102.el7_3.16 updates 414 k
selinux-policy-targeted noarch 3.13.1-102.el7_3.16 updates 6.4 M
sudo x86_64 1.8.6p7-23.el7_3 updates 735 k
systemd x86_64 219-30.el7_3.9 updates 5.2 M
systemd-libs x86_64 219-30.el7_3.9 updates 369 k
systemd-sysv x86_64 219-30.el7_3.9 updates 64 k
tuned noarch 2.7.1-3.el7_3.2 updates 210 k
tzdata noarch 2017b-1.el7 updates 443 k
util-linux x86_64 2.23.2-33.el7_3.2 updates 1.9 M
vim-minimal x86_64 2:7.4.160-1.el7_3.1 updates 436 k
wpa_supplicant x86_64 1:2.0-21.el7_3 updates 788 k
xfsprogs x86_64 4.5.0-10.el7_3 updates 895 k
Transaction Summary
================================================================================
Install 1 Package
Upgrade 72 Packages
Total download size: 102 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
--------------------------------------------------------------------------------
Total 15 MB/s | 102 MB 00:06
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating : tzdata-2017b-1.el7.noarch 1/145
Updating : glibc-2.17-157.el7_3.4.x86_64 2/145
warning: /etc/nsswitch.conf created as /etc/nsswitch.conf.rpmnew
Updating : bash-4.2.46-21.el7_3.x86_64 3/145
Updating : glibc-common-2.17-157.el7_3.4.x86_64 4/145
Updating : audit-libs-2.6.5-3.el7_3.1.x86_64 5/145
Updating : nspr-4.13.1-1.0.el7_3.x86_64 6/145
Updating : libuuid-2.23.2-33.el7_3.2.x86_64 7/145
Updating : libblkid-2.23.2-33.el7_3.2.x86_64 8/145
Updating : nss-util-3.28.4-1.0.el7_3.x86_64 9/145
Updating : gawk-4.0.2-4.el7_3.1.x86_64 10/145
Updating : chkconfig-1.7.2-1.el7_3.1.x86_64 11/145
Updating : nss-3.28.4-1.2.el7_3.x86_64 12/145
Updating : nss-sysinit-3.28.4-1.2.el7_3.x86_64 13/145
Updating : libnl3-3.2.28-3.el7_3.x86_64 14/145
Updating : libgcrypt-1.5.3-13.el7_3.1.x86_64 15/145
Updating : systemd-libs-219-30.el7_3.9.x86_64 16/145
Updating : libgudev1-219-30.el7_3.9.x86_64 17/145
Updating : 1:NetworkManager-libnm-1.4.0-20.el7_3.x86_64 18/145
Updating : libmount-2.23.2-33.el7_3.2.x86_64 19/145
Updating : systemd-219-30.el7_3.9.x86_64 20/145
Updating : util-linux-2.23.2-33.el7_3.2.x86_64 21/145
Updating : 7:device-mapper-libs-1.02.135-1.el7_3.5.x86_64 22/145
Updating : 7:device-mapper-1.02.135-1.el7_3.5.x86_64 23/145
Updating : 7:device-mapper-event-libs-1.02.135-1.el7_3.5.x86_64 24/145
Updating : systemd-sysv-219-30.el7_3.9.x86_64 25/145
Updating : libsemanage-2.5-5.1.el7_3.x86_64 26/145
Updating : policycoreutils-2.5-11.el7_3.x86_64 27/145
Updating : selinux-policy-3.13.1-102.el7_3.16.noarch 28/145
Updating : 7:device-mapper-event-1.02.135-1.el7_3.5.x86_64 29/145
Updating : 7:lvm2-libs-2.02.166-1.el7_3.5.x86_64 30/145
Updating : kpartx-0.4.9-99.el7_3.3.x86_64 31/145
Updating : dracut-033-463.el7_3.2.x86_64 32/145
Updating : initscripts-9.49.37-1.el7_3.1.x86_64 33/145
Updating : grubby-8.28-21.el7_3.x86_64 34/145
Updating : ca-certificates-2017.2.14-70.1.el7_3.noarch 35/145
Updating : krb5-libs-1.14.1-27.el7_3.x86_64 36/145
Updating : 1:openssl-libs-1.0.1e-60.el7_3.1.x86_64 37/145
Updating : openssh-6.6.1p1-35.el7_3.x86_64 38/145
Updating : 1:wpa_supplicant-2.0-21.el7_3.x86_64 39/145
Updating : 2:vim-minimal-7.4.160-1.el7_3.1.x86_64 40/145
Updating : kernel-tools-libs-3.10.0-514.26.1.el7.x86_64 41/145
Updating : python-perf-3.10.0-514.26.1.el7.x86_64 42/145
Updating : expat-2.1.0-10.el7_3.x86_64 43/145
Updating : polkit-0.112-12.el7_3.x86_64 44/145
Updating : 1:NetworkManager-1.4.0-20.el7_3.x86_64 45/145
Updating : firewalld-filesystem-0.4.3.2-8.1.el7_3.3.noarch 46/145
Updating : python-firewall-0.4.3.2-8.1.el7_3.3.noarch 47/145
Updating : firewalld-0.4.3.2-8.1.el7_3.3.noarch 48/145
Updating : 1:NetworkManager-team-1.4.0-20.el7_3.x86_64 49/145
Updating : 1:NetworkManager-wifi-1.4.0-20.el7_3.x86_64 50/145
Updating : 1:NetworkManager-tui-1.4.0-20.el7_3.x86_64 51/145
Updating : tuned-2.7.1-3.el7_3.2.noarch 52/145
Updating : kernel-tools-3.10.0-514.26.1.el7.x86_64 53/145
Updating : sudo-1.8.6p7-23.el7_3.x86_64 54/145
Updating : openssh-server-6.6.1p1-35.el7_3.x86_64 55/145
Updating : openssh-clients-6.6.1p1-35.el7_3.x86_64 56/145
Updating : 1:openssl-1.0.1e-60.el7_3.1.x86_64 57/145
Updating : audit-2.6.5-3.el7_3.1.x86_64 58/145
Installing : kernel-3.10.0-514.26.1.el7.x86_64 59/145
Updating : rdma-7.3_4.7_rc2-6.el7_3.noarch 60/145
Updating : dracut-network-033-463.el7_3.2.x86_64 61/145
Updating : dracut-config-rescue-033-463.el7_3.2.x86_64 62/145
Updating : 7:lvm2-2.02.166-1.el7_3.5.x86_64 63/145
Updating : selinux-policy-targeted-3.13.1-102.el7_3.16.noarch 64/145
Updating : 3:irqbalance-1.0.7-6.el7_3.1.x86_64 65/145
Updating : chrony-2.1.1-4.el7.centos.x86_64 66/145
Updating : 2:microcode_ctl-2.1-16.3.el7_3.x86_64 67/145
Updating : libnl3-cli-3.2.28-3.el7_3.x86_64 68/145
Updating : nss-tools-3.28.4-1.2.el7_3.x86_64 69/145
Updating : xfsprogs-4.5.0-10.el7_3.x86_64 70/145
Updating : libpciaccess-0.13.4-3.el7_3.x86_64 71/145
Updating : libnetfilter_conntrack-1.0.6-1.el7_3.x86_64 72/145
Updating : 1:dmidecode-3.0-2.1.el7_3.x86_64 73/145
Cleanup : 1:NetworkManager-tui-1.4.0-12.el7.x86_64 74/145
Cleanup : 7:lvm2-2.02.166-1.el7.x86_64 75/145
Cleanup : openssh-server-6.6.1p1-31.el7.x86_64 76/145
Cleanup : 7:lvm2-libs-2.02.166-1.el7.x86_64 77/145
Cleanup : audit-2.6.5-3.el7.x86_64 78/145
Cleanup : 7:device-mapper-event-1.02.135-1.el7.x86_64 79/145
Cleanup : nss-tools-3.21.0-17.el7.x86_64 80/145
Cleanup : openssh-clients-6.6.1p1-31.el7.x86_64 81/145
Cleanup : tuned-2.7.1-3.el7.noarch 82/145
Cleanup : initscripts-9.49.37-1.el7.x86_64 83/145
Cleanup : 1:openssl-1.0.1e-60.el7.x86_64 84/145
Cleanup : openssh-6.6.1p1-31.el7.x86_64 85/145
Cleanup : sudo-1.8.6p7-20.el7.x86_64 86/145
Cleanup : xfsprogs-4.5.0-8.el7.x86_64 87/145
Cleanup : kernel-tools-3.10.0-514.el7.x86_64 88/145
Cleanup : 1:NetworkManager-wifi-1.4.0-12.el7.x86_64 89/145
Cleanup : firewalld-0.4.3.2-8.el7.noarch 90/145
Cleanup : 1:NetworkManager-team-1.4.0-12.el7.x86_64 91/145
Cleanup : selinux-policy-targeted-3.13.1-102.el7.noarch 92/145
Cleanup : selinux-policy-3.13.1-102.el7.noarch 93/145
Cleanup : rdma-7.3_4.7_rc2-5.el7.noarch 94/145
Cleanup : 1:NetworkManager-1.4.0-12.el7.x86_64 95/145
Cleanup : 1:NetworkManager-libnm-1.4.0-12.el7.x86_64 96/145
Cleanup : nss-sysinit-3.21.0-17.el7.x86_64 97/145
Cleanup : nss-3.21.0-17.el7.x86_64 98/145
Cleanup : 1:wpa_supplicant-2.0-20.el7.x86_64 99/145
Cleanup : polkit-0.112-9.el7.x86_64 100/145
Cleanup : policycoreutils-2.5-8.el7.x86_64 101/145
Cleanup : krb5-libs-1.14.1-26.el7.x86_64 102/145
Cleanup : 1:openssl-libs-1.0.1e-60.el7.x86_64 103/145
Cleanup : nss-util-3.21.0-2.2.el7_2.x86_64 104/145
Cleanup : libgudev1-219-30.el7.x86_64 105/145
Cleanup : libsemanage-2.5-4.el7.x86_64 106/145
Cleanup : 7:device-mapper-event-libs-1.02.135-1.el7.x86_64 107/145
Cleanup : grubby-8.28-18.el7.x86_64 108/145
Cleanup : libnl3-cli-3.2.28-2.el7.x86_64 109/145
Cleanup : 2:microcode_ctl-2.1-16.el7.x86_64 110/145
Cleanup : chrony-2.1.1-3.el7.centos.x86_64 111/145
Cleanup : 3:irqbalance-1.0.7-6.el7.x86_64 112/145
Cleanup : dracut-config-rescue-033-463.el7.x86_64 113/145
Cleanup : dracut-network-033-463.el7.x86_64 114/145
Cleanup : ca-certificates-2015.2.6-73.el7.noarch 115/145
Cleanup : systemd-sysv-219-30.el7.x86_64 116/145
Cleanup : dracut-033-463.el7.x86_64 117/145
Cleanup : kpartx-0.4.9-99.el7.x86_64 118/145
Cleanup : 7:device-mapper-1.02.135-1.el7.x86_64 119/145
Cleanup : 7:device-mapper-libs-1.02.135-1.el7.x86_64 120/145
Cleanup : systemd-219-30.el7.x86_64 121/145
Cleanup : util-linux-2.23.2-33.el7.x86_64 122/145
Cleanup : libmount-2.23.2-33.el7.x86_64 123/145
Cleanup : libblkid-2.23.2-33.el7.x86_64 124/145
Cleanup : systemd-libs-219-30.el7.x86_64 125/145
Cleanup : gawk-4.0.2-4.el7.x86_64 126/145
Cleanup : libgcrypt-1.5.3-12.el7_1.1.x86_64 127/145
Cleanup : libuuid-2.23.2-33.el7.x86_64 128/145
Cleanup : audit-libs-2.6.5-3.el7.x86_64 129/145
Cleanup : libnl3-3.2.28-2.el7.x86_64 130/145
Cleanup : nspr-4.11.0-1.el7_2.x86_64 131/145
Cleanup : expat-2.1.0-8.el7.x86_64 132/145
Cleanup : chkconfig-1.7.2-1.el7.x86_64 133/145
Cleanup : kernel-tools-libs-3.10.0-514.el7.x86_64 134/145
Cleanup : 2:vim-minimal-7.4.160-1.el7.x86_64 135/145
Cleanup : python-perf-3.10.0-514.el7.x86_64 136/145
Cleanup : 1:dmidecode-3.0-2.el7.x86_64 137/145
Cleanup : libnetfilter_conntrack-1.0.4-2.el7.x86_64 138/145
Cleanup : libpciaccess-0.13.4-2.el7.x86_64 139/145
Cleanup : firewalld-filesystem-0.4.3.2-8.el7.noarch 140/145
Cleanup : python-firewall-0.4.3.2-8.el7.noarch 141/145
Cleanup : bash-4.2.46-20.el7_2.x86_64 142/145
Cleanup : glibc-common-2.17-157.el7.x86_64 143/145
Cleanup : glibc-2.17-157.el7.x86_64 144/145
Cleanup : tzdata-2016g-2.el7.noarch 145/145
Verifying : python-firewall-0.4.3.2-8.1.el7_3.3.noarch 1/145
Verifying : nspr-4.13.1-1.0.el7_3.x86_64 2/145
Verifying : nss-3.28.4-1.2.el7_3.x86_64 3/145
Verifying : selinux-policy-3.13.1-102.el7_3.16.noarch 4/145
Verifying : openssh-server-6.6.1p1-35.el7_3.x86_64 5/145
Verifying : 7:device-mapper-event-1.02.135-1.el7_3.5.x86_64 6/145
Verifying : nss-util-3.28.4-1.0.el7_3.x86_64 7/145
Verifying : audit-2.6.5-3.el7_3.1.x86_64 8/145
Verifying : 1:NetworkManager-team-1.4.0-20.el7_3.x86_64 9/145
Verifying : rdma-7.3_4.7_rc2-6.el7_3.noarch 10/145
Verifying : bash-4.2.46-21.el7_3.x86_64 11/145
Verifying : 1:NetworkManager-libnm-1.4.0-20.el7_3.x86_64 12/145
Verifying : libgudev1-219-30.el7_3.9.x86_64 13/145
Verifying : selinux-policy-targeted-3.13.1-102.el7_3.16.noarch 14/145
Verifying : 3:irqbalance-1.0.7-6.el7_3.1.x86_64 15/145
Verifying : firewalld-filesystem-0.4.3.2-8.1.el7_3.3.noarch 16/145
Verifying : 7:device-mapper-1.02.135-1.el7_3.5.x86_64 17/145
Verifying : tzdata-2017b-1.el7.noarch 18/145
Verifying : openssh-6.6.1p1-35.el7_3.x86_64 19/145
Verifying : openssh-clients-6.6.1p1-35.el7_3.x86_64 20/145
Verifying : glibc-2.17-157.el7_3.4.x86_64 21/145
Verifying : 7:device-mapper-libs-1.02.135-1.el7_3.5.x86_64 22/145
Verifying : polkit-0.112-12.el7_3.x86_64 23/145
Verifying : 1:NetworkManager-wifi-1.4.0-20.el7_3.x86_64 24/145
Verifying : nss-sysinit-3.28.4-1.2.el7_3.x86_64 25/145
Verifying : systemd-219-30.el7_3.9.x86_64 26/145
Verifying : glibc-common-2.17-157.el7_3.4.x86_64 27/145
Verifying : libmount-2.23.2-33.el7_3.2.x86_64 28/145
Verifying : 1:openssl-libs-1.0.1e-60.el7_3.1.x86_64 29/145
Verifying : util-linux-2.23.2-33.el7_3.2.x86_64 30/145
Verifying : chrony-2.1.1-4.el7.centos.x86_64 31/145
Verifying : libpciaccess-0.13.4-3.el7_3.x86_64 32/145
Verifying : dracut-033-463.el7_3.2.x86_64 33/145
Verifying : xfsprogs-4.5.0-10.el7_3.x86_64 34/145
Verifying : systemd-libs-219-30.el7_3.9.x86_64 35/145
Verifying : 1:wpa_supplicant-2.0-21.el7_3.x86_64 36/145
Verifying : firewalld-0.4.3.2-8.1.el7_3.3.noarch 37/145
Verifying : libnl3-3.2.28-3.el7_3.x86_64 38/145
Verifying : 2:microcode_ctl-2.1-16.3.el7_3.x86_64 39/145
Verifying : 2:vim-minimal-7.4.160-1.el7_3.1.x86_64 40/145
Verifying : libnl3-cli-3.2.28-3.el7_3.x86_64 41/145
Verifying : nss-tools-3.28.4-1.2.el7_3.x86_64 42/145
Verifying : tuned-2.7.1-3.el7_3.2.noarch 43/145
Verifying : dracut-network-033-463.el7_3.2.x86_64 44/145
Verifying : gawk-4.0.2-4.el7_3.1.x86_64 45/145
Verifying : kernel-3.10.0-514.26.1.el7.x86_64 46/145
Verifying : policycoreutils-2.5-11.el7_3.x86_64 47/145
Verifying : 7:lvm2-libs-2.02.166-1.el7_3.5.x86_64 48/145
Verifying : kernel-tools-libs-3.10.0-514.26.1.el7.x86_64 49/145
Verifying : sudo-1.8.6p7-23.el7_3.x86_64 50/145
Verifying : libuuid-2.23.2-33.el7_3.2.x86_64 51/145
Verifying : audit-libs-2.6.5-3.el7_3.1.x86_64 52/145
Verifying : python-perf-3.10.0-514.26.1.el7.x86_64 53/145
Verifying : expat-2.1.0-10.el7_3.x86_64 54/145
Verifying : 1:openssl-1.0.1e-60.el7_3.1.x86_64 55/145
Verifying : libnetfilter_conntrack-1.0.6-1.el7_3.x86_64 56/145
Verifying : chkconfig-1.7.2-1.el7_3.1.x86_64 57/145
Verifying : 1:NetworkManager-1.4.0-20.el7_3.x86_64 58/145
Verifying : krb5-libs-1.14.1-27.el7_3.x86_64 59/145
Verifying : libblkid-2.23.2-33.el7_3.2.x86_64 60/145
Verifying : libgcrypt-1.5.3-13.el7_3.1.x86_64 61/145
Verifying : ca-certificates-2017.2.14-70.1.el7_3.noarch 62/145
Verifying : initscripts-9.49.37-1.el7_3.1.x86_64 63/145
Verifying : grubby-8.28-21.el7_3.x86_64 64/145
Verifying : kpartx-0.4.9-99.el7_3.3.x86_64 65/145
Verifying : kernel-tools-3.10.0-514.26.1.el7.x86_64 66/145
Verifying : libsemanage-2.5-5.1.el7_3.x86_64 67/145
Verifying : 1:NetworkManager-tui-1.4.0-20.el7_3.x86_64 68/145
Verifying : dracut-config-rescue-033-463.el7_3.2.x86_64 69/145
Verifying : systemd-sysv-219-30.el7_3.9.x86_64 70/145
Verifying : 1:dmidecode-3.0-2.1.el7_3.x86_64 71/145
Verifying : 7:device-mapper-event-libs-1.02.135-1.el7_3.5.x86_64 72/145
Verifying : 7:lvm2-2.02.166-1.el7_3.5.x86_64 73/145
Verifying : 3:irqbalance-1.0.7-6.el7.x86_64 74/145
Verifying : nspr-4.11.0-1.el7_2.x86_64 75/145
Verifying : 1:openssl-libs-1.0.1e-60.el7.x86_64 76/145
Verifying : audit-libs-2.6.5-3.el7.x86_64 77/145
Verifying : dracut-033-463.el7.x86_64 78/145
Verifying : firewalld-filesystem-0.4.3.2-8.el7.noarch 79/145
Verifying : openssh-server-6.6.1p1-31.el7.x86_64 80/145
Verifying : libmount-2.23.2-33.el7.x86_64 81/145
Verifying : 1:openssl-1.0.1e-60.el7.x86_64 82/145
Verifying : libuuid-2.23.2-33.el7.x86_64 83/145
Verifying : gawk-4.0.2-4.el7.x86_64 84/145
Verifying : nss-util-3.21.0-2.2.el7_2.x86_64 85/145
Verifying : 1:NetworkManager-team-1.4.0-12.el7.x86_64 86/145
Verifying : 1:wpa_supplicant-2.0-20.el7.x86_64 87/145
Verifying : selinux-policy-targeted-3.13.1-102.el7.noarch 88/145
Verifying : libnl3-cli-3.2.28-2.el7.x86_64 89/145
Verifying : 1:NetworkManager-1.4.0-12.el7.x86_64 90/145
Verifying : openssh-6.6.1p1-31.el7.x86_64 91/145
Verifying : ca-certificates-2015.2.6-73.el7.noarch 92/145
Verifying : krb5-libs-1.14.1-26.el7.x86_64 93/145
Verifying : policycoreutils-2.5-8.el7.x86_64 94/145
Verifying : xfsprogs-4.5.0-8.el7.x86_64 95/145
Verifying : firewalld-0.4.3.2-8.el7.noarch 96/145
Verifying : nss-sysinit-3.21.0-17.el7.x86_64 97/145
Verifying : nss-3.21.0-17.el7.x86_64 98/145
Verifying : tzdata-2016g-2.el7.noarch 99/145
Verifying : 7:device-mapper-libs-1.02.135-1.el7.x86_64 100/145
Verifying : libnl3-3.2.28-2.el7.x86_64 101/145
Verifying : 7:lvm2-libs-2.02.166-1.el7.x86_64 102/145
Verifying : systemd-219-30.el7.x86_64 103/145
Verifying : kernel-tools-libs-3.10.0-514.el7.x86_64 104/145
Verifying : bash-4.2.46-20.el7_2.x86_64 105/145
Verifying : util-linux-2.23.2-33.el7.x86_64 106/145
Verifying : nss-tools-3.21.0-17.el7.x86_64 107/145
Verifying : 7:device-mapper-1.02.135-1.el7.x86_64 108/145
Verifying : grubby-8.28-18.el7.x86_64 109/145
Verifying : kernel-tools-3.10.0-514.el7.x86_64 110/145
Verifying : libnetfilter_conntrack-1.0.4-2.el7.x86_64 111/145
Verifying : expat-2.1.0-8.el7.x86_64 112/145
Verifying : polkit-0.112-9.el7.x86_64 113/145
Verifying : 1:dmidecode-3.0-2.el7.x86_64 114/145
Verifying : 2:vim-minimal-7.4.160-1.el7.x86_64 115/145
Verifying : libgudev1-219-30.el7.x86_64 116/145
Verifying : openssh-clients-6.6.1p1-31.el7.x86_64 117/145
Verifying : libgcrypt-1.5.3-12.el7_1.1.x86_64 118/145
Verifying : 7:device-mapper-event-libs-1.02.135-1.el7.x86_64 119/145
Verifying : 7:lvm2-2.02.166-1.el7.x86_64 120/145
Verifying : dracut-config-rescue-033-463.el7.x86_64 121/145
Verifying : kpartx-0.4.9-99.el7.x86_64 122/145
Verifying : tuned-2.7.1-3.el7.noarch 123/145
Verifying : sudo-1.8.6p7-20.el7.x86_64 124/145
Verifying : systemd-sysv-219-30.el7.x86_64 125/145
Verifying : selinux-policy-3.13.1-102.el7.noarch 126/145
Verifying : glibc-common-2.17-157.el7.x86_64 127/145
Verifying : libpciaccess-0.13.4-2.el7.x86_64 128/145
Verifying : initscripts-9.49.37-1.el7.x86_64 129/145
Verifying : python-firewall-0.4.3.2-8.el7.noarch 130/145
Verifying : chkconfig-1.7.2-1.el7.x86_64 131/145
Verifying : dracut-network-033-463.el7.x86_64 132/145
Verifying : audit-2.6.5-3.el7.x86_64 133/145
Verifying : chrony-2.1.1-3.el7.centos.x86_64 134/145
Verifying : 1:NetworkManager-tui-1.4.0-12.el7.x86_64 135/145
Verifying : 1:NetworkManager-libnm-1.4.0-12.el7.x86_64 136/145
Verifying : libsemanage-2.5-4.el7.x86_64 137/145
Verifying : rdma-7.3_4.7_rc2-5.el7.noarch 138/145
Verifying : systemd-libs-219-30.el7.x86_64 139/145
Verifying : libblkid-2.23.2-33.el7.x86_64 140/145
Verifying : 2:microcode_ctl-2.1-16.el7.x86_64 141/145
Verifying : glibc-2.17-157.el7.x86_64 142/145
Verifying : 1:NetworkManager-wifi-1.4.0-12.el7.x86_64 143/145
Verifying : 7:device-mapper-event-1.02.135-1.el7.x86_64 144/145
Verifying : python-perf-3.10.0-514.el7.x86_64 145/145
Installed:
kernel.x86_64 0:3.10.0-514.26.1.el7
Updated:
NetworkManager.x86_64 1:1.4.0-20.el7_3
NetworkManager-libnm.x86_64 1:1.4.0-20.el7_3
NetworkManager-team.x86_64 1:1.4.0-20.el7_3
NetworkManager-tui.x86_64 1:1.4.0-20.el7_3
NetworkManager-wifi.x86_64 1:1.4.0-20.el7_3
audit.x86_64 0:2.6.5-3.el7_3.1
audit-libs.x86_64 0:2.6.5-3.el7_3.1
bash.x86_64 0:4.2.46-21.el7_3
ca-certificates.noarch 0:2017.2.14-70.1.el7_3
chkconfig.x86_64 0:1.7.2-1.el7_3.1
chrony.x86_64 0:2.1.1-4.el7.centos
device-mapper.x86_64 7:1.02.135-1.el7_3.5
device-mapper-event.x86_64 7:1.02.135-1.el7_3.5
device-mapper-event-libs.x86_64 7:1.02.135-1.el7_3.5
device-mapper-libs.x86_64 7:1.02.135-1.el7_3.5
dmidecode.x86_64 1:3.0-2.1.el7_3
dracut.x86_64 0:033-463.el7_3.2
dracut-config-rescue.x86_64 0:033-463.el7_3.2
dracut-network.x86_64 0:033-463.el7_3.2
expat.x86_64 0:2.1.0-10.el7_3
firewalld.noarch 0:0.4.3.2-8.1.el7_3.3
firewalld-filesystem.noarch 0:0.4.3.2-8.1.el7_3.3
gawk.x86_64 0:4.0.2-4.el7_3.1
glibc.x86_64 0:2.17-157.el7_3.4
glibc-common.x86_64 0:2.17-157.el7_3.4
grubby.x86_64 0:8.28-21.el7_3
initscripts.x86_64 0:9.49.37-1.el7_3.1
irqbalance.x86_64 3:1.0.7-6.el7_3.1
kernel-tools.x86_64 0:3.10.0-514.26.1.el7
kernel-tools-libs.x86_64 0:3.10.0-514.26.1.el7
kpartx.x86_64 0:0.4.9-99.el7_3.3
krb5-libs.x86_64 0:1.14.1-27.el7_3
libblkid.x86_64 0:2.23.2-33.el7_3.2
libgcrypt.x86_64 0:1.5.3-13.el7_3.1
libgudev1.x86_64 0:219-30.el7_3.9
libmount.x86_64 0:2.23.2-33.el7_3.2
libnetfilter_conntrack.x86_64 0:1.0.6-1.el7_3
libnl3.x86_64 0:3.2.28-3.el7_3
libnl3-cli.x86_64 0:3.2.28-3.el7_3
libpciaccess.x86_64 0:0.13.4-3.el7_3
libsemanage.x86_64 0:2.5-5.1.el7_3
libuuid.x86_64 0:2.23.2-33.el7_3.2
lvm2.x86_64 7:2.02.166-1.el7_3.5
lvm2-libs.x86_64 7:2.02.166-1.el7_3.5
microcode_ctl.x86_64 2:2.1-16.3.el7_3
nspr.x86_64 0:4.13.1-1.0.el7_3
nss.x86_64 0:3.28.4-1.2.el7_3
nss-sysinit.x86_64 0:3.28.4-1.2.el7_3
nss-tools.x86_64 0:3.28.4-1.2.el7_3
nss-util.x86_64 0:3.28.4-1.0.el7_3
openssh.x86_64 0:6.6.1p1-35.el7_3
openssh-clients.x86_64 0:6.6.1p1-35.el7_3
openssh-server.x86_64 0:6.6.1p1-35.el7_3
openssl.x86_64 1:1.0.1e-60.el7_3.1
openssl-libs.x86_64 1:1.0.1e-60.el7_3.1
policycoreutils.x86_64 0:2.5-11.el7_3
polkit.x86_64 0:0.112-12.el7_3
python-firewall.noarch 0:0.4.3.2-8.1.el7_3.3
python-perf.x86_64 0:3.10.0-514.26.1.el7
rdma.noarch 0:7.3_4.7_rc2-6.el7_3
selinux-policy.noarch 0:3.13.1-102.el7_3.16
selinux-policy-targeted.noarch 0:3.13.1-102.el7_3.16
sudo.x86_64 0:1.8.6p7-23.el7_3
systemd.x86_64 0:219-30.el7_3.9
systemd-libs.x86_64 0:219-30.el7_3.9
systemd-sysv.x86_64 0:219-30.el7_3.9
tuned.noarch 0:2.7.1-3.el7_3.2
tzdata.noarch 0:2017b-1.el7
util-linux.x86_64 0:2.23.2-33.el7_3.2
vim-minimal.x86_64 2:7.4.160-1.el7_3.1
wpa_supplicant.x86_64 1:2.0-21.el7_3
xfsprogs.x86_64 0:4.5.0-10.el7_3
Complete!
Shutting Down VM: CentOS-7-x86_64-Minimal-1611
Giving VM: CentOS-7-x86_64-Minimal-1611 30 seconds to finish Shutting Down
Convert VM: CentOS-7-x86_64-Minimal-1611 back to template
Create new VM (Template): Copy Template Source: CentOS-7-x86_64-Minimal-1611 to New VM: CentOS-7-x86_64-Minimal-1611_copy
Change new VM to Template: CentOS-7-x86_64-Minimal-1611_copy
[End Batch - 07/03/2017 13:49:10]
</code></pre>
<span style="font-size: xx-small;">Formatted for web with <a href="http://codeformatter.blogspot.com/">http://codeformatter.blogspot.com/</a> </span><br />
<br />
Best of luck!</div>
</div>
Justin Bennetthttp://www.blogger.com/profile/08685325767450711504noreply@blogger.com0tag:blogger.com,1999:blog-8394280631537425165.post-88666882559862438912016-10-11T13:34:00.001-07:002016-10-11T13:48:47.170-07:00SCOM Agent HealthService Not StartingI have a few systems that developed an issue were the Microsoft Monitoring Agent service (HealthService), a System Center Operations Manager 2012 client agent service, would not start.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNBR6BFXqfTjIomRke21CfXCIveoQxrf6tRgmu-jMMtPN_T-0VAU2Pi3vCeBkMnnEQ6zDbSrq2Nz4gNaRod1SHtBlMMi9PhaSmlyT27xsgz0BS-ptdy-tqCMTzmOhqlVOtx1o3PE-Eml0/s1600/2016-10-10+14_29_40-remote2+-+MultiDesk.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNBR6BFXqfTjIomRke21CfXCIveoQxrf6tRgmu-jMMtPN_T-0VAU2Pi3vCeBkMnnEQ6zDbSrq2Nz4gNaRod1SHtBlMMi9PhaSmlyT27xsgz0BS-ptdy-tqCMTzmOhqlVOtx1o3PE-Eml0/s320/2016-10-10+14_29_40-remote2+-+MultiDesk.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">"Windows could not start the Microsoft Monitoring Agent on Local Computer. For more information, review System Event Log. If this is a non-Microsoft service, contact the service vendor, and refer to service-specific error code -2130771964"</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCYt9gewjxIu35jd-0Z3T_JjtwBJDTMAp_tfslRP3HbavdlvoTjjZNGX1CXmG_NnzcLLyjlVFiYVNmLu3JDjUnOUMAVxboKQTZ4sJfcxbS1nxDVL0NNRnEwns4IhYOWnQ5uq3bEbBPQyE/s1600/2016_10_10_14_16_21_remote2_MultiDesk.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="291" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCYt9gewjxIu35jd-0Z3T_JjtwBJDTMAp_tfslRP3HbavdlvoTjjZNGX1CXmG_NnzcLLyjlVFiYVNmLu3JDjUnOUMAVxboKQTZ4sJfcxbS1nxDVL0NNRnEwns4IhYOWnQ5uq3bEbBPQyE/s320/2016_10_10_14_16_21_remote2_MultiDesk.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">"The description for Event ID 7024 from source Service Control Manager cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer. If the event originated on another computer, the display information had to be saved with the event. The following information was included with the event: Microsoft Monitoring Agent %%2164195332
The locale specific resource for the desired message is not present"</td></tr>
</tbody></table>
<br />
There's a couple TechNet articles in regards to this service not starting (permissions on registry entries and folder permissions), but I couldn't find my exact issue.<br />
<a href="https://blogs.technet.microsoft.com/smsandmom/2008/04/30/opsmgr-2007-healthservice-service-fails-to-start-with-25362-warning/" target="_blank">https://blogs.technet.microsoft.com/smsandmom/2008/04/30/opsmgr-2007-healthservice-service-fails-to-start-with-25362-warning/</a><br />
<a href="https://blogs.technet.microsoft.com/henryzhu/2011/09/26/two-common-scom-agent-start-failure-issues/" target="_blank">https://blogs.technet.microsoft.com/henryzhu/2011/09/26/two-common-scom-agent-start-failure-issues/</a><br />
<a href="https://support.microsoft.com/en-us/kb/2288515" target="_blank">https://support.microsoft.com/en-us/kb/2288515</a><br />
<br />
I finally found the culprit in the Operations Manager Logs - it appeared to be a corrupt database issue.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsLnzq1TpgHa5snXFwyS6HvPy9eECK_aJ0SMccPbOVost-s6Mf0LmMsbQ7SDuEb4679PvcpE7w1mZ5q0EYgMY-MvznSlVc_Jzhvd0X8q6cB3C9ec-1RWUcdEQV_WV879nWIYdH2GPajUQ/s1600/2016_10_10_14_15_36_remote2_MultiDesk.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="236" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsLnzq1TpgHa5snXFwyS6HvPy9eECK_aJ0SMccPbOVost-s6Mf0LmMsbQ7SDuEb4679PvcpE7w1mZ5q0EYgMY-MvznSlVc_Jzhvd0X8q6cB3C9ec-1RWUcdEQV_WV879nWIYdH2GPajUQ/s320/2016_10_10_14_15_36_remote2_MultiDesk.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">"HealthService (4346) Health Service Store: Database recovery/restore failed with unexpected error -543."</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://4.bp.blogspot.com/-QNC31dl4SRM/V_1GYpwMD_I/AAAAAAAAHxg/Cr04YmiWk7wtNAvIyPMS1krsWiXGHuKGwCLcB/s1600/2016_10_10_14_15_23_Clipboard.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="174" src="https://4.bp.blogspot.com/-QNC31dl4SRM/V_1GYpwMD_I/AAAAAAAAHxg/Cr04YmiWk7wtNAvIyPMS1krsWiXGHuKGwCLcB/s320/2016_10_10_14_15_23_Clipboard.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">"HealthService (4364) Health Service Store: Database C:\Program Files\Microsoft Monitoring Agent\Agent\Health Service State\Health Service Store\HealthServiceStore.edb requires logfiles 1441-1443 (C:\Program Files\Microsoft Monitoring Agent\Agent\Health Service State\Health Service Store\edb005A1.log - C:\Program Files\Microsoft Monitoring Agent\Agent\Health Service State\Health Service Store\edb.log) in order to recover successfully. Recovery could only locate logfiles up to 1442 (C:\Program Files\Microsoft Monitoring Agent\Agent\Health Service State\Health Service Store\edb005A2.log)."</td></tr>
</tbody></table>
<br />
I found a non-official post that helped clear the database at systemcentercentral.com (<a href="http://www.systemcentercentral.com/flushing-the-health-service-and-state-and-cache/" target="_blank">http://www.systemcentercentral.com/flushing-the-health-service-and-state-and-cache/</a>)<br />
<br />
To resolve the issue:<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<ul>
</ul>
<ol>
<li>Move or Delete the database files located in "C:\Program Files\Microsoft Monitoring Agent\Agent\Health Service State\Health Service Store"<br /></li>
<li>Start the Microsoft Monitoring Agent service<br /><br />The database should be recreated if there's no other issues.</li>
</ol>
<ul>
</ul>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://1.bp.blogspot.com/-XmNjhn31jlU/V_1GcgsPG6I/AAAAAAAAHyI/AnXk8_Z2qNwZtFaByzV191ByC5NCVuPOQCEw/s1600/2016-10-10%2B14_19_06-Clipboard.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="187" src="https://1.bp.blogspot.com/-XmNjhn31jlU/V_1GcgsPG6I/AAAAAAAAHyI/AnXk8_Z2qNwZtFaByzV191ByC5NCVuPOQCEw/s320/2016-10-10%2B14_19_06-Clipboard.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Moving corrupt database to a new folder.</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://4.bp.blogspot.com/-Oiitx0_HakE/V_1Gde9qxJI/AAAAAAAAHyI/mlwmtHNoGeIi6eHrHcMrHaWXwGwkUvClwCEw/s1600/2016_10_10_14_19_32_remote2_MultiDesk.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="234" src="https://4.bp.blogspot.com/-Oiitx0_HakE/V_1Gde9qxJI/AAAAAAAAHyI/mlwmtHNoGeIi6eHrHcMrHaWXwGwkUvClwCEw/s320/2016_10_10_14_19_32_remote2_MultiDesk.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Microsoft Monitoring Agent service running after corrupt database was moved.</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://3.bp.blogspot.com/-ZO1icQUO_Fg/V_1M3NK_-ZI/AAAAAAAAHyQ/eRFM58JDd3cRxa9hCnGqFYFUJmcmUA0VgCLcB/s1600/tumblr_o4mmxsYoNb1rvp4o7o3_540.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="141" src="https://3.bp.blogspot.com/-ZO1icQUO_Fg/V_1M3NK_-ZI/AAAAAAAAHyQ/eRFM58JDd3cRxa9hCnGqFYFUJmcmUA0VgCLcB/s320/tumblr_o4mmxsYoNb1rvp4o7o3_540.gif" width="320" /></a></div>
<div>
<br /></div>
Justin Bennetthttp://www.blogger.com/profile/08685325767450711504noreply@blogger.com2tag:blogger.com,1999:blog-8394280631537425165.post-9686764961447619462016-09-13T12:49:00.002-07:002016-09-13T12:49:52.149-07:00Running a Linux Script for vSphere via Veeam Backup & ReplicationI needed to do some proof of concept testing on the Pre-Freeze and Post-Thaw scripts to isolate some issues I've been having - rather than just beating my head against the wall all day.<br />
<br />
Below are the steps I took to test Application-Aware processing for Linux Scripts for my test virtual machine.<br />
<br />
Requirements:<br />
<ul>
<li>A Linux virtual machine - Tested with VMware ESXi 6.0.0 3380124 and <a href="https://help.ubuntu.com/community/Lubuntu/GetLubuntu" target="_blank">Lubuntu 16.04 LTS</a></li>
<li>Some scripts to run - Here's my example scripts that just create a freeze-thaw.log <a href="https://github.com/cajeeper/Veeam/tree/master/Linux%20Script" target="_blank">https://github.com/cajeeper/Veeam/tree/master/Linux%20Script</a> </li>
<li>Veeam Backup and Replication - Tested on Veeam Backup & Replication 9.0.0.1715</li>
<li>Both Veeam Backup and Replication and the Linux virtual machine need to be on the same network.</li>
<li>And, always RTFM - Veeam Backup & Replication 9.0 User Guide for VMware vSphere <a href="https://helpcenter.veeam.com/backup/vsphere/pre_post_scripts.html">https://helpcenter.veeam.com/backup/vsphere/pre_post_scripts.html</a></li>
</ul>
<div>
Steps:</div>
<div>
<ol>
<li>Setup your Linux VM with SSH<br />For Lubuntu<br /><code><br />sudo apt-get install openssh-server -y</code><br /><table align="left" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://1.bp.blogspot.com/-TB7TSAuqkOg/V9hMbJ-JM8I/AAAAAAAAHo4/s28zkQXlgrwJn4eVuWAtVVWgK5YvUvO1QCLcB/s1600/2016-09-13%2B11_38_23-Clipboard.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="280" src="https://1.bp.blogspot.com/-TB7TSAuqkOg/V9hMbJ-JM8I/AAAAAAAAHo4/s28zkQXlgrwJn4eVuWAtVVWgK5YvUvO1QCLcB/s320/2016-09-13%2B11_38_23-Clipboard.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Installing SSH</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
</li>
<li>Copy your scripts to your Veeam Backup & Replication server<br /><br /><table align="left" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://3.bp.blogspot.com/-B7Zyfwohsto/V9hPQm5759I/AAAAAAAAHpE/vl7xR1qlChYxHvI5j58QgUGqHWFj-D6_gCLcB/s1600/2016-09-13%2B12_10_40-Clipboard.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="223" src="https://3.bp.blogspot.com/-B7Zyfwohsto/V9hPQm5759I/AAAAAAAAHpE/vl7xR1qlChYxHvI5j58QgUGqHWFj-D6_gCLcB/s320/2016-09-13%2B12_10_40-Clipboard.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Copying your scripts</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
</li>
<li>Add the script's execution to the Application-Aware Processing to your backup job.<br /><br />Edit the job,<br />Go to Guest Processing section,<br />Enable application-aware process and click Applications,<br />Select your virtual machine and click Edit,<br />Go to the Scripts tab, and<br />Browse to your scripts that you want to run for Pre-freeze and Post-thaw<br /><br />Note: Don't forget to assign you local login username and password that has SSH and the correct file / execution permissions.<br /> <div class="separator" style="clear: both; text-align: left;">
<a href="https://2.bp.blogspot.com/-WUqsTsbot6I/V9hQKWDB34I/AAAAAAAAHpM/5msELiECGLsvrE-e4ES2yCvdDi4qYvXqwCLcB/s1600/2016-09-13%2B12_13_40-remote2%2B-%2BMultiDesk.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="225" src="https://2.bp.blogspot.com/-WUqsTsbot6I/V9hQKWDB34I/AAAAAAAAHpM/5msELiECGLsvrE-e4ES2yCvdDi4qYvXqwCLcB/s320/2016-09-13%2B12_13_40-remote2%2B-%2BMultiDesk.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8waP3TTVwDSedxWA7nBfl0vZFlokD-ySAsHfPLNYoRI4ZVtx5LW3ZANSDUrxtR3z2hg0RObrAr5gm1gmg7A3GV3G2epEVeOBMLH8AnolEB5Omrcs4zH5wXff55VlmtwH74fE-2zF6Rr0/s1600/2016-09-13+12_14_12-remote2+-+MultiDesk.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="252" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8waP3TTVwDSedxWA7nBfl0vZFlokD-ySAsHfPLNYoRI4ZVtx5LW3ZANSDUrxtR3z2hg0RObrAr5gm1gmg7A3GV3G2epEVeOBMLH8AnolEB5Omrcs4zH5wXff55VlmtwH74fE-2zF6Rr0/s320/2016-09-13+12_14_12-remote2+-+MultiDesk.png" width="320" /></a></div>
<br /> </li>
<li>Save the changes and run the backup job<br /><br />
<table align="left" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://2.bp.blogspot.com/-LUtjPA70u1w/V9hSzoQ41cI/AAAAAAAAHpU/pZD2lK3AZ_48HvE4cYWTFLJ9cqr9PeHUgCLcB/s1600/2016-09-13%2B11_36_38-Clipboard.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="176" src="https://2.bp.blogspot.com/-LUtjPA70u1w/V9hSzoQ41cI/AAAAAAAAHpU/pZD2lK3AZ_48HvE4cYWTFLJ9cqr9PeHUgCLcB/s320/2016-09-13%2B11_36_38-Clipboard.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Veeam Backup and Recovery Backup Job Test Run</td></tr>
</tbody></table>
<br />
<table align="left" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://2.bp.blogspot.com/-k0v0dgOyvZI/V9hS1B7AUgI/AAAAAAAAHpY/HO7Pb3ExltcWbINgr3VyZALl58YDWPxQQCLcB/s1600/2016-09-13%2B11_41_06-Clipboard.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="201" src="https://2.bp.blogspot.com/-k0v0dgOyvZI/V9hS1B7AUgI/AAAAAAAAHpY/HO7Pb3ExltcWbINgr3VyZALl58YDWPxQQCLcB/s320/2016-09-13%2B11_41_06-Clipboard.png" style="cursor: move;" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Verfiying the scripts ran</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
</li>
</ol>
<div>
Best of luck!</div>
</div>
Justin Bennetthttp://www.blogger.com/profile/08685325767450711504noreply@blogger.com0tag:blogger.com,1999:blog-8394280631537425165.post-56526904714636922302016-07-20T09:43:00.000-07:002017-07-03T14:24:47.788-07:00Automate Update of VM Template - Part 1 - Windows<a href="http://www.allthingstechie.net/2016/07/automate-update-of-vm-template.html" target="_blank">Automate Update of VM Template - Part 1 - Windows</a><br />
<a href="http://www.allthingstechie.net/2017/07/automate-update-of-vm-template-part-2.html" target="_blank">Automate Update of VM Template - Part 2 - Linux</a><br />
<br />
Update: I've tested and now use this on a Windows Server 2016 VM template as well as 2012 R2.<br />
<br />
I don't know about you, but I "love" having to maintain things manually and wasting my time.<br />
<br />
Good news is that it only takes 200+ updates and hours of wasted time to patch a fresh installation of Windows Server 2012 R2 server.<br />
<br />
One solution we've decided to streamline this task is to maintain a patched virtual machine (VM) template that has the most current Windows updates needed.<br />
<br />
"That's a great idea, but you're still having to maintain a VM template." you might say.<br />
<br />
Yeah, I don't have to maintain it - my scheduled task that kicks off a PowerCLI/PowerShell script maintains our VM template.<br />
<br />
You can find the latest version at: <a href="https://github.com/cajeeper/PowerCLI/blob/master/Install-Windows-Update-for-Template.ps1">https://github.com/cajeeper/PowerCLI/blob/master/Install-Windows-Update-for-Template.ps1</a><br />
<br />
Here's a breakdown on what this script does:<br />
<br />
<ul>
<li>Converts the VM template to a virtual machine</li>
<li>Starts the virtual machine</li>
<li>Issues PowerShell script block via VMWare Tools to trigger and install any needed Windows updates</li>
<li>Sleeps for 10 minutes to allow Windows Updates to reboot the OS as needed</li>
<li>Shuts the virtual machine down</li>
<li>Converts the virtual machine back to a VM template</li>
<li>Logs the results</li>
</ul>
<div>
Optionally:</div>
<div>
<ul>
<li>Creates copy of template to another system/site</li>
<li>Shows the progress via the CLI</li>
</ul>
<div>
I've been using it for the last few months with success, so I figured its time to share - once again. Note: I've only been testing this on a Windows Server 2012 VM template.</div>
</div>
<div>
<br /></div>
<div>
Requirements for the script to function:</div>
<div>
<ul>
<li>An existing Windows VM template that has VMware Tools installed and a network adapter to recieve Windows Updates</li>
<li>VMware vCenter - Tested on vCenter 6.0.0</li>
<li>A user/service account with permissions to Create, Remove, Start, Stop VMs and issue VM scripting commands in vCenter 6.0.0</li>
<li>A user/service account with permissions to install Windows Updates in the template virtual machine</li>
<li>Update the parameters with all your relevant template, location, etc. and if you want a post copy of the template to kick off.</li>
</ul>
<div>
Here's the last few months of Windows Updates that have been installed on every Fridays for my virtual machine template via this script:</div>
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoCo2veg1l6wQEGsp61X4aui4b4ibmlssqoZMLLGw6tLzKdlRxkeqcsQ7vA8YoifUr4WfjEvw4ldK0OY1HgEbg9BF-K5_w4qMNCgrmXGsgCtfj2tMW0VT1Kpf4WJNepY5EzImKX0_lWsg/s1600/2016-07-20+09_10_30-Clipboard.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="338" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoCo2veg1l6wQEGsp61X4aui4b4ibmlssqoZMLLGw6tLzKdlRxkeqcsQ7vA8YoifUr4WfjEvw4ldK0OY1HgEbg9BF-K5_w4qMNCgrmXGsgCtfj2tMW0VT1Kpf4WJNepY5EzImKX0_lWsg/s400/2016-07-20+09_10_30-Clipboard.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Template Virtual Machine - Windows Update History</td></tr>
</tbody></table>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFLhkasslL9BgiImGYo5jjt5JVuzcur1aw_OkZhWudW-oKkQs9mbl3m4ISF9Sn4JBg2yt0OQr0Hqr669QMWPs8u9Uxzb6PISqN9BZIEGHO2XHVCSIVXqrERoZW8W6EfuwOsjBTLBtuaaI/s1600/2016_07_20_09_18_02_.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="171" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFLhkasslL9BgiImGYo5jjt5JVuzcur1aw_OkZhWudW-oKkQs9mbl3m4ISF9Sn4JBg2yt0OQr0Hqr669QMWPs8u9Uxzb6PISqN9BZIEGHO2XHVCSIVXqrERoZW8W6EfuwOsjBTLBtuaaI/s400/2016_07_20_09_18_02_.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Template Virtual Machine - Recent Scripted Tasks and Copy of Template at Dev1 Datacenter</td></tr>
</tbody></table>
<div>
Best of luck!</div>
Justin Bennetthttp://www.blogger.com/profile/08685325767450711504noreply@blogger.com0tag:blogger.com,1999:blog-8394280631537425165.post-24486235930581976372016-05-26T08:58:00.003-07:002016-05-26T09:13:15.738-07:00Configure Server 2012 R2 with RDP Session Host without the whole RDP-RDMS shebang! - Part 2 - Shadow Users<a href="http://www.allthingstechie.net/2014/05/configure-server-2012-and-2012-r2-with.html" target="_blank">Configure Server 2012 and 2012 R2 with RDP Session Host without the whole RDP-RDMS shebang! - Part 1</a><br />
<a href="http://www.allthingstechie.net/2016/05/configure-server-2012-r2-with-rdp.html" target="_blank">Configure Server 2012 R2 with RDP Session Host without the whole RDP-RDMS shebang! - Part 2</a><br />
<br />
<hr />
<br />
Had a few people ask about shadowing users. If you've looked around, you'll see Microsoft dropped the ball from Windows Server 2008 R2 to 2012 - as they <a href="https://blogs.msdn.microsoft.com/customer_reviews_of_stb_products/2012/09/05/managing-rdsvdi-with-windows-server-2012/" rel="" target="_blank">removed the shadowing capabilities</a>.<br />
<br />
For Windows 2012 R2, they've <a href="https://blogs.technet.microsoft.com/askperf/2013/10/22/windows-8-1-windows-server-2012-r2-rds-shadowing-is-back/">added it back</a>. Now, if you've configured just a single RDP Session Host, like I've shown, you may be wondering "How can I shadow my users now that I'm all RDP-RDMS free?" Well, I'm glad to say that you're in luck.<br />
<br />
A) Run the PowerShell commands below as Administrator:<br />
<br />
Current full version of configuring RDP Session Host script at <a href="https://github.com/cajeeper/PowerShell/blob/master/Setup-Standalone-RDS-Host.ps1">https://github.com/cajeeper/PowerShell/blob/master/Setup-Standalone-RDS-Host.ps1</a><br />
<br />
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> #Allow Shadowing Users
# Values: 0 (No Remote Control), 1 (Full Control with user's permission), 2 (Full Control without user's permission), 3 (View Session with user's permission), 4 (View Session without user's permission)
New-ItemProperty "hklm:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" -Name Shadow -Value 2 -PropertyType "DWORD"
#Update GPO for Shadowing Users
gpupdate /force
</code></pre>
<span style="font-size: xx-small;">Formatted for web with <a href="http://codeformatter.blogspot.com/">http://codeformatter.blogspot.com/</a> </span><br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<a href="https://3.bp.blogspot.com/-9TmPZNjwqGI/V0cc-YLMqBI/AAAAAAAAHb0/nudZzfZhsjs8-XiFwZr-SqPJrg1Q4uqgQCLcB/s1600/Shadow_User_0.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Example of running PowerShell script" border="0" height="172" src="https://3.bp.blogspot.com/-9TmPZNjwqGI/V0cc-YLMqBI/AAAAAAAAHb0/nudZzfZhsjs8-XiFwZr-SqPJrg1Q4uqgQCLcB/s400/Shadow_User_0.png" title="Example of running PowerShell script" width="400" /></a><br />
<br />
B) Launch a shadowing session<br />
<ol>
<li>Open a PowerShell or Command Prompt as Administrator<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDSI3LJ5PNuGjjWJXmQlaqZiSG-01LLjZWwJmd60SZ5XbplpKJCOKmtPBXRqYQ534pUf1wrYfuyKReOQksL0rTFt-OeHhjXaXBFEnXAULwvDr_rTvKv8od2Z7U1EIssl7-AqubFU8xfCA/s1600/Shadow_User_1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img alt="Example of running PowerShell as Administrator" border="0" height="183" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDSI3LJ5PNuGjjWJXmQlaqZiSG-01LLjZWwJmd60SZ5XbplpKJCOKmtPBXRqYQ534pUf1wrYfuyKReOQksL0rTFt-OeHhjXaXBFEnXAULwvDr_rTvKv8od2Z7U1EIssl7-AqubFU8xfCA/s200/Shadow_User_1.png" title="Example of running PowerShell as Administrator" width="200" /></a><br /> </li>
<li>Find the session you want to shadow using:<br /><br />quser<br /> or<br />qwinsta<br /> </li>
<li>Connect to the session by using the following command on the server you're attempting to administrate (replace # with the correction session ID):<br /><br />mstsc /shadow:# /control<br /> or<br />mstsc /shadow:# /control /noconsentprompt</li>
</ol>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/-mfKeLaWxnrQ/V0ccEBtelsI/AAAAAAAAHbs/I0QvKOi-SE4bHZWgRzuwngy0iBO2zH3ugCLcB/s1600/Shadow_User_2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Example of running quser and mstsc as Administrator" border="0" height="90" src="https://4.bp.blogspot.com/-mfKeLaWxnrQ/V0ccEBtelsI/AAAAAAAAHbs/I0QvKOi-SE4bHZWgRzuwngy0iBO2zH3ugCLcB/s400/Shadow_User_2.png" title="Example of running quser and mstsc as Administrator" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgXC_Q7NzqjHg55-PdCe5KnP0ZSBL7QyBe5WF3eNkafCqDbZSBZ0NjaB1bHy5BXtPCYrCrIJsm17hZOB91-NECkvfXts8ZUuMqSVD4qSDHXSDz-QysKzM4wXfxRUXeKyegaaxts6tXSWs/s1600/Shadow_User_3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Example of shadowing user session" border="0" height="296" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgXC_Q7NzqjHg55-PdCe5KnP0ZSBL7QyBe5WF3eNkafCqDbZSBZ0NjaB1bHy5BXtPCYrCrIJsm17hZOB91-NECkvfXts8ZUuMqSVD4qSDHXSDz-QysKzM4wXfxRUXeKyegaaxts6tXSWs/s400/Shadow_User_3.png" title="Example of shadowing user session" width="400" /></a></div>
<br />
<br />
Cheers!Justin Bennetthttp://www.blogger.com/profile/08685325767450711504noreply@blogger.com0tag:blogger.com,1999:blog-8394280631537425165.post-62444708606630561262016-01-28T12:23:00.000-08:002016-01-28T17:20:56.687-08:00PowerCLI to vMotion VMs off and Enable Maintenance for ESXi hostI'm using VMware vSphere 6 with no <a href="https://www.vmware.com/products/vsphere/features/drs-dpm" target="_blank">DRS</a> enabled on my clusters. Initially, when I wanted to perform maintenance, it was a bit of process with many clicks through the web GUI.<br />
<br />
I've been tinkering with PowerShell for years, so it was natural to start banging on PowerCLI to make my life easier administering my VMware clusters.<br />
<br />
I've been using and growing the following script for the past 4 months. It seems to be making my ESXi patching and maintenance a little less laborious chore than the prior click-storms.<br />
<br />
Enjoy!<br />
<br />
You can find the latest version at: <a href="https://github.com/cajeeper/PowerCLI/blob/master/vMotion%20Off%20All%20VMs%20Host%20A%20to%20B.ps1">https://github.com/cajeeper/PowerCLI/blob/master/vMotion Off All VMs Host A to B.ps1</a><br />
<br />
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"><#
.SYNOPSIS
Script to vMotion VMs off one ESXi host to do maintenance - non-DRS user.
.DESCRIPTION
I use this script to vMotion VMs off one ESXi host to another ESXi host (A to B),
perform some maintenance on the host, then migrate the VMs back to host (B to A).
Optional progress bar, unmounting of ISO files (sometimes causes issues),
and maintenance mode for standard vs. Virtual SAN hosts.
.NOTES
Author : Justin Bennett
Date : 2016-01-28
Contact : http://www.allthingstechie.net
Revision : v1.1
Changes : v1.0 Original
v1.1 Added Progress Bar and Notes
#>
#Connect-VIServer myvCenterServer.local
#Show Progress
$showProgress = $true
#maintenance host
$srchostesx = "esxA.domain.local"
#temp VM host
$dsthostesx = "esxB.domain.local"
#VMs to be migrated around
$VMs = Get-VM | ? { $_.VMHost -like $srchostesx }
#disconenct any ISOs as needed
# $VMs | % { get-vm -name $_.name | Get-CDDrive } | ? { $_.IsoPath -like "*.iso" -OR $_.HostDevice -match "/" } | % { $_ | Set-CDDrive -NoMedia -Confirm:$false }
#move VMs off
if ($VMs.Count -gt 0) { $VMs | % {$i=0} {
$i++
if($showProgress) { Write-Progress -Activity "vMotion Off All VMs: $($srchostesx) to $($dsthostesx)" -Status "$($i)/$($VMs.Count): VM:$($_.Name) - Attempting to vMotion to $($dsthostesx)..." -PercentComplete (($i/$VMs.Count)*100) }
Move-VM $_ -Destination $dsthostesx -VMotionPriority High
if($showProgress) { Write-Progress -Activity "vMotion Off All VMs: $($srchostesx) to $($dsthostesx)" -Status "$($i)/$($VMs.Count): VM:$($_.Name) - Pausing 10 seconds..." -PercentComplete (($i/$VMs.Count)*100) }
sleep 10
}
}
#enter host maintenance
Get-VMHost -Name $srchostesx | Set-VMHost -State Maintenance
#enter host maintenance - VSAN
# Get-View -ViewType HostSystem -Filter @{"Name" = $srchostesx }|?{!$_.Runtime.InMaintenanceMode}|%{$_.EnterMaintenanceMode(0, $false, (new-object VMware.Vim.HostMaintenanceSpec -Property @{vsanMode=(new-object VMware.Vim.VsanHostDecommissionMode -Property @{objectAction=[VMware.Vim.VsanHostDecommissionModeObjectAction]::NoAction})}))}
#
# do my thang ¯\_(ツ)_/¯
#
#exit host maintenance
Get-VMHost -name $srchostesx | Set-VMHost -State Connected
#move VMs back
if ($VMs.Count -gt 0) { $VMs | % {$i=0} {
$i++
if($showProgress) { Write-Progress -Activity "vMotion Off All VMs: $($dsthostesx) to $($srchostesx)" -Status "$($i)/$($VMs.Count): VM:$($_.Name) - Attempting to vMotion to $($srchostesx)..." -PercentComplete (($i/$VMs.Count)*100) }
Move-VM $_ -Destination $srchostesx -VMotionPriority High
if($showProgress) { Write-Progress -Activity "vMotion Off All VMs: $($dsthostesx) to $($srchostesx)" -Status "$($i)/$($VMs.Count): VM:$($_.Name) - Pausing 10 seconds..." -PercentComplete (($i/$VMs.Count)*100) }
sleep 10
}
}
</code></pre>
<span style="background-color: white; color: #222222; font-family: "arial" , "tahoma" , "helvetica" , "freesans" , sans-serif; font-size: xx-small; line-height: 12.6000003814697px;">Formatted for web with </span><a href="http://codeformatter.blogspot.com/" style="background-color: white; color: #888888; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: xx-small; line-height: 12.6000003814697px; text-decoration: none;">http://codeformatter.blogspot.com/</a><span style="background-color: white; color: #222222; font-family: "arial" , "tahoma" , "helvetica" , "freesans" , sans-serif; font-size: xx-small; line-height: 12.6000003814697px;"> </span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-yBU3ju131Zg/Vqp4OxFMinI/AAAAAAAAHOM/6qnZAfE3XeI/s1600/vMotion%2BOff%2BAll%2BVMs%2BHost%2BA%2Bto%2BB%2B1.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="202" src="http://1.bp.blogspot.com/-yBU3ju131Zg/Vqp4OxFMinI/AAAAAAAAHOM/6qnZAfE3XeI/s400/vMotion%2BOff%2BAll%2BVMs%2BHost%2BA%2Bto%2BB%2B1.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: 12.8px;">Script Running on Example VMs</span></td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-5FfTyQdFvyQ/Vqp4PA4Ch4I/AAAAAAAAHOQ/NlEEycfpKDY/s1600/vMotion%2BOff%2BAll%2BVMs%2BHost%2BA%2Bto%2BB%2B2.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="202" src="http://2.bp.blogspot.com/-5FfTyQdFvyQ/Vqp4PA4Ch4I/AAAAAAAAHOQ/NlEEycfpKDY/s400/vMotion%2BOff%2BAll%2BVMs%2BHost%2BA%2Bto%2BB%2B2.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: 12.8px;">Script Running on Example VMs</span></td></tr>
</tbody></table>
<br />Justin Bennetthttp://www.blogger.com/profile/08685325767450711504noreply@blogger.com0tag:blogger.com,1999:blog-8394280631537425165.post-16792675563632862202015-12-23T16:20:00.003-08:002015-12-24T08:53:17.715-08:00Cleaning Up from the Change Block Tracking (CBT) Bug 2137546There's a couple of ways to resolve the potential CBT corruption bug - as noted at <a href="http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2137546" target="_blank">VMware ESXi 6.0, Patch ESXi600-201511401-BG: Updates esx-base (2137546)</a>.<br />
<br />
First, you need to load the latest build onto your ESXi hosts located at <a href="http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2137545" target="_blank">VMware ESXi 6.0, Patch Release ESXi600-201511001 (2137545)</a> on affected hosts.<br />
<br />
After you update your ESXi hosts, you can find directions at <a href="http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2048201" target="_blank">Changed Block Tracking is reset after a storage vMotion operation in vSphere 5.x (2048201)</a> to Reset CBT after you patch or by following an alternate method of resetting change block tracking by doing <a href="https://www.veeam.com/kb1113" target="_blank">the following</a> for each VM on a patched host:<br />
<br />
<ol>
<li>Disable CBT Tracking </li>
<li>Create a Snapshot - none can exist</li>
<li>Remove the Snapshot</li>
<li>Re-Enable CBT Tracking</li>
</ol>
<br />
Veeam has a nice script to resolve the issue - <a href="https://www.veeam.com/kb1113">https://www.veeam.com/kb1113</a><br />
<br />
The only thing lacking, for me, is change tracking for virtual machines that have already had the CBT reset. I'm not going to be able to patch all my hosts at once, but progress A.S.A.P - and not need to repeat resets unnecessarily.<br />
<br />
For my backups, I've been kicking off a once a week disabled CBT backup on all my VMware jobs in Veeam Backup and Recovery with the following script: <a href="https://github.com/cajeeper/Veeam/blob/master/Run-JobsWithoutCBT.ps1">https://github.com/cajeeper/Veeam/blob/master/Run-JobsWithoutCBT.ps1</a><br />
<br />
I wrote a script in PowerCLI - similar to Veeams - that resets the virtual machine's CBT tracking by following the mentioned change block tracking reset steps above, but I've added additional tagging to indicate prior CBT resets on VMs, so I'm not attempting to continuously repair them all and I have some change tracking for future reference.<br />
<br />
You can find the latest version at: <a href="https://github.com/cajeeper/PowerCLI/blob/master/Reset-VM-CBT.ps1">https://github.com/cajeeper/PowerCLI/blob/master/Reset-VM-CBT.ps1</a><br />
<br />
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"><#
.SYNOPSIS
Script reset VMs CBT and tag them as being reset if ESXi600-201511001 has been loaded on its host.
.DESCRIPTION
CBT Bug VMWare KB 2137546 is no bueno. I wanted a way to patch VMs possibly affected
and keep track of ones that were patched - so as I progress through and patch for
this bug, I don't have to keep running the patch process on VMs multiple time
unnecessarily.
.NOTES
Author : Justin Bennett
Date : 2015-12-23
Contact : http://www.allthingstechie.net
Revision : v1.0
Changes : v1.0 Original
#>
#Connect-VIServer myvCenterServer.local
#Show Progress
$showProgress = $true
#Gather VM Hosts
$ESXHosts = Get-VMHost
#Gather VM Hosts that have corrected for CBT Bug build
$patchedESXHosts = $ESXHosts | ? { $_.Build -ge 3247720 }
#Gather VMs from ESX hosts with corrected for CBT Bug build
$VMs = $patchedESXHosts | Get-VM
#Create tags if necessary
$nul = New-TagCategory PowerCLI -ErrorAction SilentlyContinue
$nul = New-Tag -Name ResetCBT -Category PowerCLI -Description "bit.ly/1U5nyxz" -ErrorAction SilentlyContinue
#Get the ResetCBT Tag
$Tag = Get-Tag ResetCBT
#VMs already patched
$existingResetCBTVMs = (Get-TagAssignment -Category "PowerCLI" | ? { $_.Tag.Name -eq $Tag.Name -and $_.Entity.Uid -like "*VirtualMachine=*"} | select Entity).Entity
#Gather VMs not already CBT Reset and ChangeTrackingEnabled is Enabled (No need to reset if CBT already disabled)
$resetCBTVMs = $VMs | ? { $_.Id -notin $existingResetCBTVMs.Id -and ($_.ExtensionData.Config).ChangeTrackingEnabled }
$resetCBTVMsCount = 0
if ($resetCBTVMs.Count -gt 0) { $resetCBTVMs | % {$i=0} {
$i++
if ($_.PowerState -eq "PoweredOn" -and ($_ | Get-View).snapshot -eq $null) {
try {
#Disable CBT Spec
if($showProgress) { Write-Progress -Activity "Reset-VM CBT" -Status "$($i)/$($resetCBTVMs.Count): VM:$($_.Name) - Disabling CBT" -PercentComplete (($i/$resetCBTVMs.Count)*100) }
$VMConf = New-Object VMware.Vim.VirtualMachineConfigSpec
$VMConf.ChangeTrackingEnabled = $false
$_.ExtensionData.ReconfigVM($VMConf)
#Creating snapshot
if($showProgress) { Write-Progress -Activity "Reset-VM CBT" -Status "$($i)/$($resetCBTVMs.Count): VM:$($_.Name) - Creating Snapshot to Clear CBT" -PercentComplete (($i/$resetCBTVMs.Count)*100) }
$snap=$_ | New-Snapshot -Name 'Clear CBT'
#Removing snapshot
if($showProgress) { Write-Progress -Activity "Reset-VM CBT" -Status "$($i)/$($resetCBTVMs.Count): VM:$($_.Name) - Removing Snapshot" -PercentComplete (($i/$resetCBTVMs.Count)*100) }
$snap | Remove-Snapshot -confirm:$false
#Enable CBT
if($showProgress) { Write-Progress -Activity "Reset-VM CBT" -Status "$($i)/$($resetCBTVMs.Count): VM:$($_.Name) - Enabling CBT" -PercentComplete (($i/$resetCBTVMs.Count)*100) }
$VMConf.ChangeTrackingEnabled = $true
$_.ExtensionData.ReconfigVM($VMConf)
#Tagging Reset CBT VM
$nul = $_ | New-TagAssignment $Tag
$resetCBTVMsCount++
} catch { write-warning "Failed to reset CBT on VM: $($_.Name)" }
} else {
if($_.PowerState -ne "PoweredOn") { write-warning "VM: $($_.Name) Not completed - Needs to be in PoweredOn state" }
if(($_ | Get-View).snapshot -ne $null) { write-warning "VM: $($_.Name) Not completed - Needs to have no existing snapshots" }
}
}
} else { write-warning "No VMs to Reset CBT on" }
New-Object -TypeName PSCustomObject -Property ([ordered]@{
ESXHosts = $ESXHosts.Count
patchedESXHosts = $patchedESXHosts.Count
VMCount = $VMs.Count
existingResetCBTVMs = $existingResetCBTVMs.Count
resetCBTVMs = $resetCBTVMs.Count
CompletedCBTVMs = $resetCBTVMsCount
})
</code></pre>
<span style="background-color: white; color: #222222; font-family: "arial" , "tahoma" , "helvetica" , "freesans" , sans-serif; font-size: xx-small; line-height: 12.6000003814697px;">Formatted for web with </span><a href="http://codeformatter.blogspot.com/" style="background-color: white; color: #888888; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: xx-small; line-height: 12.6000003814697px; text-decoration: none;">http://codeformatter.blogspot.com/</a><span style="background-color: white; color: #222222; font-family: "arial" , "tahoma" , "helvetica" , "freesans" , sans-serif; font-size: xx-small; line-height: 12.6000003814697px;"> </span>
<br />
<br />
Best of luck!<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSPqCU5YTmiqNk8NxhwMFN69SH1OgWgAH4II-A1S-rZYl9hUHJjVvKtJgsfTEhAI122FJOBRvg9Ex7wjzle00hNAnBdx5ZzkLU-Ul-avifwWWs7xQUs1kQcW-aKu7905CQWSzm1Jd5_dE/s1600/screenshot+%25281%2529.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="162" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSPqCU5YTmiqNk8NxhwMFN69SH1OgWgAH4II-A1S-rZYl9hUHJjVvKtJgsfTEhAI122FJOBRvg9Ex7wjzle00hNAnBdx5ZzkLU-Ul-avifwWWs7xQUs1kQcW-aKu7905CQWSzm1Jd5_dE/s320/screenshot+%25281%2529.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Script Running on Example VMs</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-XTkeBrnwBnQ/VnwdjyK9zcI/AAAAAAAAHME/u90zKp2RZic/s1600/screenshot%2B%25286%2529.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="162" src="http://2.bp.blogspot.com/-XTkeBrnwBnQ/VnwdjyK9zcI/AAAAAAAAHME/u90zKp2RZic/s320/screenshot%2B%25286%2529.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: 12.8px;">Script Running on Example VMs</span></td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://4.bp.blogspot.com/-tLX8S1i1nDE/Vnwdjy5pCvI/AAAAAAAAHMI/CR9iVPK9BzY/s1600/screenshot%2B%25287%2529.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="162" src="http://4.bp.blogspot.com/-tLX8S1i1nDE/Vnwdjy5pCvI/AAAAAAAAHMI/CR9iVPK9BzY/s320/screenshot%2B%25287%2529.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: 12.8px;">Script Finished running on Example VMs</span></td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-03Vg45a9zEI/VnwgFeHT5XI/AAAAAAAAHMs/copFIy0EFu4/s1600/screenshot%2B%25288%2529.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="164" src="http://1.bp.blogspot.com/-03Vg45a9zEI/VnwgFeHT5XI/AAAAAAAAHMs/copFIy0EFu4/s320/screenshot%2B%25288%2529.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">vSphere Tags added to VMs with CBT Reset</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://4.bp.blogspot.com/-6Zf3Y1EWC34/Vnwi6EzGLmI/AAAAAAAAHM4/Wzpq6AhF4ps/s1600/screenshot%2B%25289%2529.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="167" src="http://4.bp.blogspot.com/-6Zf3Y1EWC34/Vnwi6EzGLmI/AAAAAAAAHM4/Wzpq6AhF4ps/s320/screenshot%2B%25289%2529.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: 12.8px;">vSphere Tag added to VM with CBT Reset</span></td></tr>
</tbody></table>
<br />Justin Bennetthttp://www.blogger.com/profile/08685325767450711504noreply@blogger.com0tag:blogger.com,1999:blog-8394280631537425165.post-68682131315132862902015-12-01T11:32:00.000-08:002015-12-01T11:32:02.917-08:00Remove Windows Update using PowerShell and KBI would like a native cmdlet in PowerShell to remove Windows Updates.<br />
<br />
Until that time comes, I've created my own function that takes the native comobjects and searches for the update I want to remove by KB ID.<br />
<br />
Bon Appétit<br />
<br />
Current version at <a href="https://github.com/cajeeper/PowerShell/blob/master/Remove-WindowsUpdate.ps1">https://github.com/cajeeper/PowerShell/blob/master/Remove-WindowsUpdate.ps1</a><br />
<br />
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"><#
.SYNOPSIS
Remove One to Many Windows Updates
.DESCRIPTION
Remove One to Many Windows Updates from OS.
.NOTES
Author : Justin Bennett
Date : 2015-12-01
Contact : http://www.allthingstechie.net
Revision : v1
.EXAMPLE
C:\PS> #Uninstall One Update
C:\PS> Remove-WindowsUpdate 123456
.EXAMPLE
C:\PS> #Uninstall Multiple Updates
C:\PS> Remove-WindowsUpdate 123456,456123
#>
Function Remove-WindowsUpdate {
[CmdletBinding()]
param (
[parameter(Mandatory=$True)] $RemoveKB
)
$Searcher = New-Object -ComObject Microsoft.Update.Searcher
$RemoveCollection = New-Object -ComObject Microsoft.Update.UpdateColl
#Gather All Installed Updates
$SearchResult = $Searcher.Search("IsInstalled=1")
#Add any of the specified KBs to the RemoveCollection
$SearchResult.Updates | ? { $_.KBArticleIDs -in $RemoveKB } | % { $RemoveCollection.Add($_) }
if ($RemoveCollection.Count -gt 0) {
$Installer = New-Object -ComObject Microsoft.Update.Installer
$Installer.Updates = $RemoveCollection
$Installer.Uninstall()
} else { Write-Warning "No matching Windows Updates found for:`n$($RemoveKB|Out-String)" }
}
</code></pre>
<span style="background-color: white; color: #222222; font-family: "arial" , "tahoma" , "helvetica" , "freesans" , sans-serif; font-size: xx-small; line-height: 12.6000003814697px;">Formatted for web with </span><a href="http://codeformatter.blogspot.com/" style="background-color: white; color: #888888; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: xx-small; line-height: 12.6000003814697px; text-decoration: none;">http://codeformatter.blogspot.com/</a><span style="background-color: white; color: #222222; font-family: "arial" , "tahoma" , "helvetica" , "freesans" , sans-serif; font-size: xx-small; line-height: 12.6000003814697px;"> </span>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibW5_TTLg0e_bTKohFdykZSqN7EFDbeU5DbGM2rHgTF9yL7v76VZYeK-8tCKKJhB26kf-8FkmddbtFY7FclZCO-QXA7GAv1h5kOR7h0lQnafNYHSaC4xHEPfJDh3pEbZl9xDWE2CX2pv0/s1600/2015-12-01+11_28_08-.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="137" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibW5_TTLg0e_bTKohFdykZSqN7EFDbeU5DbGM2rHgTF9yL7v76VZYeK-8tCKKJhB26kf-8FkmddbtFY7FclZCO-QXA7GAv1h5kOR7h0lQnafNYHSaC4xHEPfJDh3pEbZl9xDWE2CX2pv0/s640/2015-12-01+11_28_08-.png" width="640" /></a></div>
<span id="goog_1442915342"></span><span id="goog_1442915343"></span><br />Justin Bennetthttp://www.blogger.com/profile/08685325767450711504noreply@blogger.com0tag:blogger.com,1999:blog-8394280631537425165.post-37445696067246908382015-09-23T08:15:00.003-07:002015-09-23T08:32:08.775-07:00Installing ESXi - Operation Failed "Unable to read partition table for device"In process of re-purposing an existing a Hyper-V host as a VMware ESXi host - no apologies, by the way - I've ran into this error a few times.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjnUMXmmqvwJeHU-fLyhmETSCcijeax0F24Jt7a7jytrie3ZJaZk4yWL3RjBDFVMi3F8YyAVdhTGR7eYvUXNHl9Ts6n8AL6ZHIIlad-gLS9_SgPMv-kPnMt8SAOY6zTagvs-0uPCgjJ04/s1600/30f6248d-eb86-4c99-8e16-8ad7a7b8a4d5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="273" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjnUMXmmqvwJeHU-fLyhmETSCcijeax0F24Jt7a7jytrie3ZJaZk4yWL3RjBDFVMi3F8YyAVdhTGR7eYvUXNHl9Ts6n8AL6ZHIIlad-gLS9_SgPMv-kPnMt8SAOY6zTagvs-0uPCgjJ04/s320/30f6248d-eb86-4c99-8e16-8ad7a7b8a4d5.png" width="320" /></a></div>
<br />
The installation process usually consists of re-sizing the original OS mirrored disk set virtual disks as one 32GB virtual disk and the remaining space as a secondary space to utilize as a utility datastore later for vSphere.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiuQkcJwldD1E8zwpIuxPBN7KujruYAuyfC-0ArKVVzkMvlyEBwSk4IcOWDoA61abmj_lngGrM84Ij9jVnGB2gFz-y-s2nMRWvHDu2ovjd8pyqyQCn_ZTpYzuK4_OXp9X_JlnodijXFXU/s1600/vdisk.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="203" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiuQkcJwldD1E8zwpIuxPBN7KujruYAuyfC-0ArKVVzkMvlyEBwSk4IcOWDoA61abmj_lngGrM84Ij9jVnGB2gFz-y-s2nMRWvHDu2ovjd8pyqyQCn_ZTpYzuK4_OXp9X_JlnodijXFXU/s400/vdisk.png" width="400" /></a></div>
<br />
<br />
So, what's the reason for the this error? Well, the RAID controller didn't and wasn't told to zero out the disks during the changes to the virtual disks. The end result is the original partition table that was saved on the 278GB virtual disk is visible on the new 32GB virtual disk.<br />
<br />
To fix this, we need to either create a new partition table or zero out the partition table data.<br />
<br />
Two easy ways, is use dd or GParted on a linux distro live boot disk - <a href="https://help.ubuntu.com/community/Lubuntu/GetLubuntu" target="_blank">Lubuntu</a> is my first go-to.<br />
<br />
With dd (to zero out the partition table data):<br />
<ol>
<li>Open a terminal window<br /><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-ej3DWkB7x2w/VgLBFZlXzPI/AAAAAAAAG6c/55K00UV7NAc/s1600/2015-09-23%2B07_52_46-Lubuntu%2B%255BRunning%255D%2B-%2BOracle%2BVM%2BVirtualBox%2B2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="292" src="http://4.bp.blogspot.com/-ej3DWkB7x2w/VgLBFZlXzPI/AAAAAAAAG6c/55K00UV7NAc/s320/2015-09-23%2B07_52_46-Lubuntu%2B%255BRunning%255D%2B-%2BOracle%2BVM%2BVirtualBox%2B2.png" width="320" /></a></div>
</li>
<li>Run the command: <span style="font-family: Courier New, Courier, monospace;">dd if=/dev/zero of=/dev/sda bs=512 count=1</span></li>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-9A5Ozyz9ons/VgLBJaOpE_I/AAAAAAAAG64/pjLq-XF9M4Y/s1600/2015-09-23%2B07_57_53-Lubuntu%2B%255BRunning%255D%2B-%2BOracle%2BVM%2BVirtualBox.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="135" src="http://1.bp.blogspot.com/-9A5Ozyz9ons/VgLBJaOpE_I/AAAAAAAAG64/pjLq-XF9M4Y/s400/2015-09-23%2B07_57_53-Lubuntu%2B%255BRunning%255D%2B-%2BOracle%2BVM%2BVirtualBox.png" width="400" /></a></div>
<ul>
<li>Note: you may need to run as <span style="font-family: Courier New, Courier, monospace;">sudo</span> or elevate to <span style="font-family: Courier New, Courier, monospace;">su</span></li>
</ul>
</ol>
With GParted (to create a new partition table):<br />
<ol>
<li>Open GParted<br /><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-3weElf-crQM/VgLBHaLABcI/AAAAAAAAG6k/6oX85wU4hEc/s1600/2015-09-23%2B07_52_46-Lubuntu%2B%255BRunning%255D%2B-%2BOracle%2BVM%2BVirtualBox.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="311" src="http://1.bp.blogspot.com/-3weElf-crQM/VgLBHaLABcI/AAAAAAAAG6k/6oX85wU4hEc/s320/2015-09-23%2B07_52_46-Lubuntu%2B%255BRunning%255D%2B-%2BOracle%2BVM%2BVirtualBox.png" style="cursor: move;" width="320" /></a></div>
</li>
<li>Click Device, and select Create Partition Table...<br /><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-7eSYWWiqim4/VgLBJaVr8GI/AAAAAAAAG68/spXqJowVZzk/s1600/2015-09-23%2B08_10_21-Lubuntu%2B%255BRunning%255D%2B-%2BOracle%2BVM%2BVirtualBox.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="107" src="http://4.bp.blogspot.com/-7eSYWWiqim4/VgLBJaVr8GI/AAAAAAAAG68/spXqJowVZzk/s320/2015-09-23%2B08_10_21-Lubuntu%2B%255BRunning%255D%2B-%2BOracle%2BVM%2BVirtualBox.png" width="320" /></a></div>
</li>
<li>Click Apply<br /><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqQenwOE_YWVlckr9o2Yu0PPmtfDqg_me5aqxLzNl6CkqucUpMN6b3dJZ4b0GttYuUdns5tduFHHO5bUmSzyrkNKNpBErB7e0aXGzCMd0OZVsDwUZ38IT79WbdanvMl64OURk4Fu74ps4/s1600/2015-09-23+08_10_45-Lubuntu+%255BRunning%255D+-+Oracle+VM+VirtualBox.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="81" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqQenwOE_YWVlckr9o2Yu0PPmtfDqg_me5aqxLzNl6CkqucUpMN6b3dJZ4b0GttYuUdns5tduFHHO5bUmSzyrkNKNpBErB7e0aXGzCMd0OZVsDwUZ38IT79WbdanvMl64OURk4Fu74ps4/s320/2015-09-23+08_10_45-Lubuntu+%255BRunning%255D+-+Oracle+VM+VirtualBox.png" width="320" /></a></div>
</li>
</ol>
<div class="separator" style="clear: both; text-align: center;">
</div>
Justin Bennetthttp://www.blogger.com/profile/08685325767450711504noreply@blogger.com3tag:blogger.com,1999:blog-8394280631537425165.post-33979026917923390712015-09-21T14:52:00.002-07:002015-09-21T15:07:47.336-07:00Disable Start Menu Win+X Hidden Context-MenuI was hoping to find a GPO (Group Policy Object) setting to disable the hidden context menu for the Start Menu (a.k.a. Win+X) in Windows 8 / 8.1 / 2012 / 2012 R2. I did find the menu items are shortcuts under C:\Users\AUser\AppData\Local\Microsoft\Windows\WinX under Group1-3 folders. I was able to effectively disable the Win+X Menu by moving the Group 2 and Group 3 folders out - so my public terminal users can't have access to those shortcuts.<br />
<br />
I still hope to be WOW'd by a GPO setting some day, but until then...<br />
<div>
<br /></div>
Here's a PowerShell script I launched on each of my Remote Desktop Sessions hosts to effectively disable the Win+X menu:<br />
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: 100px; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;">#kill start menu right-click context menu
$folder = "C:\Users\Default\AppData\Local\Microsoft\Windows"
mkdir $folder\WinX.org
Move-Item -Path $folder\WinX\group[2-3] -Destination $folder\WinX.org
</code></pre>
<span style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: xx-small; line-height: 12.6000003814697px;">Formatted for web with </span><a href="http://codeformatter.blogspot.com/" style="background-color: white; color: #888888; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: xx-small; line-height: 12.6000003814697px; text-decoration: none;">http://codeformatter.blogspot.com/</a><span style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: xx-small; line-height: 12.6000003814697px;"> </span>
<br />
<div>
<br />
Before:<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-u_cC0ssSZkU/VgByfxze_OI/AAAAAAAAG3U/t9DijSZnk1U/s1600/2015-09-21%2B14_09_50-remotemvc2.msjc.edu%2B-%2BRemote%2BDesktop%2BConnection.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-u_cC0ssSZkU/VgByfxze_OI/AAAAAAAAG3U/t9DijSZnk1U/s1600/2015-09-21%2B14_09_50-remotemvc2.msjc.edu%2B-%2BRemote%2BDesktop%2BConnection.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-KCVrOM-GSvU/VgByePJPAuI/AAAAAAAAG3Y/XS29rq6n9XM/s1600/2015-09-21%2B14_03_39-bridge2%2B-%2BMultiDesk.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="114" src="http://1.bp.blogspot.com/-KCVrOM-GSvU/VgByePJPAuI/AAAAAAAAG3Y/XS29rq6n9XM/s320/2015-09-21%2B14_03_39-bridge2%2B-%2BMultiDesk.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-99zkUxvkPxo/VgByfHonIMI/AAAAAAAAG3Q/IpJ0lC-WCww/s1600/2015-09-21%2B14_06_28-bridge2%2B-%2BMultiDesk.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="137" src="http://2.bp.blogspot.com/-99zkUxvkPxo/VgByfHonIMI/AAAAAAAAG3Q/IpJ0lC-WCww/s320/2015-09-21%2B14_06_28-bridge2%2B-%2BMultiDesk.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVRLd7-zoLSeZ6Is8NKDJYNPq3VB2XzMchE0Ik1fwvTwcMxU99Xyg5bxTyBsMbtPmLZJlcIEy0uETce1br0aaOdnxL9yUuvYpROyy_T5HEioDzRY1vaArUIVVEkThkPAT_i03PtQTCDMc/s1600/2015-09-21+14_04_16-bridge2+-+MultiDesk.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="169" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVRLd7-zoLSeZ6Is8NKDJYNPq3VB2XzMchE0Ik1fwvTwcMxU99Xyg5bxTyBsMbtPmLZJlcIEy0uETce1br0aaOdnxL9yUuvYpROyy_T5HEioDzRY1vaArUIVVEkThkPAT_i03PtQTCDMc/s320/2015-09-21+14_04_16-bridge2+-+MultiDesk.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
Ran the script:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-je5zAmhFaOk/VgB06pFdiOI/AAAAAAAAG3o/mLNqHPMYyz0/s1600/2015-09-21%2B14_14_05-bridge2%2B-%2BMultiDesk.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="168" src="http://3.bp.blogspot.com/-je5zAmhFaOk/VgB06pFdiOI/AAAAAAAAG3o/mLNqHPMYyz0/s400/2015-09-21%2B14_14_05-bridge2%2B-%2BMultiDesk.png" width="400" /></a></div>
<br />
After a log-off and back in (my user profiles are non-persistent):<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWP1zYcHk1OCf-xmg-TTL6LMue8J1BjxdHEc9nrq84nknXDr1Z_pnkK4kubptAPXaC25vqQfnc1MHPlQG57cOJx_FuYNfaR3Zsi3RJzeZ1k55WNhDKdKtxIj76egnUW4xKQ0AudfmMtSI/s1600/2015-09-21+14_10_37-remotemvc2.msjc.edu+-+Remote+Desktop+Connection.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWP1zYcHk1OCf-xmg-TTL6LMue8J1BjxdHEc9nrq84nknXDr1Z_pnkK4kubptAPXaC25vqQfnc1MHPlQG57cOJx_FuYNfaR3Zsi3RJzeZ1k55WNhDKdKtxIj76egnUW4xKQ0AudfmMtSI/s1600/2015-09-21+14_10_37-remotemvc2.msjc.edu+-+Remote+Desktop+Connection.png" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-BfsJNdElPP4/VgByeOCl60I/AAAAAAAAG3g/EV5pPm--Z2Y/s1600/2015-09-21%2B14_02_45-bridge2%2B-%2BMultiDesk.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="139" src="http://4.bp.blogspot.com/-BfsJNdElPP4/VgByeOCl60I/AAAAAAAAG3g/EV5pPm--Z2Y/s320/2015-09-21%2B14_02_45-bridge2%2B-%2BMultiDesk.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-HHPNfYgaSrQ/VgByeGdwYBI/AAAAAAAAG20/x9Yh-QtvNaY/s1600/2015-09-21%2B14_03_04-bridge2%2B-%2BMultiDesk.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="121" src="http://2.bp.blogspot.com/-HHPNfYgaSrQ/VgByeGdwYBI/AAAAAAAAG20/x9Yh-QtvNaY/s320/2015-09-21%2B14_03_04-bridge2%2B-%2BMultiDesk.png" width="320" /></a></div>
<br />
<div style="background: #f9f9f9; border: 1px solid #CCCCCC; color: black; padding: 8px;">
Note: If you have existing persistent user profiles, you'll need to go through each profile and remove the Group# folder you're targeting. If you need to update all users, here's that script too - you're welcome.<br />
<br />
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: 140px; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;">$users = (Get-ChildItem C:\Users -Directory -Exclude "Public", "Administrator").FullName
foreach ($user in $users) {
$folder = "$($user)\AppData\Local\Microsoft\Windows"
mkdir $folder\WinX.org
Move-Item -Path $folder\WinX\group[2-3] -Destination $folder\WinX.org
}
</code></pre>
<span style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: xx-small; line-height: 12.6000003814697px;">Formatted for web with </span><a href="http://codeformatter.blogspot.com/" style="background-color: white; color: #888888; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: xx-small; line-height: 12.6000003814697px; text-decoration: none;">http://codeformatter.blogspot.com/</a><span style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: xx-small; line-height: 12.6000003814697px;"> </span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-VQSd3yBVRhA/VgB8iRU21GI/AAAAAAAAG34/A9db44qF3yw/s1600/2015-09-21%2B14_39_44-Administrator_%2BWindows%2BPowerShell.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="358" src="http://3.bp.blogspot.com/-VQSd3yBVRhA/VgB8iRU21GI/AAAAAAAAG34/A9db44qF3yw/s400/2015-09-21%2B14_39_44-Administrator_%2BWindows%2BPowerShell.png" width="400" /></a></div>
<br /></div>
<br /></div>
Justin Bennetthttp://www.blogger.com/profile/08685325767450711504noreply@blogger.com0tag:blogger.com,1999:blog-8394280631537425165.post-45437711386338190122015-08-19T07:18:00.002-07:002015-08-19T07:54:00.772-07:00Older Remote Desktop Clients Can't Connect - Requires Network Level Authentication ErrorI noticed this morning that my older thin client terminals started getting errors connecting to our central remote desktop session hosts.<br />
<br />
It appears update KB 3075220 - part of KB 3080348 - just rolled through my session hosts over night and turned on the Network Level Authentication requirement.<br />
<br />
I disabled the requirement by unchecking the "Allow connections only from computers running desktop with network level authentication" and it appears I'm back in business. Thanks for the early morning fire drill Microsoft.<br />
<br />
<a href="https://support.microsoft.com/en-us/kb/3080348">https://support.microsoft.com/en-us/kb/3080348</a><br />
MS15-082: Vulnerabilities in RDP could allow remote code execution: August 11, 2015<br />
<br />
<a href="https://technet.microsoft.com/library/security/MS15-082">https://technet.microsoft.com/library/security/MS15-082</a><br />
Vulnerabilities in RDP Could Allow Remote Code Execution (3080348)<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwWM9XDOj5IE8X78VgkLiZR9OAXU7Czjpdu45v8s9425xr29jNjVase70zg4rEMx63YP3cPLhfeTjrV1MmpVtXUCRZC1vn_nawnweR0qekgFVYxvDYeZM78BTbS9nnb5bAdGGAnGRsXmE/s1600/2015-08-19+07_07_03-RemoteMVC2+-+MultiDesk.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwWM9XDOj5IE8X78VgkLiZR9OAXU7Czjpdu45v8s9425xr29jNjVase70zg4rEMx63YP3cPLhfeTjrV1MmpVtXUCRZC1vn_nawnweR0qekgFVYxvDYeZM78BTbS9nnb5bAdGGAnGRsXmE/s320/2015-08-19+07_07_03-RemoteMVC2+-+MultiDesk.png" title="After Update Loaded" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">After KB 3080348 update loaded, the "Network Level Authentication" was checked</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://4.bp.blogspot.com/-HI8hLsmhVNA/VdSPM7HIF7I/AAAAAAAAGm0/fVG-3t-6-gw/s1600/2015-08-19%2B07_07_56-RemoteMVC2%2B-%2BMultiDesk.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="" border="0" src="http://4.bp.blogspot.com/-HI8hLsmhVNA/VdSPM7HIF7I/AAAAAAAAGm0/fVG-3t-6-gw/s320/2015-08-19%2B07_07_56-RemoteMVC2%2B-%2BMultiDesk.png" title="Unchecked the NLA requirement" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Unchecked the "Network Level Authentication" requirement</td></tr>
</tbody></table>
Justin Bennetthttp://www.blogger.com/profile/08685325767450711504noreply@blogger.com0tag:blogger.com,1999:blog-8394280631537425165.post-88761995792307094722015-05-25T12:04:00.000-07:002016-05-03T09:39:24.154-07:00Home Water System Pt 3 - Sense that Arduino via SNMPHardware:<br />
<ul>Arduino compatible Uno R3<br />Arduino compatiable Ethernet Shield W5100<br />15 PSI pressure sensor<br />USB Wall Charger<br />Network Switch</ul>
<ul>The USB Charger was laying around and everything else was easily found on a eBay.</ul>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-BeTTvYs1OeM/VWNlOCahEaI/AAAAAAAAGgA/PuXVd851FAU/s1600/DSC_0717.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://1.bp.blogspot.com/-BeTTvYs1OeM/VWNlOCahEaI/AAAAAAAAGgA/PuXVd851FAU/s320/DSC_0717.JPG" width="180" /></a>
<a href="http://4.bp.blogspot.com/--ghKR0vQ2lk/VWNj9zUGHlI/AAAAAAAAGf0/WXI18E8E7eI/s1600/_20150525_110143.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://4.bp.blogspot.com/--ghKR0vQ2lk/VWNj9zUGHlI/AAAAAAAAGf0/WXI18E8E7eI/s320/_20150525_110143.JPG" width="244" /></a> </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-BrGqLGYfrAU/VWNnb8rFabI/AAAAAAAAGgI/34DLQ5WCFFo/s1600/%2524_57.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="177" src="https://2.bp.blogspot.com/-BrGqLGYfrAU/VWNnb8rFabI/AAAAAAAAGgI/34DLQ5WCFFo/s320/%2524_57.JPG" width="320" /></a></div>
<br />
Libraries: (My copies of the oringals are at <a href="https://github.com/cajeeper/Arduino">https://github.com/cajeeper/Arduino</a>)<br />
<ul>
<li>Agentuino - https://github.com/1sw/Agentuino</li>
<ul>
<li>Requires</li>
<ul>
MemoryFree - https://github.com/maniacbug/MemoryFree<br />
Streaming - http://arduiniana.org/libraries/streaming/
</ul>
</ul>
</ul>
<br />
<br />
My Arduino Sketch - A modification of the example Agentuino sketch:<br />
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: 400px; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;">/**
* SNMP Sensor Input Sketch v.2
* Justin Bennett http://justin-bennett-msjc.blogspot.com/
*
*
* Adapted from the Agentuino SNMP Example Sketch:
* Agentuino SNMP Agent Library Prototyping...
*
* Copyright 2010 Eric C. Gionet <lavco_eg@hotmail.com>
*
*/
#include <Streaming.h> // Include the Streaming library
#include <Ethernet.h> // Include the Ethernet library
#include <SPI.h>
#include <MemoryFree.h>
#include <Agentuino.h>
//#include <Flash.h>
//
//
#define DEBUG
//
static byte mac[] = { 0xAA, 0xAA, 0xBB, 0xBB, 0x00, 0x01 };
static byte ip[] = { 192, 168, 0, 10 };
static byte gateway[] = { 192, 168, 0, 1 };
static byte subnet[] = { 255, 255, 255, 0 };
//
//
// tkmib - linux mib browser
//
// RFC1213-MIB OIDs
// .iso (.1)
// .iso.org (.1.3)
// .iso.org.dod (.1.3.6)
// .iso.org.dod.internet (.1.3.6.1)
// .iso.org.dod.internet.mgmt (.1.3.6.1.2)
// .iso.org.dod.internet.mgmt.mib-2 (.1.3.6.1.2.1)
// .iso.org.dod.internet.mgmt.mib-2.system (.1.3.6.1.2.1.1)
// .iso.org.dod.internet.mgmt.mib-2.system.sysDescr (.1.3.6.1.2.1.1.1)
const static char sysDescr[] PROGMEM = "1.3.6.1.2.1.1.1.0"; // read-only (DisplayString)
// .iso.org.dod.internet.mgmt.mib-2.system.sysObjectID (.1.3.6.1.2.1.1.2)
const static char sysObjectID[] PROGMEM = "1.3.6.1.2.1.1.2.0"; // read-only (ObjectIdentifier)
// .iso.org.dod.internet.mgmt.mib-2.system.sysUpTime (.1.3.6.1.2.1.1.3)
const static char sysUpTime[] PROGMEM = "1.3.6.1.2.1.1.3.0"; // read-only (TimeTicks)
// .iso.org.dod.internet.mgmt.mib-2.system.sysContact (.1.3.6.1.2.1.1.4)
const static char sysContact[] PROGMEM = "1.3.6.1.2.1.1.4.0"; // read-write (DisplayString)
// .iso.org.dod.internet.mgmt.mib-2.system.sysName (.1.3.6.1.2.1.1.5)
const static char sysName[] PROGMEM = "1.3.6.1.2.1.1.5.0"; // read-write (DisplayString)
// .iso.org.dod.internet.mgmt.mib-2.system.sysLocation (.1.3.6.1.2.1.1.6)
const static char sysLocation[] PROGMEM = "1.3.6.1.2.1.1.6.0"; // read-write (DisplayString)
// .iso.org.dod.internet.mgmt.mib-2.system.sysServices (.1.3.6.1.2.1.1.7)
const static char sysServices[] PROGMEM = "1.3.6.1.2.1.1.7.0"; // read-only (Integer)
//
// Arduino defined OIDs
// .iso.org.dod.internet.private (.1.3.6.1.4)
// .iso.org.dod.internet.private.enterprises (.1.3.6.1.4.1)
// .iso.org.dod.internet.private.enterprises.arduino (.1.3.6.1.4.1.36582)
// .iso.org.dod.internet.private.enterprises.arduino.RAW (.1.3.6.1.4.1.36582.0.0)
const static char RAWa0[] PROGMEM = "1.3.6.1.4.1.36582.0.0"; // read-only (Integer)
// .iso.org.dod.internet.private.enterprises.arduino.RAW (.1.3.6.1.4.1.36582.0.1)
const static char RAWa1[] PROGMEM = "1.3.6.1.4.1.36582.0.1"; // read-only (Integer)
// .iso.org.dod.internet.private.enterprises.arduino.RAW (.1.3.6.1.4.1.36582.0.2)
const static char RAWa2[] PROGMEM = "1.3.6.1.4.1.36582.0.2"; // read-only (Integer)
// .iso.org.dod.internet.private.enterprises.arduino.RAW (.1.3.6.1.4.1.36582.0.3)
const static char RAWa3[] PROGMEM = "1.3.6.1.4.1.36582.0.3"; // read-only (Integer)
// .iso.org.dod.internet.private.enterprises.arduino.RAW (.1.3.6.1.4.1.36582.0.4)
//const static char RAWa4[] PROGMEM = "1.3.6.1.4.1.36582.0.4"; // read-only (Integer)
// .iso.org.dod.internet.private.enterprises.arduino.RAW (.1.3.6.1.4.1.36582.0.5)
const static char RAWa5[] PROGMEM = "1.3.6.1.4.1.36582.0.5"; // read-only (Integer)
// .iso.org.dod.internet.private.enterprises.arduino.RAW (.1.3.6.1.4.1.36582.1.0)
//const static char RAWd0[] PROGMEM = "1.3.6.1.4.1.36582.1.0"; // read-only (Integer)
// .iso.org.dod.internet.private.enterprises.arduino.RAW (.1.3.6.1.4.1.36582.1.1)
//const static char RAWd1[] PROGMEM = "1.3.6.1.4.1.36582.1.1"; // read-only (Integer)
// .iso.org.dod.internet.private.enterprises.arduino.RAW (.1.3.6.1.4.1.36582.1.2)
const static char RAWd2[] PROGMEM = "1.3.6.1.4.1.36582.1.2"; // read-only (Integer)
// .iso.org.dod.internet.private.enterprises.arduino.RAW (.1.3.6.1.4.1.36582.1.3)
const static char RAWd3[] PROGMEM = "1.3.6.1.4.1.36582.1.3"; // read-only (Integer)
// .iso.org.dod.internet.private.enterprises.arduino.RAW (.1.3.6.1.4.1.36582.1.4)
const static char RAWd4[] PROGMEM = "1.3.6.1.4.1.36582.1.4"; // read-only (Integer)
// .iso.org.dod.internet.private.enterprises.arduino.RAW (.1.3.6.1.4.1.36582.1.5)
const static char RAWd5[] PROGMEM = "1.3.6.1.4.1.36582.1.5"; // read-only (Integer)
// .iso.org.dod.internet.private.enterprises.arduino.RAW (.1.3.6.1.4.1.36582.1.6)
const static char RAWd6[] PROGMEM = "1.3.6.1.4.1.36582.1.6"; // read-only (Integer)
// .iso.org.dod.internet.private.enterprises.arduino.RAW (.1.3.6.1.4.1.36582.1.7)
const static char RAWd7[] PROGMEM = "1.3.6.1.4.1.36582.1.7"; // read-only (Integer)
// .iso.org.dod.internet.private.enterprises.arduino.RAW (.1.3.6.1.4.1.36582.1.8)
const static char RAWd8[] PROGMEM = "1.3.6.1.4.1.36582.1.8"; // read-only (Integer)
// .iso.org.dod.internet.private.enterprises.arduino.RAW (.1.3.6.1.4.1.36582.1.9)
const static char RAWd9[] PROGMEM = "1.3.6.1.4.1.36582.1.9"; // read-only (Integer)
// .iso.org.dod.internet.private.enterprises.arduino.RAW (.1.3.6.1.4.1.36582.1.10)
//const static char RAWd10[] PROGMEM = "1.3.6.1.4.1.36582.1.10"; // read-only (Integer)
// .iso.org.dod.internet.private.enterprises.arduino.RAW (.1.3.6.1.4.1.36582.1.11)
//const static char RAWd11[] PROGMEM = "1.3.6.1.4.1.36582.1.11"; // read-only (Integer)
// .iso.org.dod.internet.private.enterprises.arduino.RAW (.1.3.6.1.4.1.36582.1.12)
//const static char RAWd12[] PROGMEM = "1.3.6.1.4.1.36582.1.12"; // read-only (Integer)
// .iso.org.dod.internet.private.enterprises.arduino.RAW (.1.3.6.1.4.1.36582.1.13)
//const static char RAWd13[] PROGMEM = "1.3.6.1.4.1.36582.1.13"; // read-only (Integer)
//
//
// RFC1213 local values
static char locDescr[] = "Agentuino, a light-weight SNMP Agent."; // read-only (static)
static char locObjectID[] = "1.3.6.1.3.2009.0"; // read-only (static)
static uint32_t locUpTime = 0; // read-only (static)
static char locContact[20] = ""; // should be stored/read from EEPROM - read/write (not done for simplicity)
static char locName[20] = "Sensor"; // should be stored/read from EEPROM - read/write (not done for simplicity)
static char locLocation[20] = ""; // should be stored/read from EEPROM - read/write (not done for simplicity)
static int32_t locServices = 7; // read-only (static)
uint32_t prevMillis = millis();
char oid[SNMP_MAX_OID_LEN];
SNMP_API_STAT_CODES api_status;
SNMP_ERR_CODES status;
void pduReceived()
{
SNMP_PDU pdu;
//
#ifdef DEBUG
Serial << F("UDP Packet Received Start..") << F(" RAM:") << freeMemory() << endl;
#endif
//
api_status = Agentuino.requestPdu(&pdu);
//
if ( pdu.type == SNMP_PDU_GET || pdu.type == SNMP_PDU_GET_NEXT || pdu.type == SNMP_PDU_SET
&& pdu.error == SNMP_ERR_NO_ERROR && api_status == SNMP_API_STAT_SUCCESS ) {
//
pdu.OID.toString(oid);
//
//Serial << "OID: " << oid << endl;
//
if ( strcmp_P(oid, sysDescr ) == 0 ) {
// handle sysDescr (set/get) requests
if ( pdu.type == SNMP_PDU_SET ) {
// response packet from set-request - object is read-only
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = SNMP_ERR_READ_ONLY;
} else {
// response packet from get-request - locDescr
status = pdu.VALUE.encode(SNMP_SYNTAX_OCTETS, locDescr);
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = status;
}
//
#ifdef DEBUG
Serial << F("sysDescr...") << locDescr << F(" ") << pdu.VALUE.size << endl;
#endif
} else if ( strcmp_P(oid, sysUpTime ) == 0 ) {
// handle sysName (set/get) requests
if ( pdu.type == SNMP_PDU_SET ) {
// response packet from set-request - object is read-only
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = SNMP_ERR_READ_ONLY;
} else {
// response packet from get-request - locUpTime
status = pdu.VALUE.encode(SNMP_SYNTAX_TIME_TICKS, locUpTime);
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = status;
}
//
#ifdef DEBUG
Serial << F("sysUpTime...") << locUpTime << F(" ") << pdu.VALUE.size << endl;
#endif
} else if ( strcmp_P(oid, sysName ) == 0 ) {
// handle sysName (set/get) requests
if ( pdu.type == SNMP_PDU_SET ) {
// response packet from set-request - object is read/write
status = pdu.VALUE.decode(locName, strlen(locName));
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = status;
} else {
// response packet from get-request - locName
status = pdu.VALUE.encode(SNMP_SYNTAX_OCTETS, locName);
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = status;
}
//
#ifdef DEBUG
Serial << F("sysName...") << locName << F(" ") << pdu.VALUE.size << endl;
#endif
} else if ( strcmp_P(oid, sysContact ) == 0 ) {
// handle sysContact (set/get) requests
if ( pdu.type == SNMP_PDU_SET ) {
// response packet from set-request - object is read/write
status = pdu.VALUE.decode(locContact, strlen(locContact));
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = status;
} else {
// response packet from get-request - locContact
status = pdu.VALUE.encode(SNMP_SYNTAX_OCTETS, locContact);
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = status;
}
//
#ifdef DEBUG
Serial << F("sysContact...") << locContact << F(" ") << pdu.VALUE.size << endl;
#endif
} else if ( strcmp_P(oid, sysLocation ) == 0 ) {
// handle sysLocation (set/get) requests
if ( pdu.type == SNMP_PDU_SET ) {
// response packet from set-request - object is read/write
status = pdu.VALUE.decode(locLocation, strlen(locLocation));
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = status;
} else {
// response packet from get-request - locLocation
status = pdu.VALUE.encode(SNMP_SYNTAX_OCTETS, locLocation);
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = status;
}
//
#ifdef DEBUG
Serial << F("sysLocation...") << locLocation << F(" ") << pdu.VALUE.size << endl;
#endif
} else if ( strcmp_P(oid, sysServices) == 0 ) {
// handle sysServices (set/get) requests
if ( pdu.type == SNMP_PDU_SET ) {
// response packet from set-request - object is read-only
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = SNMP_ERR_READ_ONLY;
} else {
// response packet from get-request - locServices
status = pdu.VALUE.encode(SNMP_SYNTAX_INT, locServices);
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = status;
}
//
#ifdef DEBUG
Serial << F("locServices...") << locServices << F(" ") << pdu.VALUE.size << endl;
#endif
} else if ( strcmp_P(oid, RAWa0) == 0 ) {
int rawReading = 0;
// handle RAW (set/get) requests
if ( pdu.type == SNMP_PDU_SET ) {
// response packet from set-request - object is read-only
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = SNMP_ERR_READ_ONLY;
} else {
// response packet from get-request - RAW
rawReading = analogRead(A0); // Range : 0..1024
status = pdu.VALUE.encode(SNMP_SYNTAX_INT, rawReading);
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = status;
}
//
#ifdef DEBUG
Serial << F("RAWa0...") << rawReading << F(" ") << pdu.VALUE.size << endl;
#endif
} else if ( strcmp_P(oid, RAWa1) == 0 ) {
int rawReading = 0;
// handle RAW (set/get) requests
if ( pdu.type == SNMP_PDU_SET ) {
// response packet from set-request - object is read-only
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = SNMP_ERR_READ_ONLY;
} else {
// response packet from get-request - RAW
rawReading = analogRead(A1); // Range : 0..1024
status = pdu.VALUE.encode(SNMP_SYNTAX_INT, rawReading);
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = status;
}
//
#ifdef DEBUG
Serial << F("RAW...") << rawReading << F(" ") << pdu.VALUE.size << endl;
#endif
} else if ( strcmp_P(oid, RAWa2) == 0 ) {
int rawReading = 0;
// handle RAW (set/get) requests
if ( pdu.type == SNMP_PDU_SET ) {
// response packet from set-request - object is read-only
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = SNMP_ERR_READ_ONLY;
} else {
// response packet from get-request - RAW
rawReading = analogRead(A2); // Range : 0..1024
status = pdu.VALUE.encode(SNMP_SYNTAX_INT, rawReading);
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = status;
}
//
#ifdef DEBUG
Serial << F("RAWa2...") << rawReading << F(" ") << pdu.VALUE.size << endl;
#endif
} else if ( strcmp_P(oid, RAWa3) == 0 ) {
int rawReading = 0;
// handle RAW (set/get) requests
if ( pdu.type == SNMP_PDU_SET ) {
// response packet from set-request - object is read-only
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = SNMP_ERR_READ_ONLY;
} else {
// response packet from get-request - RAW
rawReading = analogRead(A3); // Range : 0..1024
status = pdu.VALUE.encode(SNMP_SYNTAX_INT, rawReading);
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = status;
}
//
#ifdef DEBUG
Serial << F("RAWa3...") << rawReading << F(" ") << pdu.VALUE.size << endl;
#endif
// } else if ( strcmp_P(oid, RAWa4) == 0 ) {
// int rawReading = 0;
// // handle RAW (set/get) requests
// if ( pdu.type == SNMP_PDU_SET ) {
// // response packet from set-request - object is read-only
// pdu.type = SNMP_PDU_RESPONSE;
// pdu.error = SNMP_ERR_READ_ONLY;
// } else {
// // response packet from get-request - RAW
// rawReading = analogRead(A4); // Range : 0..1024
// status = pdu.VALUE.encode(SNMP_SYNTAX_INT, rawReading);
// pdu.type = SNMP_PDU_RESPONSE;
// pdu.error = status;
// }
// //
// #ifdef DEBUG
// Serial << F("RAWa4...") << rawReading << F(" ") << pdu.VALUE.size << endl;
// #endif
} else if ( strcmp_P(oid, RAWa5) == 0 ) {
int rawReading = 0;
// handle RAW (set/get) requests
if ( pdu.type == SNMP_PDU_SET ) {
// response packet from set-request - object is read-only
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = SNMP_ERR_READ_ONLY;
} else {
// response packet from get-request - RAW
rawReading = analogRead(A5); // Range : 0..1024
status = pdu.VALUE.encode(SNMP_SYNTAX_INT, rawReading);
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = status;
}
//
#ifdef DEBUG
Serial << F("RAWa5...") << rawReading << F(" ") << pdu.VALUE.size << endl;
#endif
// } else if ( strcmp_P(oid, RAWd0) == 0 ) {
// int rawReading = 0;
// // handle RAW (set/get) requests
// if ( pdu.type == SNMP_PDU_SET ) {
// // response packet from set-request - object is read-only
// pdu.type = SNMP_PDU_RESPONSE;
// pdu.error = SNMP_ERR_READ_ONLY;
// } else {
// // response packet from get-request - RAW
// if (digitalRead(0) == LOW) {
// rawReading = 1; // Range : 0..1
// }
// status = pdu.VALUE.encode(SNMP_SYNTAX_INT, rawReading);
// pdu.type = SNMP_PDU_RESPONSE;
// pdu.error = status;
// }
// //
// #ifdef DEBUG
// Serial << F("RAWd0...") << rawReading << F(" ") << pdu.VALUE.size << endl;
// #endif
// } else if ( strcmp_P(oid, RAWd1) == 0 ) {
// int rawReading = 0;
// // handle RAW (set/get) requests
// if ( pdu.type == SNMP_PDU_SET ) {
// // response packet from set-request - object is read-only
// pdu.type = SNMP_PDU_RESPONSE;
// pdu.error = SNMP_ERR_READ_ONLY;
// } else {
// // response packet from get-request - RAW
// if (digitalRead(1) == LOW) {
// rawReading = 1; // Range : 0..1
// } status = pdu.VALUE.encode(SNMP_SYNTAX_INT, rawReading);
// pdu.type = SNMP_PDU_RESPONSE;
// pdu.error = status;
// }
// //
// #ifdef DEBUG
// Serial << F("RAWd1...") << rawReading << F(" ") << pdu.VALUE.size << endl;
// #endif
} else if ( strcmp_P(oid, RAWd2) == 0 ) {
int rawReading = 0;
// handle RAW (set/get) requests
if ( pdu.type == SNMP_PDU_SET ) {
// response packet from set-request - object is read-only
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = SNMP_ERR_READ_ONLY;
} else {
// response packet from get-request - RAW
if (digitalRead(2) == LOW) {
rawReading = 1; // Range : 0..1
}
status = pdu.VALUE.encode(SNMP_SYNTAX_INT, rawReading);
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = status;
}
//
#ifdef DEBUG
Serial << F("RAWd2...") << rawReading << F(" ") << pdu.VALUE.size << endl;
#endif
} else if ( strcmp_P(oid, RAWd3) == 0 ) {
int rawReading = 0;
// handle RAW (set/get) requests
if ( pdu.type == SNMP_PDU_SET ) {
// response packet from set-request - object is read-only
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = SNMP_ERR_READ_ONLY;
} else {
// response packet from get-request - RAW
if (digitalRead(3) == LOW) {
rawReading = 1; // Range : 0..1
}
status = pdu.VALUE.encode(SNMP_SYNTAX_INT, rawReading);
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = status;
}
//
#ifdef DEBUG
Serial << F("RAWd3...") << rawReading << F(" ") << pdu.VALUE.size << endl;
#endif
} else if ( strcmp_P(oid, RAWd4) == 0 ) {
int rawReading = 0;
// handle RAW (set/get) requests
if ( pdu.type == SNMP_PDU_SET ) {
// response packet from set-request - object is read-only
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = SNMP_ERR_READ_ONLY;
} else {
// response packet from get-request - RAW
if (digitalRead(4) == LOW) {
rawReading = 1; // Range : 0..1
}
status = pdu.VALUE.encode(SNMP_SYNTAX_INT, rawReading);
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = status;
}
//
#ifdef DEBUG
Serial << F("RAWd4...") << rawReading << F(" ") << pdu.VALUE.size << endl;
#endif
} else if ( strcmp_P(oid, RAWd5) == 0 ) {
int rawReading = 0;
// handle RAW (set/get) requests
if ( pdu.type == SNMP_PDU_SET ) {
// response packet from set-request - object is read-only
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = SNMP_ERR_READ_ONLY;
} else {
// response packet from get-request - RAW
if (digitalRead(5) == LOW) {
rawReading = 1; // Range : 0..1
}
status = pdu.VALUE.encode(SNMP_SYNTAX_INT, rawReading);
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = status;
}
//
#ifdef DEBUG
Serial << F("RAWd5...") << rawReading << F(" ") << pdu.VALUE.size << endl;
#endif
} else if ( strcmp_P(oid, RAWd6) == 0 ) {
int rawReading = 0;
// handle RAW (set/get) requests
if ( pdu.type == SNMP_PDU_SET ) {
// response packet from set-request - object is read-only
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = SNMP_ERR_READ_ONLY;
} else {
// response packet from get-request - RAW
if (digitalRead(6) == LOW) {
rawReading = 1; // Range : 0..1
}
status = pdu.VALUE.encode(SNMP_SYNTAX_INT, rawReading);
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = status;
}
//
#ifdef DEBUG
Serial << F("RAWd6...") << rawReading << F(" ") << pdu.VALUE.size << endl;
#endif
} else if ( strcmp_P(oid, RAWd7) == 0 ) {
int rawReading = 0;
// handle RAW (set/get) requests
if ( pdu.type == SNMP_PDU_SET ) {
// response packet from set-request - object is read-only
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = SNMP_ERR_READ_ONLY;
} else {
// response packet from get-request - RAW
if (digitalRead(7) == LOW) {
rawReading = 1; // Range : 0..1
}
status = pdu.VALUE.encode(SNMP_SYNTAX_INT, rawReading);
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = status;
}
//
#ifdef DEBUG
Serial << F("RAWd7...") << rawReading << F(" ") << pdu.VALUE.size << endl;
#endif
} else if ( strcmp_P(oid, RAWd8) == 0 ) {
int rawReading = 0;
// handle RAW (set/get) requests
if ( pdu.type == SNMP_PDU_SET ) {
// response packet from set-request - object is read-only
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = SNMP_ERR_READ_ONLY;
} else {
// response packet from get-request - RAW
if (digitalRead(8) == LOW) {
rawReading = 1; // Range : 0..1
}
status = pdu.VALUE.encode(SNMP_SYNTAX_INT, rawReading);
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = status;
}
//
#ifdef DEBUG
Serial << F("RAWd8...") << rawReading << F(" ") << pdu.VALUE.size << endl;
#endif
} else if ( strcmp_P(oid, RAWd9) == 0 ) {
int rawReading = 0;
// handle RAW (set/get) requests
if ( pdu.type == SNMP_PDU_SET ) {
// response packet from set-request - object is read-only
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = SNMP_ERR_READ_ONLY;
} else {
// response packet from get-request - RAW
if (digitalRead(9) == LOW) {
rawReading = 1; // Range : 0..1
}
status = pdu.VALUE.encode(SNMP_SYNTAX_INT, rawReading);
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = status;
}
//
#ifdef DEBUG
Serial << F("RAWd9...") << rawReading << F(" ") << pdu.VALUE.size << endl;
#endif
// } else if ( strcmp_P(oid, RAWd10) == 0 ) {
// int rawReading = 0;
// // handle RAW (set/get) requests
// if ( pdu.type == SNMP_PDU_SET ) {
// // response packet from set-request - object is read-only
// pdu.type = SNMP_PDU_RESPONSE;
// pdu.error = SNMP_ERR_READ_ONLY;
// } else {
// // response packet from get-request - RAW
// if (digitalRead(10) == LOW) {
// rawReading = 1; // Range : 0..1
// }
// status = pdu.VALUE.encode(SNMP_SYNTAX_INT, rawReading);
// pdu.type = SNMP_PDU_RESPONSE;
// pdu.error = status;
// }
// //
// #ifdef DEBUG
// Serial << F("RAWd10...") << rawReading << F(" ") << pdu.VALUE.size << endl;
// #endif
// } else if ( strcmp_P(oid, RAWd11) == 0 ) {
// int rawReading = 0;
// // handle RAW (set/get) requests
// if ( pdu.type == SNMP_PDU_SET ) {
// // response packet from set-request - object is read-only
// pdu.type = SNMP_PDU_RESPONSE;
// pdu.error = SNMP_ERR_READ_ONLY;
// } else {
// // response packet from get-request - RAW
// if (digitalRead(11) == LOW) {
// rawReading = 1; // Range : 0..1
// }
// status = pdu.VALUE.encode(SNMP_SYNTAX_INT, rawReading);
// pdu.type = SNMP_PDU_RESPONSE;
// pdu.error = status;
// }
// //
// #ifdef DEBUG
// Serial << F("RAWd11...") << rawReading << F(" ") << pdu.VALUE.size << endl;
// #endif
// } else if ( strcmp_P(oid, RAWd12) == 0 ) {
// int rawReading = 0;
// // handle RAW (set/get) requests
// if ( pdu.type == SNMP_PDU_SET ) {
// // response packet from set-request - object is read-only
// pdu.type = SNMP_PDU_RESPONSE;
// pdu.error = SNMP_ERR_READ_ONLY;
// } else {
// // response packet from get-request - RAW
// if (digitalRead(12) == LOW) {
// rawReading = 1; // Range : 0..1
// }
// status = pdu.VALUE.encode(SNMP_SYNTAX_INT, rawReading);
// pdu.type = SNMP_PDU_RESPONSE;
// pdu.error = status;
// }
// //
// #ifdef DEBUG
// Serial << F("RAWd12...") << rawReading << F(" ") << pdu.VALUE.size << endl;
// #endif
// } else if ( strcmp_P(oid, RAWd13) == 0 ) {
// int rawReading = 0;
// // handle RAW (set/get) requests
// if ( pdu.type == SNMP_PDU_SET ) {
// // response packet from set-request - object is read-only
// pdu.type = SNMP_PDU_RESPONSE;
// pdu.error = SNMP_ERR_READ_ONLY;
// } else {
// // response packet from get-request - RAW
// if (digitalRead(13) == LOW) {
// rawReading = 1; // Range : 0..1
// }
// status = pdu.VALUE.encode(SNMP_SYNTAX_INT, rawReading);
// pdu.type = SNMP_PDU_RESPONSE;
// pdu.error = status;
// }
// //
// #ifdef DEBUG
// Serial << F("RAWd13...") << rawReading << F(" ") << pdu.VALUE.size << endl;
// #endif
} else {
// oid does not exist
//
// response packet - object not found
pdu.type = SNMP_PDU_RESPONSE;
pdu.error = SNMP_ERR_NO_SUCH_NAME;
}
//
Agentuino.responsePdu(&pdu);
}
//
Agentuino.freePdu(&pdu);
//
//Serial << "UDP Packet Received End.." << " RAM:" << freeMemory() << endl;
}
void setup()
{
Serial.begin(9600);
Ethernet.begin(mac, ip);
//
//
pinMode(A1, INPUT);
pinMode(A0, INPUT);
pinMode(A2, INPUT);
pinMode(A3, INPUT);
// pinMode(A4, INPUT);
pinMode(A5, INPUT);
// pinMode(0, INPUT);
// pinMode(1, INPUT);
pinMode(2, INPUT);
pinMode(3, INPUT);
pinMode(4, INPUT);
pinMode(5, INPUT);
pinMode(6, INPUT);
pinMode(7, INPUT);
pinMode(8, INPUT);
pinMode(9, INPUT);
// pinMode(10, INPUT);
// pinMode(11, INPUT);
// pinMode(12, INPUT);
// pinMode(13, INPUT);
//digitalWrite(0, HIGH);
//digitalWrite(1, HIGH);
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);
//digitalWrite(10, HIGH);
//digitalWrite(11, HIGH);
//digitalWrite(12, HIGH);
//digitalWrite(13, HIGH);
api_status = Agentuino.begin();
if ( api_status == SNMP_API_STAT_SUCCESS ) {
//
Agentuino.onPduReceive(pduReceived);
//
delay(10);
//
Serial << F("SNMP Agent Initalized...") << endl;
//
return;
}
//
delay(10);
//
Serial << F("SNMP Agent Initalization Problem...") << status << endl;
}
void loop()
{
// listen/handle for incoming SNMP requests
Agentuino.listen();
//
// sysUpTime - The time (in hundredths of a second) since
// the network management portion of the system was last
// re-initialized.
if ( millis() - prevMillis > 1000 ) {
// increment previous milliseconds
prevMillis += 1000;
//
// increment up-time counter
locUpTime += 100;
}
}
</code></pre>
<span style="background-color: white; color: #222222; font-family: "arial" , "tahoma" , "helvetica" , "freesans" , sans-serif; font-size: xx-small; line-height: 12.6000003814697px;">Formatted for web with </span><a href="http://codeformatter.blogspot.com/" style="background-color: white; color: #888888; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: xx-small; line-height: 12.6000003814697px; text-decoration: none;">http://codeformatter.blogspot.com/</a><span style="background-color: white; color: #222222; font-family: "arial" , "tahoma" , "helvetica" , "freesans" , sans-serif; font-size: xx-small; line-height: 12.6000003814697px;"> </span>
<br />
<br />
With this sketch, the pin inputs I can read are:<br />
Analog 0, 1, 2, 3, 5 - Values returned - integer 0 - 1024 (0 - 5V Input)<br />
Digital 2, 3, 4, 5, 6, 7, 8, 9 - Values returned - integer 0 (Open to GND) or 1 (Closed to GND)<br />
<br />
I'm only using analog pin 1 to read in my 15 PSI sensor. At first, I was doing all the math on the Arduino, but it made it less flexible, so I've moved all my math and formulas for water - Analog input to Volts, PSI to inch/feet of water, and height of water to gallons based on tank shape and size - into PowerShell.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-4yS7enh0C6A/VWNqBwude1I/AAAAAAAAGgY/gucpwVcdmsc/s1600/%2524_57_top.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="165" src="https://4.bp.blogspot.com/-4yS7enh0C6A/VWNqBwude1I/AAAAAAAAGgY/gucpwVcdmsc/s200/%2524_57_top.JPG" width="200" /></a></div>
<br />
To read the sensor, you apply 5V power and ground from the Arduino to it and measure the signal input as 0 - 1024 input.<br />
<br />
I noticed the math wasn't working out when I checked the actual inches of water versus what my sensor was reporting. The biggest variable appears to be the input voltage from your power source. I have found some USB wall adapters vary as much as 4.55 - 4.98 VDC. So, be sure to take the actual reference voltage before finalizing your formulas on reading in from analog pins.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoA2pOLacAAu-MMgtKcmpppBQDtSCumC6sinZDcSMvojy4WiC0ClqKvbVnUmL5Z2Suy_WrLEx8A9NmBa6PAiPUZel1cTF8-Cj3c9zJvg0JLZ4A0XbfcNXHbVmBkNx1VotHxPz1lY55D4I/s1600/agentuino_my_sketch.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="214" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoA2pOLacAAu-MMgtKcmpppBQDtSCumC6sinZDcSMvojy4WiC0ClqKvbVnUmL5Z2Suy_WrLEx8A9NmBa6PAiPUZel1cTF8-Cj3c9zJvg0JLZ4A0XbfcNXHbVmBkNx1VotHxPz1lY55D4I/s640/agentuino_my_sketch.png" width="640" /></a></div>
<br />
I'll share my PowerShell function's details - which makes this easy to adjust reference voltage input - in Part 4.<br />
<br />
<br />Justin Bennetthttp://www.blogger.com/profile/08685325767450711504noreply@blogger.com4tag:blogger.com,1999:blog-8394280631537425165.post-5063139973072062912015-04-14T14:36:00.000-07:002016-12-13T10:09:56.818-08:00Use Powershell to Change Host's FQDN / SuffixI'm attempting to setup 6 Windows Server 2012 R2 RDP Session Host servers all via the CLI using PowerShell.<br />
<br />
When it came time to configure the machine's name, domain, and Primary FQDN, I could rename the computer (<a href="https://technet.microsoft.com/en-us/library/hh849792.aspx" target="_blank">Rename-Computer</a>), add it to a domain (<a href="https://technet.microsoft.com/en-us/library/hh849798.aspx" target="_blank">Add-Computer</a>), but I got stuck trying to update / change the Primary DNS suffix of this computer, as there was no way I could find - other than using ancient <a href="https://support.microsoft.com/en-us/kb/298593" target="_blank">netdom.exe</a>, not my idea of PowerShell.<br />
<br />
I hacked around with this for a bit on some Windows Server 2012 R2 servers modifying the registry to make it happen. Updating Domain and NV Domain in the [HKLM\System\CurrentControlSet\Services\Tcpip\Parameters] initially seemed to work with no issue - <a href="https://technet.microsoft.com/en-us/library/aa998420%28v=exchg.80%29.aspx" target="_blank">https://technet.microsoft.com/en-us/library/aa998420%28v=exchg.80%29.aspx</a>.<br />
<br />
Later, I discovered that the SPN record information for AD computers also <a href="https://virtualcurtis.wordpress.com/2011/03/02/fix-the-security-database-on-the-server-does-not-have-a-computer-account-for-this-workstation-trust-relationship/" target="_blank">needed to be updated</a> or you get "The security database on the server does not have a computer account for this workstation trust relationship" error.<br />
<br />
Below is what I have been using and is seems to work, as long as it is Run as Administrator as a Local Administrator and from a Domain Admin account (if connected to an AD domain.)<br />
<br />
Current version at <a href="https://github.com/cajeeper/PowerShell/blob/master/Update-HostFQDN.ps1">https://github.com/cajeeper/PowerShell/blob/master/Update-HostFQDN.ps1</a><br />
<br />
Latest change: Added updating the dnsHostName attribute - Thanks to <a href="https://www.blogger.com/profile/00321275879533728499" rel="nofollow">Nan Zhang</a><br />
<br />
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;">$computerName = $env:computername
$DNSSuffix = "abc.com"
$oldDNSSuffix = (Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\" -Name "NV Domain")."NV Domain"
#Update primary DNS Suffix for FQDN
Set-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\" -Name Domain -Value $DNSSuffix
Set-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\" -Name "NV Domain" -Value $DNSSuffix
#Update DNS Suffix Search List - Win8/2012 and above - if needed
#Set-DnsClientGlobalSetting -SuffixSearchList $oldDNSSuffix,$DNSSuffix
#Update AD's SPN records for machine if part of an AD domain
if ((gwmi win32_computersystem).partofdomain -eq $true) {
$searchAD = new-object System.DirectoryServices.DirectorySearcher
$searchAD.filter = "(&(objectCategory=computer)(cn=$($computerName)))"
$searchADItem = $searchAD.FindAll() | select -first 1
$adObj= [ADSI] $searchADItem.Path
$oldadObjSPN = $searchADItem.Properties.serviceprincipalname
$adObj.Put('serviceprincipalname',($oldadObjSPN -replace $oldDNSSuffix, $DNSSuffix))
$oldadObjDNS = $searchADItem.Properties.dnsHostName
$adObj.Put('dnsHostName',($oldadObjDNS -replace $oldDNSSuffix, $DNSSuffix))
$adObj.setinfo()
#$adObj.Get('serviceprincipalname')
#$adObj.Get('dnsHostName')
}
</code></pre>
<span style="font-size: xx-small;">Formatted for web with <a href="http://codeformatter.blogspot.com/">http://codeformatter.blogspot.com/</a> </span>
<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8fvbbR3LqMHLHnL9zrTiucmlWHn4wv4xhqX0cNEtUpFC6G-7Jj-RNHiN7ewZluirpA2kzQ0cJfMT0kED33ZtkfeZWGRQ5zRvTQNQ_ZZJcarGnsSCC-ASMxqU1zuvWf5h8hx4vTikY1l0/s1600/CaptureSuffix1.PNG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="317" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8fvbbR3LqMHLHnL9zrTiucmlWHn4wv4xhqX0cNEtUpFC6G-7Jj-RNHiN7ewZluirpA2kzQ0cJfMT0kED33ZtkfeZWGRQ5zRvTQNQ_ZZJcarGnsSCC-ASMxqU1zuvWf5h8hx4vTikY1l0/s1600/CaptureSuffix1.PNG" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Before changing DNS Suffix via CLI / PowerShell</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBMxYgM_NIcQGkI56Sb83iL_7uS5kUU4-WUFar1Yb-eku8JXMwZBPRXTw42Xh3oK_UfqbejKGb1pASap0C5RmcXam05VNDFESgoG-jc-9pOzlQSASQgE-vEBOjLkDkr6DvKQG9cp-uc64/s1600/CaptureSuffix2.PNG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="409" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBMxYgM_NIcQGkI56Sb83iL_7uS5kUU4-WUFar1Yb-eku8JXMwZBPRXTw42Xh3oK_UfqbejKGb1pASap0C5RmcXam05VNDFESgoG-jc-9pOzlQSASQgE-vEBOjLkDkr6DvKQG9cp-uc64/s1600/CaptureSuffix2.PNG" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Ran CLI / PowerShell script to update Primary DNS Suffix</td></tr>
</tbody></table>
<br />
<div>
<div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBi9xF2kwPq2DFJwRfJRYCDxseHDXbLs_ajGhjawNRsQJs35Ta0M2S9N2qARW4iB-MTsvzpn4XfZkDmabzMGaTcCHvxee6VZr0kstfa3p2FY6tXVhrd-ifRiw4POoNPAJOpQ5vytV7sRM/s1600/CaptureSuffix3.PNG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBi9xF2kwPq2DFJwRfJRYCDxseHDXbLs_ajGhjawNRsQJs35Ta0M2S9N2qARW4iB-MTsvzpn4XfZkDmabzMGaTcCHvxee6VZr0kstfa3p2FY6tXVhrd-ifRiw4POoNPAJOpQ5vytV7sRM/s1600/CaptureSuffix3.PNG" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">After Running CLI / PowerShell script</td></tr>
</tbody></table>
<br />
Upward and onward!</div>
</div>
Justin Bennetthttp://www.blogger.com/profile/08685325767450711504noreply@blogger.com8tag:blogger.com,1999:blog-8394280631537425165.post-43695029650621291862015-03-10T20:14:00.002-07:002017-01-26T13:41:21.030-08:00Home Water System Pt 2 - Get and Set SNMPWith PowerShell, there's a couple of great options to purchase SNMP libraries to perform SNMP get and set. I had some success with OlePrn.OleSNMP class as UsPeoples, over at <a href="http://tomorrow.uspeoples.org/2014/12/powershell-using-snmp-for-html-network.html" target="_blank">tomorrow.uspeoples.org</a>, wrote about, but my success was short lived. It only supports SNMPv1 and attempting to do any of the Methods from three of my Windows 7 computers returns: <br />
<br />
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;">Exception calling "Get" with "1" argument(s): "WinSNMP API Error: For internal/undefined errors"
At line:1 char:10
+ $SNMP.Get <<<< (".1.3.6.1.2.1.1.5.0")
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ComMethodTargetInvocation
</code></pre>
<br />
Alternatively, I've been using a command-line (CLI) tool with PowerShell and capturing the output. Since there are a few old CLI tools for SNMP that are free, like snmpget.exe and snmpset.exe by snmpsoft (dot) com. I've been using this for my SNMP get and set routines to control my home brewed SCADA system for nearly a year now with no issue.<br />
<br />
So, where do we get started?<br />
<br />
You can capture any output from a CLI tool fairly easily. Just run the program inside of a PowerShell variable value, as such:<br />
<br />
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;">$output = mycli.exe
</code></pre>
<br />
That seems simple enough. Next, you need to ensure that you capture all of your CLI tool's output - or at least I prefer to - including any errors which sometimes sneak by. <a href="https://technet.microsoft.com/en-us/library/hh847746.aspx" target="_blank">about_Redirection</a> describes that 2>&1 at the end of your CLI tool will capture your success output along with any error output. You can also include all output with *>&1 - to each their own, but I prefer just errors and success output.<br />
<br />
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;">$output = mycli.exe 2>&1
</code></pre>
<br />
Wrap it all tight in a few functions and you just saved some dollars... on SNMP get and set funcitons.<br />
<br />
<u>PowerShell get-snmp function</u><br />
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: 450px; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> <#
.SYNOPSIS
Function to capture output from snmpget exe CLI tool.
.DESCRIPTION
Based on the parameters sent, the CLI tool will be triggered and the output will be returned based on the output.
.NOTES
Author : Justin Bennett
Date : 2015-03-10
Contact : http://www.allthingstechie.net
Revision : v1.01
Changes : v1.01 - Changed Write-Error to Throw
.PARAMETER ip
IP Address or Hostname
.PARAMETER ver
SNMP Version
.PARAMETER community
SNMP Community String to read the OID
.PARAMETER OID
SNMP OID to read
.PARAMETER returntype
Specify the preferred return type - gauge32, integer, string (Default), timeticks, or todate
.EXAMPLE
C:\PS> get-snmp -ip "192.168.0.10" -ver "1" -community "public" -oid "1.3.6.1.2.1.1.5.0"
sysLocation-Example
.EXAMPLE
C:\PS> #Get SNMP Contact Info
C:\PS> $oid = "1.3.6.1.2.1.1.4.0", "1.3.6.1.2.1.1.5.0", "1.3.6.1.2.1.1.6.0"
C:\PS> $oid | % { get-snmp -ip "192.168.0.10" -ver "1" -community "public" -oid $_ }
sysName-Example
sysLocation-Example
sysServices-Example
#>
function get-snmp {
[CmdletBinding()]
param (
[parameter(Mandatory = $true)] [string]$ip,
[parameter(Mandatory = $true)] [string]$ver,
[parameter(Mandatory = $true)] [string]$community,
[parameter(Mandatory = $true)] [string]$oid,
[parameter(Mandatory = $false)] [ValidateSet("timeticks","integer","gauge32","string","todate")] [string]$returntype = "string"
)
#location of the snmpget program
$snmpdir = ".\"
$output = (. $snmpdir\snmpget.exe -v:$ver -c:"$community" -r:$ip -o:$oid 2>&1) | select -skip 3
$outputsplit = $output -split "="
if ($outputsplit[0].tolower() -ne "oid") {
#one more try
$output = (. $snmpdir\snmpget.exe -v:$ver -c:"$community" -r:$ip -o:$oid 2>&1) | select -skip 3
$outputsplit = $output -split "="
}
switch ($outputsplit[0].tolower()) {
"oid" {
if($returntype -eq $null) { $returntype = $outputsplit[3] }
switch ($returntype.tolower()) {
"timeticks" {
$time = ($outputsplit[5]) -replace "\.", ":" -split ":"
return New-TimeSpan -hour $time[0] -min $time[1]
}
"integer" {
return [int]$outputsplit[5]
}
"gauge32" {
return [int]$outputsplit[5]
}
"string" {
return [string]$outputsplit[5]
}
"todate" {
return [datetime](get-date (($outputsplit[5]) -replace "`"",""))
}
default{
return $outputsplit[5]
}
}
}
default {
throw $output
}
}
}
</code></pre>
<span style="background-color: white; color: #222222; font-family: "arial" , "tahoma" , "helvetica" , "freesans" , sans-serif; font-size: xx-small; line-height: 12.6000003814697px;">Formatted for web with </span><a href="http://codeformatter.blogspot.com/" style="background-color: white; color: #888888; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: xx-small; line-height: 12.6000003814697px; text-decoration: none;">http://codeformatter.blogspot.com/</a><span style="background-color: white; color: #222222; font-family: "arial" , "tahoma" , "helvetica" , "freesans" , sans-serif; font-size: xx-small; line-height: 12.6000003814697px;"> </span><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhT79K8gUa9oVpLJdNoSXSILZo4zqARhWResifYHor-h7_xaSSGi7RSK1qfRAlf2b2Z9OXCq2ji0nTpp7jFJQo0Yrj11M4xRM0dWNXIvNVcqBitLOPjd6KXLmAGzeGyo3Y5JvpVS_y57zM/s1600/output.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="135" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhT79K8gUa9oVpLJdNoSXSILZo4zqARhWResifYHor-h7_xaSSGi7RSK1qfRAlf2b2Z9OXCq2ji0nTpp7jFJQo0Yrj11M4xRM0dWNXIvNVcqBitLOPjd6KXLmAGzeGyo3Y5JvpVS_y57zM/s1600/output.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Example Output</td></tr>
</tbody></table>
<br />
Cheers. Even more pieces to the puzzle coming soon.<br />
<br />
<br />Justin Bennetthttp://www.blogger.com/profile/08685325767450711504noreply@blogger.com0tag:blogger.com,1999:blog-8394280631537425165.post-3358965438048992592015-03-09T23:45:00.001-07:002015-03-10T21:23:25.099-07:00Home Water System Pt 1 - Give yourself to the Dark Side... of automation.<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
In the last few years, I've been leveraging PowerShell more and more. So much more, that I'm using it at home to control my fresh water well.<br />
<br />
Before I jump head first into the land of crazy, I'm going preface, this will be split up over a few posts. My goal by sharing this isn't to see a future full of PowerShell'd home water systems, but rather just to spark interest in others to break technical norms and explore what you can build. I can see many other uses for simple controlled SNMP devices all over.<br />
<br />
First, I'll give you a quick overview of how this is working logically as a system, then I'll show each key piece to the PowerShell puzzle in subsequent posts.<br />
<br />
To understand why I've done this and to see the benefit, I have to explain the traditional configuration of a fresh water well partnered with a ground level storage tank.<br />
<br />
WARNING: I'm a hack at best when it comes to water - so please don't take what I've done or what I say about water systems as advise. Consult a local professional.<br />
<br />
As described by <a href="http://support.cleanwaterstore.com/blog/how-home-well-water-pump-and-pressure-systems-work/" target="_blank">Clean Water Store</a>, my home water well "system uses a large storage tank to store the water before it is pumped again to the house", as depicted below. The portion I choose PowerShell to manage is controlling the start/stop and reading the amp draw for the submersible deep well pump and reading the storage tank's water level with a pressure sensor.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://4.bp.blogspot.com/-EnobthlOYw8/VP6D2KnbDVI/AAAAAAAAGWk/kHt6wtb_bXw/s1600/above-ground-storage-tank-corrected.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://4.bp.blogspot.com/-EnobthlOYw8/VP6D2KnbDVI/AAAAAAAAGWk/kHt6wtb_bXw/s1600/above-ground-storage-tank-corrected.jpg" height="400" width="321" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><a href="http://support.cleanwaterstore.com/blog/how-home-well-water-pump-and-pressure-systems-work/" target="_blank">http://support.cleanwaterstore.com/blog/how-home-well-water-pump-and-pressure-systems-work/</a></td></tr>
</tbody></table>
<br />
With those two components, I have two .ps1 scripts that run. The first .ps1 is used to fill my storage tank every other day in set 15 min increments for the course of one evening. This is done by 1) reading the water level in the tank to limit the max amount of water 2) the amperage being drawn off the pump when it is running as to not damage the pump should it draw too much amps or begin to suck air. At the end of each fill, a follow-up report is sent with the details of each run. The second .ps1 reports on the tank's water level readings sent every 12 hours. The booster pump still depends on a pressure switch to run and is not yet monitored.<br />
<br />
Two main benefits in doing this is: 1) I know how much water is in my water storage tank, and 2) I know as soon as my deep well pump begins to have a problem, so I have time to react before all of my stored water is gone. Additionally, I have the ability to control the timing of how long and when the pump runs beyond the limits of mechanical control timers.<br />
<br />
As you can see, PowerShell can be leveraged as your own SCADA system limited by your own imagination.<br />
<br />
My system consists of a low power consumption PC running Windows 7 (Dell OptiPlex FX170), an APC Rack PDU AP7940 to control the well pump, and an Arduino UNO R3 with a 3 wire 15 psi water pressure sensor and a Ethernet Shield. The script makes all the calls via SNMP to read the devices and control the power to the well pump.<br />
<br />
<div style="text-align: center;">
Pre-Automation</div>
<div style="text-align: center;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-kq_euHcLiJ0/VP6P9Z8B8eI/AAAAAAAAGYQ/iFGL6T0641I/s1600/CAM00379.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://2.bp.blogspot.com/-kq_euHcLiJ0/VP6P9Z8B8eI/AAAAAAAAGYQ/iFGL6T0641I/s1600/CAM00379.jpg" height="192" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Building the "water shed" for my pumps</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/-iHEfC7l7aQI/VP6O5qnH2mI/AAAAAAAAGXw/msxwYuwFPIM/s1600/CAM00524.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://3.bp.blogspot.com/-iHEfC7l7aQI/VP6O5qnH2mI/AAAAAAAAGXw/msxwYuwFPIM/s1600/CAM00524.jpg" height="192" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Assembling Pumps and Pipes<br />
Deep pump controller wired to tank's float shut-off and bypass switch </td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-_VFUU7sYUSk/VP6PEbgB21I/AAAAAAAAGX4/d86lHOm1_ng/s1600/CAM00600.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://1.bp.blogspot.com/-_VFUU7sYUSk/VP6PEbgB21I/AAAAAAAAGX4/d86lHOm1_ng/s1600/CAM00600.jpg" height="192" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Pipes and pumps connected</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-ZhpHaHNd4cw/VP6PSdgQGdI/AAAAAAAAGYA/ZI6FE06RfwQ/s1600/CAM00601.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-ZhpHaHNd4cw/VP6PSdgQGdI/AAAAAAAAGYA/ZI6FE06RfwQ/s1600/CAM00601.jpg" height="192" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
Post-Automation</div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-9oL5NGknzYA/VP6Kn0oV7pI/AAAAAAAAGW0/3wdcFqIOpeU/s1600/Capture.PNG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://2.bp.blogspot.com/-9oL5NGknzYA/VP6Kn0oV7pI/AAAAAAAAGW0/3wdcFqIOpeU/s1600/Capture.PNG" height="335" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">APC Rack PDU Interface</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-C6OtrhrbBo0/VP6LGwptKNI/AAAAAAAAGW8/L5t_EVh26zI/s1600/unnamed.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://2.bp.blogspot.com/-C6OtrhrbBo0/VP6LGwptKNI/AAAAAAAAGW8/L5t_EVh26zI/s1600/unnamed.png" height="256" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Run Well Pump .ps1 Report Image </td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-4n6OZL7bo9M/VP6MELjL3PI/AAAAAAAAGXU/RJBPtUMNPvE/s1600/DSC_0352.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://1.bp.blogspot.com/-4n6OZL7bo9M/VP6MELjL3PI/AAAAAAAAGXU/RJBPtUMNPvE/s1600/DSC_0352.JPG" height="400" width="225" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">APC Rack PDU<br />
Deep pump wired to C19 plug and bypass switch</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-l6xwsZ4Sko0/VP6Mdz2-VbI/AAAAAAAAGXc/qrq0ftHMRBo/s1600/DSC_0717.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://2.bp.blogspot.com/-l6xwsZ4Sko0/VP6Mdz2-VbI/AAAAAAAAGXc/qrq0ftHMRBo/s1600/DSC_0717.JPG" height="400" width="225" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Arduino with Ethernet shield used to read water pressure</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-84J966HDpco/VP6Mju2MHrI/AAAAAAAAGXk/z0N_hinjzGk/s1600/DSC_0715.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://2.bp.blogspot.com/-84J966HDpco/VP6Mju2MHrI/AAAAAAAAGXk/z0N_hinjzGk/s1600/DSC_0715.JPG" height="400" width="225" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Pressure sensor<br />
Thoroughly wrapped by black 10 mil pipe wrap</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
More explanation of this mayhem to be continued...Justin Bennetthttp://www.blogger.com/profile/08685325767450711504noreply@blogger.com1tag:blogger.com,1999:blog-8394280631537425165.post-75990472956350554722015-02-07T10:04:00.001-08:002015-12-09T14:00:45.830-08:00Backup Zen Load Balancer using PowerShell and System.Net.WebClientI really like backups. Full backups of systems are nice. Call me crazy, but they are to me. When we started using ZenLoadBalancer, we ran into a small dilemma.<br />
<br />
We use Microsoft Data Protection Manager 2012 for our primary backup system and Hyper-V 2008 R2 / 2012 for our primary hyper-visors - not the best of either and the equivalent of oil and water when it comes to backing up virtual Linux machines. It will pause the virtual machine during backup and cause the load balancers - if in a zen cluster like ours - to fail-over.<br />
<br />
So... used good old PowerShell to write a backup routine.<br />
<br />
What does it do?<br />
<ol>
<li>Logs into the management console of the Zen Load Balancer</li>
<li>Creates a backup in the console</li>
<li>Downloads the backup file to a local directory</li>
<li>Optionally - Multiple ZenLB backup jobs at once, creates a log file, sends email notifications of statuses, and purges old backup files</li>
</ol>
<div>
We have four ZenLoadBalancer we're using and this script has been working since September of last year with no issues.<br />
<br />
Note: Its scheduled to run three times a day via Task Scheduler using:<br />
<ul>
<li>powershell.exe -executionpolicy bypass -file backup-zenlb.ps1</li>
</ul>
</div>
<div>
Current version at <a href="https://github.com/cajeeper/PowerShell/blob/master/backup-zenlb.ps1">https://github.com/cajeeper/PowerShell/blob/master/backup-zenlb.ps1</a><br />
<br /></div>
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: 400px; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> <#
.SYNOPSIS
Create ZenLoadBalancer Backup and Download
.DESCRIPTION
Based on the parameters saved in the .ps1, each Zen Load Balancer will be contacted to trigger a backup and download and save the backup file(s) by host(s) and date/time.
Optionally: Log, Email Notify, Purge Old Backups
.NOTES
Author : Justin Bennett
Date : 2014-09-26
Contact : http://www.allthingstechie.net/
Revision : v1.1
History : v1.0 written for Zen 3.03
v1.1 added support for Zen 3.05
References : Allow untrusted SSL - http://blogs.technet.com/b/bshukla/archive/2010/04/12/ignoring-ssl-trust-in-powershell-system-net-webClient.aspx
#>
#uservariables
#
$scriptRoot = $pwd
#$scriptRoot = "D:\ZenLoadBalancers\batch\"
$backupJobs = @{}
$backupJobs[0] = @{}
$backupJobs[0]["backupName"] = "zenlb1"
$backupJobs[0]["backupRoot"] = "$($pwd)\"
#$backupJobs[0]["backupRoot"] = "D:\ZenLoadBalancers\backups\"
$backupJobs[0]["hostIP"] = "192.168.0.11:444"
$backupJobs[0]["username"] = "admin"
$backupJobs[0]["password"] = "pass"
$backupJobs[0]["domain"] = ""
#$backupJobs[1] = @{}
#$backupJobs[1]["backupName"] = "zenlb2"
#$backupJobs[1]["backupRoot"] = "D:\ZenLoadBalancers\backups\"
#$backupJobs[1]["hostIP"] = "192.168.0.12:444"
#$backupJobs[1]["username"] = "admin"
#$backupJobs[1]["password"] = "pass"
#$backupJobs[1]["domain"] = ""
#$backupJobs[2] = @{}
#$backupJobs[2]["backupName"] = "zenlb3"
#$backupJobs[2]["backupRoot"] = "D:\ZenLoadBalancers\backups\"
#$backupJobs[2]["hostIP"] = "192.168.0.13:444"
#$backupJobs[2]["username"] = "admin"
#$backupJobs[2]["password"] = "pass"
#$backupJobs[2]["domain"] = ""
#$backupJobs[3] = @{}
#$backupJobs[3]["backupName"] = "zenlb4"
#$backupJobs[3]["backupRoot"] = "D:\ZenLoadBalancers\backups\"
#$backupJobs[3]["hostIP"] = "192.168.0.14:444"
#$backupJobs[3]["username"] = "admin"
#$backupJobs[3]["password"] = "pass"
#$backupJobs[3]["domain"] = ""
$purgeOldBackups = $false
#$purgeOldBackups = $true
$purgeDaysToKeep = 1
$purgeRoot = "."
#$purgeRoot = "D:\ZenLoadBalancers\backups\"
$createEmail = $false
#$createEmail = $true
$subjectTitle = "Backup Zen Load Balancers - %status%"
$emailFrom = "task-computer@local.domain"
#$emailTo = "admin1@email.com", "admin2@email.com"
$emailTo = "admin1@email.com"
$smtpServer = "smtp.local.domain"
$createlog = $true
$logRoot = $pwd
#$logRoot = "D:\ZenLoadBalancers\log\"
#$debug = $true
$debug = $false
#runtime variables
#
$scriptName = $MyInvocation.MyCommand.Name
$scriptpath = $Myinvocation.Mycommand.Path
$start = get-date
$log = New-Object -TypeName "System.Text.StringBuilder" "";
[void]$log.appendline((("Starting Script - ")+($start)))
if ($debug) { write-host "Starting Script - $($start)" }
$status = @{}
function writeLog {
$exist = Test-Path "$($logRoot)\$($scriptName).log"
$logFile = New-Object System.IO.StreamWriter("$($logRoot)\$($scriptName).log", $exist)
$logFile.write($log)
$logFile.close()
}
function sendEmail {
try {
[void]$log.appendline((("Emailing Results - ")+(get-date)))
if ($debug) { write-host "Emailing Results" }
$body = "<style type=""text/css"">
span { font-family: Calibri, verdana,arial,sans-serif; }
table {
font-family: Calibri, verdana,arial,sans-serif;
color:#333333;
border-width: 1px;
border-color: #666666;
border-collapse: collapse;
}
table th {
border-width: 1px;
padding: 8px;
border-style: solid;
border-color: #666666;
}
table td {
border-width: 1px;
padding: 8px;
border-style: solid;
border-color: #666666;
}
.footer { font-size: 10pt; }
</style>
<span>"
$logHTML = $log.ToString() -replace "`n","<br>"
$footer = "<p class=""footer"">[$($scriptpath)[$(get-date (get-item $scriptpath).lastwritetime -format G)] launched from $($env:computername) as $($env:username) at $($start)]</p></span>"
#Format the output
[string]$emailBody = [string]$body, [string]$logHTML, [string]$footer
#Send the report
#Needed to send without using default creditianls of the service or computer running the script
$s = New-Object System.Security.SecureString
$creds = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "NT AUTHORITY\ANONYMOUS LOGON", $S
Send-MailMessage -To $emailTo -From $emailFrom -Subject "$($subjectTitle) - $($scriptName)" -BodyAsHtml $emailBody -SmtpServer $smtpServer -Credential $creds
} catch { [void]$log.appendline((("Error emailing log data - ")+$_.Exception.Message+(" ")+(get-date))); }
}
function createBackup {
Param(
[Parameter(Mandatory=$true)]
[string]$backupName,
[string]$backupRoot,
[string]$hostIP,
[string]$username,
[string]$password,
[string]$domain
) #end param
$backupFile = "backup-$($backupName).tar.gz"
$createBackupURL = "https://$($hostIP)/index.cgi?name=$($backupName)&id=3-5&action=Create+Backup"
$getBackupURL = "https://$($hostIP)/backup/$($backupFile)"
#initiate webclient with ignoring untrusted SSL
$netAssembly = [Reflection.Assembly]::GetAssembly([System.Net.Configuration.SettingsSection])
if($netAssembly)
{
$bindingFlags = [Reflection.BindingFlags] "Static,GetProperty,NonPublic"
$settingsType = $netAssembly.GetType("System.Net.Configuration.SettingsSectionInternal")
$instance = $settingsType.InvokeMember("Section", $bindingFlags, $null, $null, @())
if($instance)
{
$bindingFlags = "NonPublic","Instance"
$useUnsafeHeaderParsingField = $settingsType.GetField("useUnsafeHeaderParsing", $bindingFlags)
if($useUnsafeHeaderParsingField)
{
$useUnsafeHeaderParsingField.SetValue($instance, $true)
}
}
}
$webClient = new-object System.Net.webClient
$webClient.Credentials = new-object System.Net.NetworkCredential($username, $password, $domain)
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
#Attempt to create backup
try {
$webpage = $webClient.DownloadString($createBackupURL)
} catch { }
#Version
if (($webpage.Split("`n"))[36].contains("3.05")) {
#version 3.05
$lineChkBk = 94
} else {
#v3.03 or ???
$lineChkBk = 92
}
#Check created backup
if (($webpage.Split("`n"))[$lineChkBk].Contains("SUCCESS!")) {
$bkStatus = $true
} else {
#Check created backup error
$bkStatus = $false
$message = "Checking if backup was created failed`nHost Output:`n"+($webpage.Split("`n"))[$lineChkBk] + "`n" + ($webpage.Split("`n"))[93]
}
# last Pull backup details
#
#parse backup output
$content = (($webpage.Split("`n"))[$lineChkBk])
$content -match "<td>(?<file>backup.[A-Z0-9 _.%+-].gz)</td><td>(?<date>.*[0-9]+)</td>"
$files = (((($content -split "<tbody><tr>")[1] -replace "<script language=""javascript"">") -replace "<td>") -replace "</tr><tr>") -split "</td>"
$line = 0
#search for our backup
Do {
if ($files[$line] -eq $backupFile) {
$line
$backupFilename = $files[$line]
$line++
$line
$backupFiledate = $files[$line]
}
$line++
} while (!($files[$line] -eq $null))
#verify backup output parsed
if (test-path variable:backupFilename) {
$tmpDate= get-date ($backupFiledate.Substring(4,6)+", "+$backupFiledate.Substring(20,4)+", "+$backupFiledate.Substring(11,9))
#check backup creation date newer than start failed - +5 min for delta
if ((get-date $tmpDate.AddMinutes(+5)) -ge $start) {
#download the backup file
$tmpFilename = $backupRoot+(get-date $tmpDate -Format "yyyyMMdd_HHmmss-")+$backupFile
try { $webClient.DownloadFile($getBackupURL,$tmpFilename); } catch {}
#test file download
if (test-path -path $tmpFilename ) {
$message = "Backup triggered and the backup file was saved to $($tmpFilename)"
$bkStatus = $true
} else {
#test file download failed
$message ="Check $($tmpFilenam) failed - Backup file did not download"
$bkStatus = $false
}
} else {
#check backup creation date newer than start failed
$message ="Backup date not newer than the start of this runtime"
$bkStatus = $false
}
} else {
#verify backup output parsed failed
$message ="Could not locate the backup filename on output for $($createBackupURL)"
$bkStatus = $false
}
#convert bkstatus to Success or Failure for readable output
if ($bkstatus) {
$bkstatus = "Success"
$status["Success"]++
} else {
$bkstatus = "Failure"
$status["Failure"]++
}
[void]$log.appendline(((" - Backup $($bkstatus): $($message) - ")+(get-date)))
if ($debug) { write-host "Backup $($bkstatus): $($message)"; }
}
function purgeOldFiles {
Param(
[Parameter(Mandatory=$true)]
[string]$root,
[string]$filename,
[int]$daysToKeep
) #end param
Get-ChildItem "$($root)$($filename)" | ? {((get-date $_.LastWriteTime).AddDays($daysToKeep) -le (Get-date)) } | % {
[void]$log.appendline(((" - Purging Old File, Filename: $($_), Date: $($_.LastWriteTime) - ")+(get-date)))
if ($debug) { write-host "Purging Old File, Filename: $($_), Date: $($_.LastWriteTime)" }
remove-item $_
}
}
#run the backup jobs
foreach ($backup in $backupjobs.keys) {
createBackup -backupName $backupJobs[$backup]["backupName"] -backupRoot $backupJobs[$backup]["backupRoot"] -hostIP $backupJobs[$backup]["hostIP"] -username $backupJobs[$backup]["username"] -password $backupJobs[$backup]["password"] -domain $backupJobs[$backup]["domain"]
}
#purge old backup files
if ($purgeOldBackups) { purgeOldFiles -root $purgeRoot -filename "*.tar.gz" -daysToKeep $purgeDaysToKeep; }
[void]$log.appendline((("Ending Script - ")+(get-date)))
if ($debug) { write-host "Ending Script - $(get-date)" }
#update e-mail subject to add statuses
if ($status["Success"] -gt 0) {
if ($status["Failure"] -gt 0) { $tmpOutput = "Failures: "+$status["Failure"]+", Successes: "+$status["Success"];}
else { $tmpOutput = "Successes: "+$status["Success"]; }
} else { $tmpOutput = "Failures: "+$status["Failure"] ;}
$subjectTitle = $subjectTitle -replace "%status%", $tmpOutput
if ($createEmail) { sendEmail; }
if ($createLog) { writeLog; }
</code></pre>
<span style="background-color: white; color: #222222; font-family: "arial" , "tahoma" , "helvetica" , "freesans" , sans-serif; font-size: xx-small; line-height: 12.6000003814697px;">Formatted for web with </span><a href="http://codeformatter.blogspot.com/" style="background-color: white; color: #888888; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: xx-small; line-height: 12.6000003814697px; text-decoration: none;">http://codeformatter.blogspot.com/</a><span style="background-color: white; color: #222222; font-family: "arial" , "tahoma" , "helvetica" , "freesans" , sans-serif; font-size: xx-small; line-height: 12.6000003814697px;"> </span><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-C_oO9hWEmjs/VNZPDzJk5oI/AAAAAAAAGSs/GNSoUsTmjo0/s1600/backup-zenlb-1.PNG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="248" src="http://1.bp.blogspot.com/-C_oO9hWEmjs/VNZPDzJk5oI/AAAAAAAAGSs/GNSoUsTmjo0/s1600/backup-zenlb-1.PNG" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Example Backup Job</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://4.bp.blogspot.com/-166e2Udll44/VNZPFmkNQ-I/AAAAAAAAGS0/xU6S2ktcDC0/s1600/backup-zenlb-2.PNG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="272" src="http://4.bp.blogspot.com/-166e2Udll44/VNZPFmkNQ-I/AAAAAAAAGS0/xU6S2ktcDC0/s1600/backup-zenlb-2.PNG" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Example Backup Folder</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgquKd1qNgwTmpby93PzkUZyg8_ly4fYuUsjodqP5dWno0KN60QkPn5-RiStAi4axEF0WPVos0R6UF24wL2TFzrBZ7uh-lBtbuX0_z6GOr3uuIz5sGvuL9unvZbG66OLZYhRPu_GF5NHRc/s1600/backup-zenlb-3.PNG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="" border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgquKd1qNgwTmpby93PzkUZyg8_ly4fYuUsjodqP5dWno0KN60QkPn5-RiStAi4axEF0WPVos0R6UF24wL2TFzrBZ7uh-lBtbuX0_z6GOr3uuIz5sGvuL9unvZbG66OLZYhRPu_GF5NHRc/s1600/backup-zenlb-3.PNG" title="Email Restuls" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Email Results of Production</td></tr>
</tbody></table>
<br />Justin Bennetthttp://www.blogger.com/profile/08685325767450711504noreply@blogger.com0tag:blogger.com,1999:blog-8394280631537425165.post-76492948686496775542015-02-02T09:34:00.003-08:002015-12-09T13:56:29.916-08:00Quick and Dirty VM StatisticsUsing the built in Hyper-V PowerShell Cmdlet "get-vm" in Windows Server 2012 allows you to quickly gather usage information about Hyper-V Host's VMs.<br />
<br />
I wrote the following PowerShell bit for a set of Windows Server 2012 Hyper-V Hosts that are part of a Failover Cluster I manage to quickly gather statistics.<br />
<br />
Current version at <a href="https://github.com/cajeeper/PowerShell/blob/master/Get-VMUsageStatistics.ps1">https://github.com/cajeeper/PowerShell/blob/master/Get-VMUsageStatistics.ps1</a><br />
<br />
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;">#Script to gather VM statistics on multiple Hyper-V hosts
#Hyper-V Hosts
$servers = "host1","host2","host3"
$vms= Get-VM -computername $servers | select name, @{n="MemAssign";e={[int]($_.MemoryAssigned/1MB)}}, @{n="MemMax";e={[int]($_.MemoryMaximum/1MB)}}, @{n="MemStart";e={[int]($_.MemoryStartup/1MB)}}, @{n="MemDemand";e={[int]($_.MemoryDemand/1MB)}}, @{n="ProcCount";e={[int]($_.Processorcount)}}, state, DynamicMemoryEnabled
$total = $vms | Group-Object | %{
New-Object psobject -Property @{
VMCount = ($_.Group).Count
MemAssignGB = [Math]::Round(($_.Group | Measure-Object MemAssign -Sum).Sum/1024,1)
#If Dynamic Memory is not enable, don't sum up the potential max memory MemMaxGB
MemMaxGB = [Math]::Round(($_.Group | ? { $_.DynamicMemoryEnabled } | Measure-Object MemMax -Sum).Sum/1024,1)
MemDemandGB = [Math]::Round(($_.Group | Measure-Object MemDemand -Sum).Sum/1024,1)
MemStartGB = [Math]::Round(($_.Group | Measure-Object MemStart -Sum).Sum/1024,1)
ProcCount = ($_.Group | Measure-Object ProcCount -Sum).Sum
}
}
$subtotals = $vms | Group-Object State | %{
New-Object psobject -Property @{
State = $_.Name
VMCount = ($_.Group).Count
MemAssignGB = [Math]::Round(($_.Group | Measure-Object MemAssign -Sum).Sum/1024,1)
#If Dynamic Memory is not enable, don't sum up the potential max memory MemMaxGB
MemMaxGB = [Math]::Round(($_.Group | ? { $_.DynamicMemoryEnabled } | Measure-Object MemMax -Sum).Sum/1024,1)
MemDemandGB = [Math]::Round(($_.Group | Measure-Object MemDemand -Sum).Sum/1024,1)
MemStartGB = [Math]::Round(($_.Group | Measure-Object MemStart -Sum).Sum/1024,1)
ProcCount = ($_.Group | Measure-Object ProcCount -Sum).Sum
}
}
$vms | ft
$total | ft VMCount, ProcCount, MemAssignGB, MemMaxGB, MemDemandGB, MemStartGB
$subtotals | ft State, VMCount, ProcCount, MemAssignGB, MemMaxGB, MemDemandGB, MemStartGB
</code></pre>
<span style="font-size: xx-small;">Formatted for web with <a href="http://codeformatter.blogspot.com/">http://codeformatter.blogspot.com/</a> </span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-67QTzskMYno/VM-yJesYCzI/AAAAAAAAGSU/rit4KdJXqKU/s1600/get-vm%2Bstats.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="347" src="http://2.bp.blogspot.com/-67QTzskMYno/VM-yJesYCzI/AAAAAAAAGSU/rit4KdJXqKU/s1600/get-vm%2Bstats.png" width="400" /></a></div>
<br />
Your mileage may very.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-uhMTxEkedZw/S9U5nh_vjnI/AAAAAAAABpQ/7ai0o8RC6MA/s1600/IMG00023-20090214-1512.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="http://2.bp.blogspot.com/-uhMTxEkedZw/S9U5nh_vjnI/AAAAAAAABpQ/7ai0o8RC6MA/s1600/IMG00023-20090214-1512.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br />Justin Bennetthttp://www.blogger.com/profile/08685325767450711504noreply@blogger.com0tag:blogger.com,1999:blog-8394280631537425165.post-37177822296963286082014-10-26T01:34:00.000-07:002014-10-26T01:39:33.270-07:00Bypass Laptop Wireless Hardware Radio SwitchI have been having issues with my Sony VAIO Fit 14 laptop since I put Windows 8.1 on it. The Broadcom Wireless Network Adapter has been not able to maintain a network connection at work or at home consistently. So, I bought a Intel Centrino Advanced-N 6250 wireless adapter off eBay for $6. (In hindsight, I would have snagged a Bluetooth model.) <br />
<br />
It wasn't too difficult to pop in.<br />
<a href="http://3.bp.blogspot.com/-XbV9zL7j5S4/VEyruyGbBkI/AAAAAAAAGLE/t8fmCRx1H2U/s1600/hardware%2Bradio%2Bswitch%2Bon.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"></a> <br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-siD6rWULGqo/VEyr9Ktr5VI/AAAAAAAAGLU/lCUJ001Ntqo/s1600/Sony%2BVAIO%2BFit%2B14%2BLaptop%2BOpenned.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-siD6rWULGqo/VEyr9Ktr5VI/AAAAAAAAGLU/lCUJ001Ntqo/s1600/Sony%2BVAIO%2BFit%2B14%2BLaptop%2BOpenned.png" height="180" width="320" /></a></div>
<br />
After I put the laptop back together and loaded the Intel drivers, I noticed it didn't find any nearby networks. I opened the Intel WiFi Connection Utility and tried to enable the network adapter, but I kept getting an error about my "Hardware Radio Switch" was turned off. This laptop doesn't have a radio switch or FN key to enable/disable the wireless any where.<br />
<br />
So, I did the next best thing - smashed it to PIECES!!! Okay, maybe I didn't, but I sure felt like my $6 part should work!<br />
<br />
And, I made it work... by blocking out pin 20 on the network adapters PCIe Micro interface as others have done to get their wireless adapter working after failed wireless switches or replacing wireless adapters cause these radio switch off predicaments.<br />
<br />
Here's a picture of the mini/micro PCIe half height Broadcom BCM943142HM I pulled out of the laptop with pin 20 highlighted for reference. According the PCI Express Specification, <a href="https://www.pcisig.com/specifications/pciexpress/specifications/ECN-Second20Wireless20Disable20-2020100510.pdf" target="_blank">https://www.pcisig.com/specifications/pciexpress/specifications/ECN-Second20Wireless20Disable20-2020100510.pdf</a>, pin 20 (and now 51) are the W_DISABLE (wireless disable signal). In Intel's WiFi Connection Utility, Hardware Radio Switch is directly related to W_DISABLE and pin 20.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO3QwLhS6oVmGfIsDtkUPFFUy1FZ34kolC5uVbwNpkir6wH1X8dO6JClO7E6ApWlQX-yjS_FolS8Im6xHqnLoQ9DVfLeyics0y9H3oXTOPdoOIuaCfmWTFnaZfT4H7JqRtRzsjJ4L5OhE/s1600/pcie+half+mini+pin+20.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO3QwLhS6oVmGfIsDtkUPFFUy1FZ34kolC5uVbwNpkir6wH1X8dO6JClO7E6ApWlQX-yjS_FolS8Im6xHqnLoQ9DVfLeyics0y9H3oXTOPdoOIuaCfmWTFnaZfT4H7JqRtRzsjJ4L5OhE/s1600/pcie+half+mini+pin+20.jpg" height="268" width="320" /></a></div>
<br />
I put a piece of scotch tape (others recommend electrical tape) over Pin 20, put the card back in my laptop. If you're like me, you'll need a 5+x magnifying glass and a razor blade to cut the small piece of tape for the pin.<br />
<br />
After I booted up the laptop, my "Hardware Radio Switch" was reporting as being turned on. <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgw3z3NO_l1MXdJvVgZ_gtA3d0Ix6iCVKz0mTSEbXZFTXXtmTmNMRl1ICEMWnCf5bs4gL2FQNmvne9JRzIvHN_6vBHWFRkAaiPLaxVGMqBzfSiR-Gs3C6quIao22X2nokQ0lIjmnb146NQ/s1600/hardware+radio+switch+on.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgw3z3NO_l1MXdJvVgZ_gtA3d0Ix6iCVKz0mTSEbXZFTXXtmTmNMRl1ICEMWnCf5bs4gL2FQNmvne9JRzIvHN_6vBHWFRkAaiPLaxVGMqBzfSiR-Gs3C6quIao22X2nokQ0lIjmnb146NQ/s1600/hardware+radio+switch+on.png" height="400" width="311" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-ytV-oBPeeEo/VEyvnJ-bt0I/AAAAAAAAGLk/_9nldCm2hS8/s1600/oh%2Bbehave.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-ytV-oBPeeEo/VEyvnJ-bt0I/AAAAAAAAGLk/_9nldCm2hS8/s1600/oh%2Bbehave.jpg" height="276" width="320" /></a></div>
<br />
<br />Justin Bennetthttp://www.blogger.com/profile/08685325767450711504noreply@blogger.com3tag:blogger.com,1999:blog-8394280631537425165.post-76501157426227354922014-10-03T07:04:00.000-07:002014-10-03T07:20:10.366-07:00Create a HTTP to HTTPS Redirect with Zen Load Balancer<ol>
<li>Create a new HTTP farm, listening on 80/HTTP<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiCbZuP7rqtXKtzi-3HSw-ybQIVVLUO5eBap7qz8PKADRkRalI_GL5red9w3Pyic7_Bdo4M7_mzHEDEBSYoD_pkkSJYsP-ckhUXCaK_WYI1Q6_QvZD16ePAbU_OW7Lzsym8CzP2NwfYg4/s1600/zenlb_create_http_to_https_redir_1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiCbZuP7rqtXKtzi-3HSw-ybQIVVLUO5eBap7qz8PKADRkRalI_GL5red9w3Pyic7_Bdo4M7_mzHEDEBSYoD_pkkSJYsP-ckhUXCaK_WYI1Q6_QvZD16ePAbU_OW7Lzsym8CzP2NwfYg4/s1600/zenlb_create_http_to_https_redir_1.jpg" height="139" width="320" /></a><br /> </li>
<li>Create a service by entering a description in Add Service and click Add<br /><br /><a href="http://3.bp.blogspot.com/-iqQ11z2srHA/VC6vxXGl5fI/AAAAAAAAF_s/uWcoJEuesMg/s1600/zenlb_create_http_to_https_redir_2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-iqQ11z2srHA/VC6vxXGl5fI/AAAAAAAAF_s/uWcoJEuesMg/s1600/zenlb_create_http_to_https_redir_2.jpg" height="255" width="320" /></a><br /> </li>
<li>Enter the Virtual Host - yourdomain.com, and Redirect URL - https://yourdomain.com<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfuC5iJ4FBJJLBEC0Iliwsm_UG7LqGjoXkXrGwXU-YzCXohLn8_ChtsCClQacp9wp0jzfWsId89Oq_op3MK2uWz2ByKDcaGybo89nKWROWx7pGtD96KfJoC5XZOMEVR2SBhw0OEuV-XGc/s1600/zenlb_create_http_to_https_redir_3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfuC5iJ4FBJJLBEC0Iliwsm_UG7LqGjoXkXrGwXU-YzCXohLn8_ChtsCClQacp9wp0jzfWsId89Oq_op3MK2uWz2ByKDcaGybo89nKWROWx7pGtD96KfJoC5XZOMEVR2SBhw0OEuV-XGc/s1600/zenlb_create_http_to_https_redir_3.jpg" height="185" width="320" /></a><br /> </li>
<li>Restart the Farm<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcnhEKeV4iuRipOkD-Zb_qrFtcf_uXBsO3Qu3WniDSl-4D7RhDNgRdnoFjLvE6blCQPQ4EzXB0h-kJpN4PyhjveaZGw2psmPmq6tbT8ohyjX9Dy_aw3KKL8cje93peiQJalGyPXClzSD0/s1600/zenlb_create_http_to_https_redir_4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcnhEKeV4iuRipOkD-Zb_qrFtcf_uXBsO3Qu3WniDSl-4D7RhDNgRdnoFjLvE6blCQPQ4EzXB0h-kJpN4PyhjveaZGw2psmPmq6tbT8ohyjX9Dy_aw3KKL8cje93peiQJalGyPXClzSD0/s1600/zenlb_create_http_to_https_redir_4.jpg" height="93" width="320" /></a><br /> </li>
<li>Done<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5nks9adYHDRHLBWlo4Ep60V8RKg8q9BF-Kn5IBMy4OCSl0EmkCxwo18APO63_WPfBzQ72uKukYsUyYUdVeygxS7E087phgNBuaCveh2SplVgEW0MRR6Nd-dZrRk9-mSq1ewJkevfIttk/s1600/zenlb_create_http_to_https_redir_5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5nks9adYHDRHLBWlo4Ep60V8RKg8q9BF-Kn5IBMy4OCSl0EmkCxwo18APO63_WPfBzQ72uKukYsUyYUdVeygxS7E087phgNBuaCveh2SplVgEW0MRR6Nd-dZrRk9-mSq1ewJkevfIttk/s1600/zenlb_create_http_to_https_redir_5.jpg" height="128" width="320" /></a><br /> </li>
</ol>
Justin Bennetthttp://www.blogger.com/profile/08685325767450711504noreply@blogger.com0tag:blogger.com,1999:blog-8394280631537425165.post-17053368127814890982014-08-22T10:08:00.001-07:002014-08-27T07:17:14.689-07:00Zen Load Balancer 3.03 - Error in content3-3 cgi execution, see ZEN logsUPDATE: Zen Load Balancer 3.05 has been released and resolves the issue mentioned below. <a href="http://www.zenloadbalancer.com/downloads/">http://www.zenloadbalancer.com/downloads/</a><br />
<br />
"... Improvements:<br />
[gui] HTTP farm client request timeout with unit “seconds”<br />
[gui] Refreshing timeout for farms status view<br />
<span style="background-color: #ffe599;">[cluster] Improved RSA synchronization</span><br />
[gui] Advise message regarding no cluster configuration found<br />
..." - <a href="http://www.zenloadbalancer.com/changelog/#August_26_2014_Zen_Load_Balancer_v305">http://www.zenloadbalancer.com/changelog/#August_26_2014_Zen_Load_Balancer_v305</a><br />
<br />
<hr />
<br />
With the open source 3.03 version of ZenLB, I believe I've isolated one cause for the "Error in content3-3 cgi execution, see ZEN logs" message when attempting to configure a Cluster and using the "Configure RSA connection between nodes" button.<br />
<br />
I reported the bug to http://zenloadbalancer.sourceforge.net/bugs and been told “[t]hat is a bug that is solved for the next 3.05 version” by J. Robels.<br />
<br />
Reproducing the error:<br />
<ol>
<li>Configure two new Zen load balancers – TestLB1 and TestLB2</li>
<li>Connect them in a cluster</li>
<li>Disconnect the cluster</li>
<li>Rebuild the OS for TestLB2 with an identical configuration – IP address and settings</li>
<li>Attempt to configure a cluster again between the Zen load balancers TestLB1 and TestLB2 from TestLB1’s admin interface</li>
<li>You will get "Error in content3-3 cgi execution, see ZEN logs" using the "Configure RSA connection between nodes" button<br /><br /><div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-EqQbivY-GO8/U_d7H9RII6I/AAAAAAAAF6g/N40iL-fZ16g/s1600/zenlb_rsa_comm_error.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://3.bp.blogspot.com/-EqQbivY-GO8/U_d7H9RII6I/AAAAAAAAF6g/N40iL-fZ16g/s1600/zenlb_rsa_comm_error.png" height="157" width="320" /></a></div>
</li>
</ol>
<br />
<br />
Cause:<br />
<ul>
<li>The SSH keys on TestLB1 /root/.ssh/known_hosts file is no longer valid for referencing TestLB2.<br /> </li>
</ul>
Workaround prior to ZenLB 3.05:<br />
<ul>
<li>Delete the /root/.ssh/known_hosts file from TestLB1.<br /> <div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEir3_SOg9QIe8HFcmcTMx42lW9-74xALZxvoqIUcifl-0XDVyFODhRSspQwdf9J4Ff08xrAbZ7XRpkdHveBX6rcAm73VP28y23gfPZY2m3MM6iip1AdntJBKmQJerfdzuBmfibsvwSUYeM/s1600/zenlb_remove_ssh_known_hosts.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEir3_SOg9QIe8HFcmcTMx42lW9-74xALZxvoqIUcifl-0XDVyFODhRSspQwdf9J4Ff08xrAbZ7XRpkdHveBX6rcAm73VP28y23gfPZY2m3MM6iip1AdntJBKmQJerfdzuBmfibsvwSUYeM/s1600/zenlb_remove_ssh_known_hosts.png" height="245" width="320" /></a></div>
</li>
</ul>
You will now get the "SUCCESS! Running process for configure RSA communication. " when pressing the "Configure RSA connection between nodes" button.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-dKQn7Oqp2QY/U_d4jWyP_pI/AAAAAAAAF6U/N077A0ZM5Xo/s1600/zenlb_rsa_comm.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-dKQn7Oqp2QY/U_d4jWyP_pI/AAAAAAAAF6U/N077A0ZM5Xo/s1600/zenlb_rsa_comm.png" height="96" width="320" /></a></div>
<br />Justin Bennetthttp://www.blogger.com/profile/08685325767450711504noreply@blogger.com0tag:blogger.com,1999:blog-8394280631537425165.post-70874535463808843362014-05-19T15:48:00.000-07:002016-05-26T09:09:50.234-07:00Configure Server 2012 and 2012 R2 with RDP Session Host without the whole RDP-RDMS shebang!<a href="http://www.allthingstechie.net/2014/05/configure-server-2012-and-2012-r2-with.html" target="_blank">Configure Server 2012 and 2012 R2 with RDP Session Host without the whole RDP-RDMS shebang! - Part 1</a><br />
<a href="http://www.allthingstechie.net/2016/05/configure-server-2012-r2-with-rdp.html" target="_blank">Configure Server 2012 R2 with RDP Session Host without the whole RDP-RDMS shebang! - Part 2</a><br />
<br />
<hr />
Updated: 2016-05-25<br />
<br />
Threw this into PowerShell to make this a little quicker for me, and now for you.<br />
<br />
Current version at <a href="https://github.com/cajeeper/PowerShell/blob/master/Setup-Standalone-RDS-Host.ps1">https://github.com/cajeeper/PowerShell/blob/master/Setup-Standalone-RDS-Host.ps1</a><br />
<br />
<pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> #Install Roles
Get-WindowsFeature | ? { $_.Name -match "RDS-Licensing|RDS-RD-Server" } | Install-WindowsFeature
#Allow RDP Access to the server
Set-ItemProperty "hklm:\SYSTEM\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections" -Value 0
#Per Device
#$licenseMode = 2
#Per User
$licenseMode = 4
#Licensing Server
$licenseServer = "$env:computername.$env:userdnsdomain"
Set-ItemProperty "hklm:\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\Licensing Core\" -Name "LicensingMode" -Value $licenseMode
Get-ItemProperty "hklm:\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\Licensing Core\" -Name "LicensingMode"
New-Item "hklm:\SYSTEM\CurrentControlSet\Services\TermService\Parameters\LicenseServers"
New-ItemProperty "hklm:\SYSTEM\CurrentControlSet\Services\TermService\Parameters\LicenseServers" -Name SpecifiedLicenseServers -Value $licenseServer -PropertyType "MultiString"
Get-ItemProperty "hklm:\SYSTEM\CurrentControlSet\Services\TermService\Parameters\LicenseServers" -Name SpecifiedLicenseServers
#Allow Shadowing Users
# Values: 0 (No Remote Control), 1 (Full Control with user's permission), 2 (Full Control without user's permission), 3 (View Session with user's permission), 4 (View Session without user's permission)
New-ItemProperty "hklm:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" -Name Shadow -Value 2 -PropertyType "DWORD"
#Update GPO for Shadowing Users
gpupdate /force
#Open the firewall for RDP
netsh firewall set service remotedesktop
#reboot may be needed from Windows Feature Installation
</code></pre>
<span style="font-size: xx-small;">Formatted for web with <a href="http://codeformatter.blogspot.com/">http://codeformatter.blogspot.com/</a> </span><br />
<br />
<br />
<br />
<hr />
<br />
I went to setup a basic RDP Session Host, as I usually have done with our old 2008 R2 servers, and I was met with some slight grief. Apparently, in Windows Server 2012, Remote Desktop Configuration Manager is no longer available and you're advised to use the Remote Desktop Management Server (RDMS) in order to "... create and manage [your] Windows Server 2012 Remote Desktop environment." <a href="http://blogs.technet.com/b/askperf/archive/2012/10/30/windows-8-windows-server-2012-remote-desktop-management-server.aspx">http://blogs.technet.com/b/askperf/archive/2012/10/30/windows-8-windows-server-2012-remote-desktop-management-server.aspx</a><br />
<br />
I just want a stand-alone Session Host running a private RDS License Server on a workgroup - not a full scale deployment on an AD domain. I had tried installing just the two features, but had no way to directly configure the roles and continued to the 120 day notice for not having a configured my RDP Session Host. After tinkering around - here a Google, there a Google, everywhere a google Google - and I think I stumbled upon a simple way to configure just what I wanted with nothing more than just replacing my prior tasks in Remote Desktop Configuration Manager with creating a registry key, creating a registry Multi value string, and editing one registry key.<br />
<br />
If you're like me and want to just keep it simple, go ahead and install just the two services - Remote Desktop Licensing and Remote Desktop Session Host, configure your licensing services, and then edit the registry to complete your configuration. <!-insert obligatory-hands-slapped-clean-><br />
<br />
Install the two services:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-rC2k1VyticA/U3qD4XLDnPI/AAAAAAAAF1I/xLzFd9xsrVg/s1600/rdp_features_installed.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="282" src="https://4.bp.blogspot.com/-rC2k1VyticA/U3qD4XLDnPI/AAAAAAAAF1I/xLzFd9xsrVg/s1600/rdp_features_installed.png" width="400" /></a></div>
<br />
<br />
Configure the Remote Desktop Licensing:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-nnAK0ED8-70/U3qI4E2JaKI/AAAAAAAAF1w/BkSD1hjvZmc/s1600/rdp_license_manager.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="92" src="https://4.bp.blogspot.com/-nnAK0ED8-70/U3qI4E2JaKI/AAAAAAAAF1w/BkSD1hjvZmc/s1600/rdp_license_manager.png" width="400" /></a></div>
<br />
<br />
Update the licensing mode (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\Licensing Core\LicensingMode) registry key:<br />
Enter 2 for per device mode or 4 for per user mode (By default it is 5 and is invalid)<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-5Q9yn1io78A/U3qE34qU3lI/AAAAAAAAF1Q/3Mc_A-qILaE/s1600/rdp_license_mode.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="146" src="https://4.bp.blogspot.com/-5Q9yn1io78A/U3qE34qU3lI/AAAAAAAAF1Q/3Mc_A-qILaE/s1600/rdp_license_mode.png" width="400" /></a></div>
<br />
Add the following LicenseServers key (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TermService\Parameters\LicenseServers) and create the Multi_SZ String Value SpecifiedLicenseServers (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TermService\Parameters\LicenseServers\SpecifiedLicenseServers) :<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJbPi-zGeERCq8yQK-YfKn-vsau6RsKKaoVxNXF_MHtQBUmuI7C7-8YJ-FNsUf-gblxw_Qo7H84hzFXw6UXpjHj5xC_qvKxqR9aR3U6Rt_00GT-grE_FGlnr5YRA69kJqc_YyUW6uhqYs/s1600/rdp_license_servers.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="147" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJbPi-zGeERCq8yQK-YfKn-vsau6RsKKaoVxNXF_MHtQBUmuI7C7-8YJ-FNsUf-gblxw_Qo7H84hzFXw6UXpjHj5xC_qvKxqR9aR3U6Rt_00GT-grE_FGlnr5YRA69kJqc_YyUW6uhqYs/s1600/rdp_license_servers.png" width="400" /></a></div>
<br />
<br />
Reboot and, BAMMM!... Bob's your uncle!<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-eA4B992gr70/U3qHIrRi84I/AAAAAAAAF1k/9VMtZPkd_Fo/s1600/rdp_licensing_diagnoser.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="323" src="https://4.bp.blogspot.com/-eA4B992gr70/U3qHIrRi84I/AAAAAAAAF1k/9VMtZPkd_Fo/s1600/rdp_licensing_diagnoser.png" width="400" /></a></div>
Justin Bennetthttp://www.blogger.com/profile/08685325767450711504noreply@blogger.com35tag:blogger.com,1999:blog-8394280631537425165.post-58091302662309334382014-03-25T13:42:00.001-07:002014-03-31T08:40:29.325-07:00You wanted to P2V?Went to convert an old physical server to a virtual machine and I discovered that the latest version of System Center Virtual Machine Manager, 2012 R2, <a href="http://technet.microsoft.com/en-us/library/dn303329.aspx" target="_blank">removed the P2V (physical to virtual) conversion tool</a>.<br />
<br />
What's recommended by the Microsoft Virtual Machine Engineering blog is to use an older version of VMM - 2012 SP1 or older - to complete your P2V needs.<br />
<a href="http://blogs.technet.com/b/scvmm/archive/2013/10/03/how-to-perform-a-p2v-in-a-scvmm-2012-r2-environment.aspx">http://blogs.technet.com/b/scvmm/archive/2013/10/03/how-to-perform-a-p2v-in-a-scvmm-2012-r2-environment.aspx</a><br />
<br />
Alternatively, you can use the SysInternals Disk2vhd tool to manually P2V.<br />
<a href="http://technet.microsoft.com/en-us/sysinternals/ee656415.aspx" target="_blank">http://technet.microsoft.com/en-us/sysinternals/ee656415.aspx</a><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-yJbD85Hz6dQ/UzHTw_hcGCI/AAAAAAAAFy8/fR60l0rt9MU/s1600/disk2vhd.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-yJbD85Hz6dQ/UzHTw_hcGCI/AAAAAAAAFy8/fR60l0rt9MU/s1600/disk2vhd.png" height="220" width="320" /></a></div>
<br />
I ended up using the Disk2vhd tool and was successful in converting my server to a virtual machine.<br />
<br />
Before I began converting the physical disks to virtual:<br />
<ul>
<li>Stopped any programs or services that may have been running (as memory is not going to be captured)</li>
<li>Disabled any services running from automatically starting. Once you boot it up and reconfigure your network adapters and drive letters, set the services back to boot Manual or Automatic.</li>
</ul>
Then, I launched the Disk2vhd tool and captured the disks (one VHD disk with both the system reserve and the C: system volumes, and another VHD disk with the D: data volume).<br />
<ul>
Note: The Disk2vhd tool default converts disks to VHDX, but that's only compatible in Server 2012 and above. I had to uncheck the [Use VHDX] check box, since the virtual machine was going on a Windows Server 2008 R2 Hyper-V host.
</ul>
The only left to do after converting the system's disks where:<br />
<ul>
<li>Write down the system's network information (easiest with ipconfig /all in the command prompt)</li>
<li>Convert the VHD files created from 'Dynamically Size' vhd disks to 'Fixed Size' vhd disks</li>
<li>Attach the VHD disk files to a blank virtual machine with the necessary specifications (Processors, Memory, Network Adapters, etc) The disk containing the system volume needs to be connected to the Virtual Machine's IDE 0 or 1 Controller</li>
<li>Shutdown the phsyical machine</li>
<li>Boot up the virtual machine </li>
<li>Loaded the Hyper-V Guest OS Utilities (Hyper-V Integration Services)</li>
<li>Set the network adapters back to the correct configuration</li>
<li>Set the drive letters back to the proper designations (in my case D: became E:)</li>
<li>Re-enable the Services that were disabled </li>
<li>Re-activate Windows Operating System</li>
</ul>
Justin Bennetthttp://www.blogger.com/profile/08685325767450711504noreply@blogger.com0tag:blogger.com,1999:blog-8394280631537425165.post-86413817754088610062014-03-13T15:27:00.003-07:002014-03-13T15:30:26.273-07:00Remotely Running PowerShellVery simple.<br />
<br />
<br />
To enter a remote PowerShell session:<br />
<br />
<span style="font-family: "Courier New", Courier, monospace;">enter-pssession servename</span><br />
<br />
<br />
To exit the remote session:<br />
<br />
<span style="font-family: "Courier New", Courier, monospace;"> exit-pssession</span><br />
<br />
<br />
<br />
Commands I like to run remotely:<br />
<br />
-Listing and killing an active process:<br />
(*Particularly any starting with the name "note" and then stopping it)<br />
<br />
<span style="font-family: "Courier New", Courier, monospace;"> get-process -name note*</span><br />
<span style="font-family: "Courier New", Courier, monospace;"> stop-process -name note*</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimNBAWehXIS-qVj6hIWhsIXMhAV1R5iUKdaJQ4tpFL0QFYlnzRUGrdMCFvRA7w5g8kiu52403a19sM0ULp5ZaU-zlOpQ_MHENWR_mylaprsMAx1X6sOC4Keu0_NYln9qxEsNHT3K9dd-k/s1600/remote+powershell+2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimNBAWehXIS-qVj6hIWhsIXMhAV1R5iUKdaJQ4tpFL0QFYlnzRUGrdMCFvRA7w5g8kiu52403a19sM0ULp5ZaU-zlOpQ_MHENWR_mylaprsMAx1X6sOC4Keu0_NYln9qxEsNHT3K9dd-k/s1600/remote+powershell+2.png" height="185" width="400" /></a></div>
<br />
<br />
-Pulling a system's serial number:<br />
(*Particularly great for support calls)<br />
<br />
<span style="font-family: "Courier New", Courier, monospace;"> gwmi win32_bios</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMJGuy9uOuJ8dj7ls-BY3dDT9IE6U0DKGa5I-onTzmTQ8__vXrDEv-8gpSMIJUFC-f5Z-keRK9e-pKR6HW8DrTYK47CfRYNI0PuJMClgtKxI-UUvh5LGiiGSQyd62iVW_HIcU2yCksW7Q/s1600/remote+powershell.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMJGuy9uOuJ8dj7ls-BY3dDT9IE6U0DKGa5I-onTzmTQ8__vXrDEv-8gpSMIJUFC-f5Z-keRK9e-pKR6HW8DrTYK47CfRYNI0PuJMClgtKxI-UUvh5LGiiGSQyd62iVW_HIcU2yCksW7Q/s1600/remote+powershell.png" height="185" width="400" /></a></div>
<br />
<br />
This eliminates the need to connect via Remote Desktop in order to perform these simple tasks.<br />
<br />
<br />
<ul>
<li>[Note] In order to use PowerShell commands on a remote machine: You need to have permission to connect and run these commands remotely; You need to have ran enable-psremoting; You need to have direct communication with the machine; and have opened the firewall in order to connect to the WS Management service. There's more details about of this and these commands listed below.</li>
</ul>
<br />
References:<br />
about_Remote_Requirements, <a href="http://technet.microsoft.com/en-us/library/dd315349.aspx">http://technet.microsoft.com/en-us/library/dd315349.aspx</a><br />
Running Remote Commands, <a href="http://technet.microsoft.com/en-us/library/dd819505.aspx">http://technet.microsoft.com/en-us/library/dd819505.aspx</a><br />
Using the Get-Process Cmdlet, <a href="http://technet.microsoft.com/en-us/library/ee176855.aspx">http://technet.microsoft.com/en-us/library/ee176855.aspx</a><br />
Using the Stop-Process Cmdlet, <a href="http://technet.microsoft.com/en-us/library/ee177004.aspx">http://technet.microsoft.com/en-us/library/ee177004.aspx</a>Justin Bennetthttp://www.blogger.com/profile/08685325767450711504noreply@blogger.com0tag:blogger.com,1999:blog-8394280631537425165.post-787104673140286872014-03-12T14:39:00.001-07:002014-03-13T15:31:48.889-07:00DPM 2012 and Beyond FrustrationAll of our Hyper-V Clusters, Server 2008 R2 hosts, started having failed backups inside our two independent Data Protection Managers. The problem initially progressed from one node consistently fail backups for virtual machines and the other hosts kept performing backups, until all of our nodes could no longer could make successfully backups of any virtual machines. Our standalone backups via DPM had no issue. These hosts had been configured and unchanged for well over a year - only Windows patches months prior and anti-virus updates were continuously loading.<br />
<br />
DPM kept stating for the failed backups that "The VSS application writer or the VSS provider is in a bad state ... ID 30111: VssError:A function call was made when the object was in an incorrect state for that function(0x80042301)) and the local nodes wrote VSS 12362 Application Log Event Errors "A Shadow Copy LUN was not detected in the system and did not arrive" and VSS 12363 Application Log Event Errors "<span lang="EN">An expected hidden volume arrival did not complete because this LUN was not detected"</span> whenever we attempted to run full virtual machine backup via a Consistency check.<br />
<br />
We had tried and didn't work...<br />
<ul>
<li>Power cycling all of the equipment involved: Hyper-V Servers (PowerEdge R710's), the iSCSI SAN (EqualLogic PS4000vx's), the switches connecting them (Catalyst 3750X's), and our DPM server</li>
<li>Unregistering and Registering the EqualLogic VSS provider (eqlvss /unregserver and eqlvss /regserver)</li>
<li>Removing virtual machines from a protection group (deleting disk data) and adding them back</li>
<li>Moving virtual machines to a new protection group</li>
<li>Upgrading the EqualLogic Windows Host Integration Toolkits (HIT kits) on the Hyper-V nodes - upgraded from 4.0 to 4.6</li>
<li>Installing the EqualLogic HIT kit on one of the virtual machines</li>
<li>Patching the Hyper-V nodes to all of the latest Windows Updates - even yesterdays released kb 2908783 which resolves issues with corruption of iSCSI LUNs in Windows Server 2008 R2 and 2012</li>
</ul>
... and still no success.<br />
<br />
After much time wasted on what seemed to be magic potions and DPM's hatred of backing up critical data, a random thought of trying to disable our anti-virus on the cluster nodes resolved the issue! Yeah, I know they say to disable anti-virus on everything and everywhere you read, but we have had Microsoft Forefront Client Security on these systems configured and running since we setup these servers 2+ years ago. Apparently, some change in the definitions or just its mood decided to start messing with the iSCSI VSS Hardware process... and messing with my sleep over the last two days.<br />
<br />
Good luck!<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-OsX4sKhJRlQ/UyDMzf7-AbI/AAAAAAAAFxE/qfbqhzS_iGQ/s1600/forefront+killing+vss+snapshots+2.png" target="_blank"><img border="0" src="http://2.bp.blogspot.com/-OsX4sKhJRlQ/UyDMzf7-AbI/AAAAAAAAFxE/qfbqhzS_iGQ/s1600/forefront+killing+vss+snapshots+2.png" height="252" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-1mPk3wORt3Q/UyDM1O3cW4I/AAAAAAAAFxM/4BchwiPOWMc/s1600/forefront+killing+vss+snapshots.png" target="_blank"><img border="0" src="http://1.bp.blogspot.com/-1mPk3wORt3Q/UyDM1O3cW4I/AAAAAAAAFxM/4BchwiPOWMc/s1600/forefront+killing+vss+snapshots.png" height="266" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGkuinysTwotXNoBawRLe-KIFc15iuIBx0V9aY7DSjJlgzwEfc86DUUe1KqWmb2jo7FC3REv09keRa_7JNH3ayjN0dXrj8hpli2T4BaSfaFgNC9J2kG7MsjN3LOhZJHd56GWU3M0JQffo/s1600/forefront+killing+vss+snapshots+3.png" target="_blank"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGkuinysTwotXNoBawRLe-KIFc15iuIBx0V9aY7DSjJlgzwEfc86DUUe1KqWmb2jo7FC3REv09keRa_7JNH3ayjN0dXrj8hpli2T4BaSfaFgNC9J2kG7MsjN3LOhZJHd56GWU3M0JQffo/s1600/forefront+killing+vss+snapshots+3.png" height="256" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
Justin Bennetthttp://www.blogger.com/profile/08685325767450711504noreply@blogger.com1tag:blogger.com,1999:blog-8394280631537425165.post-82292752135847316102013-05-30T15:42:00.001-07:002014-03-18T09:37:25.883-07:00DPM 2012 - Backup Protection Group to Tape<strong>Update 2014-03-18</strong>: It appears there's been quite a few more revisions by Wilson, now version 1.6, since I first posted his version 1.0. I've updated the list below to reflect that latest version.<br />
<br />
We've had a few instances where a backup job (long term to tape) fails. When we try to resume the backups by selecting "Resume tape backups...", it causes every data source in the protection group to backup to individual tapes rather than consolidating the backups onto one-tape (as it normally does on the scheduled jobs.)<br />
<br />
We found this powershell script posted by from Mike Jacquet that works great to overcome the multiple tape issue! <a href="http://social.technet.microsoft.com/Forums/en-US/dpmtapebackuprecovery/thread/4fafbcb0-ac2c-4867-8434-31f1f5e532e0/#7b40ef6e-d8bd-4a24-aecd-5f1605e80225">http://social.technet.microsoft.com/Forums/en-US/dpmtapebackuprecovery/thread/4fafbcb0-ac2c-4867-8434-31f1f5e532e0/#7b40ef6e-d8bd-4a24-aecd-5f1605e80225</a><br />
<br />
After modifying it to work with DPM 2012 by adjusting line 25 to DPM 2012's SQL instance, $instance <span class="pun">=</span><span class="pln"> </span><span class="str">'.\msdpm2012', we were</span><span class="pln"> able to run it to re-trigger one of our failed weekly tape backup. Hopefully this post will be a bit easier to find - but credit still goes to Mike and Wilson, I'm only the messenger. We did notice that you need to be sure and inactivate any alerts that are still active and it takes a minute or two to see the jobs kick off.</span><br />
<span class="pln"></span><br />
<span class="pln">
<!-- HTML generated using hilite.me --></span><br />
<span class="pln"><div style="background: rgb(255, 255, 255); border: solid gray; font-size: 0.6em; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0px;"> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174</pre>
</td><td><pre style="line-height: 125%; margin: 0px;"><span style="color: green;"># </span>
<span style="color: green;"># This script will list all currently scheduled backup to tape jobs </span>
<span style="color: green;"># Then you can select from that list which backup to tape job you want to run </span>
<span style="color: green;"># </span>
<span style="color: green;"># Author : Wilson Souza </span>
<span style="color: green;"># Date Created : 07/13/2012 </span>
<span style="color: green;"># Last modified : 01/21/2013</span>
<span style="color: green;"># Version : 1.6 </span>
<span style="color: green;"># </span>
<span style="color: green;"># Change log </span>
<span style="color: green;"># ========== </span>
<span style="color: green;"># </span>
<span style="color: green;"># Ver 1.6 - Tested script with DPM 2012/DPM2012SP1/DPM2012R2 </span>
<span style="color: green;"># Fixed issue when DPM database is running within a SQL Default Instance</span>
<span style="color: green;"># Ver 1.5 - Changed text related to where you can monitor the job after triggered </span>
<span style="color: green;"># Ver 1.4 - Found an issue for variable $Result when only a single row is returned </span>
<span style="color: green;"># Ver 1.3 - Added PowerShell variable to hide snap-in load error </span>
<span style="color: green;"># Script query registry to check where DPM database is located </span>
<span style="color: green;"># Ver 1.2 - Added support for Copy tape configuration (up to 7 copies) </span>
<span style="color: green;"># Ver 1.1 - Added Verbose switch to show more output information </span>
<span style="color: green;"># Added Short Term/Long Term Information </span>
<span style="color: green;"># Added Rocovery goal information </span>
<span style="color: green;"># </span>
<span style="color: green;"># </span>
<span style="color: green;"># </span>
<span style="color: blue;">param</span>([string] $verbose)
$ErrorActionPreference = <span style="color: #a31515;">"silentlycontinue"</span>
add-pssnapin sqlservercmdletsnapin100
Add-PSSnapin -Name Microsoft.DataProtectionManager.PowerShell
$ConfirmPreference = <span style="color: #a31515;">'None'</span>
cls
$instance = Get-itemproperty <span style="color: #a31515;">"hklm:\SOFTWARE\Microsoft\Microsoft Data Protection Manager\DB\"</span>
$dpmdb = $instance.databasename
<span style="color: blue;">if</span> ($instance.instancename -eq <span style="color: #a31515;">'MSSQLSERVER'</span>)
{
$instance = $instance.SqlServer
}
<span style="color: blue;">else</span>
{
$instance = $instance.SqlServer + <span style="color: #a31515;">'\'</span> + $instance.instancename
}
$query = <span style="color: #a31515;">"CREATE FUNCTION label (@GUID varchar(36), @kindred varchar(4), @vault varchar(8))</span>
<span style="color: #a31515;">returns varchar (1024)</span>
<span style="color: #a31515;">as</span>
<span style="color: #a31515;">Begin</span>
<span style="color: #a31515;"> declare @result varchar (1024)</span>
<span style="color: #a31515;"> select @result = vaUltlabel from tbl_mm_vaultlabel where mediapoolid = @GUID and generation = </span>
<span style="color: #a31515;"> case @kindred</span>
<span style="color: #a31515;"> when 'Fath' Then '2'</span>
<span style="color: #a31515;"> when 'Gran' then '1'</span>
<span style="color: #a31515;"> when 'grea' Then '0'</span>
<span style="color: #a31515;"> end and</span>
<span style="color: #a31515;"> vault =</span>
<span style="color: #a31515;"> case @vault</span>
<span style="color: #a31515;"> when 'Offsite1' then '3'</span>
<span style="color: #a31515;"> when 'Offsite2' then '4'</span>
<span style="color: #a31515;"> when 'Offsite3' then '5'</span>
<span style="color: #a31515;"> when 'Offsite4' then '6'</span>
<span style="color: #a31515;"> when 'Offsite5' then '7'</span>
<span style="color: #a31515;"> when 'Offsite6' then '8'</span>
<span style="color: #a31515;"> when 'Offsite7' then '9'</span>
<span style="color: #a31515;"> else</span>
<span style="color: #a31515;"> '1'</span>
<span style="color: #a31515;"> end</span>
<span style="color: #a31515;"> RETURN @result</span>
<span style="color: #a31515;">END</span>
<span style="color: #a31515;">go</span>
<span style="color: #a31515;"> </span>
<span style="color: #a31515;">select ScheduleId as name</span>
<span style="color: #a31515;"> ,def.JobDefinitionId as JD</span>
<span style="color: #a31515;"> ,FriendlyName as PG</span>
<span style="color: #a31515;"> ,SUBSTRING (CONVERT(VARCHAR(10),active_start_date),5,2) + '-' + SUBSTRING (CONVERT(VARCHAR(10),active_start_date),7,2) + '-' + SUBSTRING (CONVERT(VARCHAR(10),active_start_date),1,4) as SD</span>
<span style="color: #a31515;"> ,jobs.date_created as SCD</span>
<span style="color: #a31515;"> ,SUBSTRING (CONVERT(VARCHAR(10),last_run_date),5,2) + '-' + SUBSTRING (CONVERT(VARCHAR(10),last_run_date),7,2) + '-' + SUBSTRING (CONVERT(VARCHAR(10),last_run_date),1,4) + ' ' +</span>
<span style="color: #a31515;"> SUBSTRING (CONVERT(VARCHAR(6),last_run_time),1,2) + ':' + SUBSTRING (CONVERT(VARCHAR(6),last_run_time),3,2) + ':' + SUBSTRING (CONVERT(VARCHAR(6),last_run_time),5,2) as LRD</span>
<span style="color: #a31515;"> ,SUBSTRING (CONVERT(VARCHAR(10),next_run_date),5,2) + '-' + SUBSTRING (CONVERT(VARCHAR(10),next_run_date),7,2) + '-' + SUBSTRING (CONVERT(VARCHAR(10),next_run_date),1,4) + ' ' +</span>
<span style="color: #a31515;"> SUBSTRING (CONVERT(VARCHAR(6),next_run_time),1,2) + ':' + SUBSTRING (CONVERT(VARCHAR(6),next_run_time),3,2) + ':' + SUBSTRING (CONVERT(VARCHAR(6),next_run_time),5,2) as NRD</span>
<span style="color: #a31515;"> ,dbo.label ((substring(xml,(patindex('%MediaPoolId%',Xml))+13,36)), (substring(xml,(patindex('%generation%',Xml))+12,4)), (substring(xml,(patindex('%vault%',Xml))+7,8))) as TL</span>
<span style="color: #a31515;"> ,case </span>
<span style="color: #a31515;"> when substring(xml,(patindex('%vault%',Xml))+7,3) = 'off' then 'Long-Term' </span>
<span style="color: #a31515;"> else 'Short-term'</span>
<span style="color: #a31515;"> end as STLT</span>
<span style="color: #a31515;"> ,case</span>
<span style="color: #a31515;"> when substring(xml,(patindex('%generation%',Xml))+12,4) = 'Fath' then 'Recovery Goal 1'</span>
<span style="color: #a31515;"> when substring(xml,(patindex('%generation%',Xml))+12,4) = 'Gran' then 'Recovery Goal 2'</span>
<span style="color: #a31515;"> when substring(xml,(patindex('%generation%',Xml))+12,4) = 'Grea' then 'Recovery Goal 3'</span>
<span style="color: #a31515;"> end as RG</span>
<span style="color: #a31515;">from tbl_SCH_ScheduleDefinition sch </span>
<span style="color: #a31515;"> ,msdb.dbo.sysjobs jobs</span>
<span style="color: #a31515;"> ,tbl_JM_JobDefinition def</span>
<span style="color: #a31515;"> ,"</span> + $DPMDB + <span style="color: #a31515;">".dbo.tbl_IM_ProtectedGroup prot</span>
<span style="color: #a31515;"> ,msdb.dbo.sysjobschedules jobsch</span>
<span style="color: #a31515;"> ,msdb.dbo.sysjobsteps jobsteps</span>
<span style="color: #a31515;"> ,msdb.dbo.sysschedules syssch</span>
<span style="color: #a31515;">where CAST(sch.ScheduleId as NCHAR (128)) = jobs.name</span>
<span style="color: #a31515;">and def.JobDefinitionId = sch.JobDefinitionId</span>
<span style="color: #a31515;">and def.ProtectedGroupId = prot.ProtectedGroupId</span>
<span style="color: #a31515;">and jobs.job_id = jobsch.job_id</span>
<span style="color: #a31515;">and jobs.job_id = jobsteps.job_id</span>
<span style="color: #a31515;">and jobsch.schedule_id = syssch.schedule_id</span>
<span style="color: #a31515;">and (def.Type = '913afd2d-ed74-47bd-b7ea-d42055e5c2f1' or def.Type = 'B5A3D25C-8EB2-4032-9428-C852DA5CE2C5')</span>
<span style="color: #a31515;">and sch.IsDeleted = '0' and def.ProtectedGroupId is not null</span>
<span style="color: #a31515;">order by FriendlyName, next_run_date, next_run_time</span>
<span style="color: #a31515;">go</span>
<span style="color: #a31515;"> </span>
<span style="color: #a31515;">drop function label</span>
<span style="color: #a31515;">go"</span>
[array]$result = Invoke-Sqlcmd -ServerInstance $instance -Query $query -Database $dpmdb
$count = 1
write-host <span style="color: #a31515;">" The list below shows all scheduled backup to tape jobs (short term and long term)"</span> -f green
write-host
<span style="color: blue;">if</span> ($verbose.ToLower() -eq <span style="color: #a31515;">'verbose'</span>)
{
write-host <span style="color: #a31515;">" For optimun output, set PoweShell Width for screen buffer size to at least 300"</span> -f yellow<span style="border: 1px solid rgb(255, 0, 0);">;</span> write-host
write-host
write-host <span style="color: #a31515;">" Protection Group SQL Agent Name JobDefinitionID Creation Date Schedule Creation Date Last Run Date Next Sched Run Date Term Goal Tape Label"</span>
write-host <span style="color: #a31515;">" ------------------------------ ------------------------------------ ------------------------------------ ------------- ---------------------- -------------------- -------------------- ---------- --------------- --------------"</span>
<span style="color: blue;">foreach</span> ($result1 <span style="color: blue;">in</span> $result)
{
<span style="color: blue;">if</span> ($color -eq <span style="color: #a31515;">'white'</span>) {$color = <span style="color: #a31515;">'cyan'</span>} <span style="color: blue;">else</span> {$color = <span style="color: #a31515;">'white'</span>}
write-host (<span style="color: #a31515;">"{0,2}"</span>-f $count) -foreground green -nonewline
write-host ( <span style="color: #a31515;">" - {0,-30} {1,36} {2,36} {3,-13} {4,-22} {5,-20} {6,-20} {7,-10} {8,15} "</span> -f $result1.PG, $result1.name, $result1.jd, $result1.SD, $result1.SCD, $result1.LRD, $result1.NRD, $result1.STLT, $result1.RG) -nonewline -f $color
write-host $result1.TL -f yellow
$count++
}
}
<span style="color: blue;">else</span>
{
write-host <span style="color: #a31515;">" For optimun output, set PoweShell Width for screen buffer size to at least 110"</span> -f yellow<span style="border: 1px solid rgb(255, 0, 0);">;</span> write-host
write-host <span style="color: #a31515;">" Protection Group Term Goal Tape Label"</span>
write-host <span style="color: #a31515;">" ------------------------------ ---------- --------------- --------------"</span>
<span style="color: blue;">foreach</span> ($result1 <span style="color: blue;">in</span> $result)
{
<span style="color: blue;">if</span> ($color -eq <span style="color: #a31515;">'white'</span>) {$color = <span style="color: #a31515;">'cyan'</span>} <span style="color: blue;">else</span> {$color = <span style="color: #a31515;">'white'</span>}
write-host (<span style="color: #a31515;">"{0,2}"</span>-f $count) -foreground green -nonewline
write-host ( <span style="color: #a31515;">" - {0,-30} {1,-10} {2,15} "</span> -f $result1.PG, $result1.STLT, $result1.RG) -nonewline -f $color
write-host $result1.TL -f yellow
$count++
}
}
write-host
write-host <span style="color: #a31515;">"Which job(s) you want to run? If running more than one job enter numbers separated by space: "</span> -f green -nonewline
$runjob = read-host
$runjob = $runjob -split <span style="color: #a31515;">" "</span>
$executingjob = 0
<span style="color: blue;">if</span> ($runjob)
{
<span style="color: blue;">foreach</span> ($startjob <span style="color: blue;">in</span> $runjob)
{
$firejob = [int]$startjob
<span style="color: blue;">if</span> ($firejob -gt 0 -and $firejob -lt $count)
{
$query = <span style="color: #a31515;">"EXEC msdb.dbo.sp_start_job '{0}'"</span> -f $result[$firejob-1].name
Invoke-Sqlcmd -ServerInstance $instance -Query $query -Database $dpmdb
$executingjob++
}
}
}
write-host
<span style="color: blue;">if</span> ($executingjob -gt 0)
{
write-host <span style="color: #a31515;">"You selected to run $executingjob job(s). You can monitor job(s) progress via DPM Administrator Console"</span> -f green
}
<span style="color: blue;">else</span>
{
write-host <span style="color: #a31515;">"Due to the selection entered, no jobs will run"</span> -f red
}
</pre>
</td></tr>
</tbody></table>
</div>
</span><br />
<span class="pln"></span><br />
<div class=" separator=" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-xuXfOkvGqrs/UafRvwmFFeI/AAAAAAAAFfA/xTrJYtasWA4/s1600/dpm_backup_to_tape_1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-xuXfOkvGqrs/UafRvwmFFeI/AAAAAAAAFfA/xTrJYtasWA4/s400/dpm_backup_to_tape_1.png" height="157" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRZHKMSr6afErjVcFdHFw1IctTsFavrcpnCJFKhGf9v69YuiA0kTqtOP1md5DecG7rsUBFpco_oyiuNY4OrGTVDJJl1NZs1maI5PxqiP-HtzG7WDVkEpW8REzg9M5oSne7Aa-yXNP9d-o/s1600/dpm_backup_to_tape_2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRZHKMSr6afErjVcFdHFw1IctTsFavrcpnCJFKhGf9v69YuiA0kTqtOP1md5DecG7rsUBFpco_oyiuNY4OrGTVDJJl1NZs1maI5PxqiP-HtzG7WDVkEpW8REzg9M5oSne7Aa-yXNP9d-o/s400/dpm_backup_to_tape_2.png" height="240" width="400" /></a></div>
<span class="pln"></span><br />Justin Bennetthttp://www.blogger.com/profile/08685325767450711504noreply@blogger.com6