Tuesday, June 09, 2020

Exchange Logging: Clear out the log files

Here is a simple PowerShell script that you can run against Exchange either manually as part of your maintenance routine or with Task Scheduler to clear out files when you need to.

I must admit the first time I ran this on my Exchange 2013 server it took almost 5 minutes to complete and freed up over 30G of drive space from the multiple years of log files hidden all over.

At the top of the script make sure you change the drive letter if needed to match where your Exchange log files are stored.  Sadly I have seen many Exchange servers over the years with everything installed on C: so this script just assumes that.

NOTE:  Please make sure you have good backups in place and/or a snapshot of your virtual machine before running this.  While I have tested the script with no negative effects, please do not assume this will always be the case.  There is no substitution for good backups and a quick recovery plan if needed.

If you want to run the file manually, just open PowerShell as administrator, navigate to where you have your script file saved (Example Name:  ClearFiles.ps1).  From there just type in ./ClearFiles.ps1 and wait on the script to complete the cleanup.

Good luck.

Set-Executionpolicy RemoteSigned
$days=2
$IISLogPath="C:\inetpub\logs\LogFiles\"
$ExchangeLoggingPath="C:\Program Files\Microsoft\Exchange Server\V15\Logging\"
$ETLLoggingPath="C:\Program Files\Microsoft\Exchange Server\V15\Bin\Search\Ceres\Diagnostics\ETLTraces\"
$ETLLoggingPath2="C:\Program Files\Microsoft\Exchange Server\V15\Bin\Search\Ceres\Diagnostics\Logs"
Function CleanLogfiles($TargetFolder)
{
    if (Test-Path $TargetFolder) {
        $Now = Get-Date
        $LastWrite = $Now.AddDays(-$days)
        $Files = Get-ChildItem $TargetFolder -Include *.log,*.blg, *.etl, *.txt -Recurse | Where {$_.LastWriteTime -le "$LastWrite"}
        foreach ($File in $Files)
            {Write-Host "Deleting file $File" -ForegroundColor "white"; Remove-Item $File -ErrorAction SilentlyContinue | out-null}
       }
Else {
    Write-Host "The folder $TargetFolder doesn't exist! Check the folder path!" -ForegroundColor "white"
    }
}
CleanLogfiles($IISLogPath)
CleanLogfiles($ExchangeLoggingPath)
CleanLogfiles($ETLLoggingPath)
CleanLogfiles($ETLLoggingPath2)

Friday, January 17, 2020

Disable User Editing Connections HP ThinPro 7.x (T530)

So I ran into this one yesterday.  After pushing out a configuration to our new HP T530 thin clients I was shocked to discover that one of the users had the ability with the OS locked down to delete their RDP connection icon.

I quickly recreated it on the thin client so they could log back in.  Today I set out to change the configuration and push it to all of our thin clients to prevent this from happening again.  Here's how:

1.  Go into Administrator mode on ThinPro
2.  Right click on the respective connection on the desktop.  Ex: RDP
3.  Select Edit and then go to Advanced.
4.  Remove the check box beside "Allow the user to edit this connection".

This process is the same for all connection types on the thin client.  I read through the Administrator guide and wasn't able to find a global setting so you'll need to do this for each connection type you are using.

I hope this helps prevent you running into the same issue.

Good luck!

I'm Back!

It's been quite a while since my last post as I had transitioned into a job where I was doing more sales and quoting than field work so I didn't really have anything to post.

Now, I have changed jobs and on a daily basis I'm back into engineering and field work again.

To that end, I'm sure I will run into new issues and processes that I'll put up here for everyone to see and use.  I just hope the bits I add helps someone in IT like me get through a tough problem or issue and look like a champ doing it.

Thanks to everyone that has messaged me with questions and support these past few years.  This blog just serves as my small way of helping all of the people that have posted articles and on forums over the years that helped me out of a tight spot.

I hope 2020 and beyond are great for all.

Thanks!

Monday, October 30, 2017

Change 2040/2042 HPE SAN Ports from FC to iSCSI

As I work with these SANs a lot, one of the first things I have to do is change the ports over from the default FC mode to iSCSI mode so they can be connected to the SAN via 10G fiber connections.

Believe it or not this is very tough to find out the exact syntax in the HPE documentation.

Since it is a simple process, I have outlined it below:

1. Connect to the SAN controller via Putty
2. Run this command:  set host-port-mode [FC | iSCSI | FC-and-iSCSI]

Parameters:

  • FC: Sets all ports to FC
  • iSCSI: Sets all ports to iSCSI
  • FC-and-iSCSI: Sets the first two ports to FC and the second two ports to iSCSI

That's all there is to it.  

Good luck!



Tuesday, April 11, 2017

[SOLVED] Cisco VPN Client on Windows 10 (Including the new build April 2018 Update) - This works!

***Updated 05/14/18 **
***Please see my edits below for notes on builds 1803, 1709, and back.**

Here's how to get it working in 2 easy steps:

1. Download and install the Sonicwall 64-bit VPN client from HERE (as of this writing).

2. Install the Cisco VPN client.  Edit:  If you get an error that it cannot run on this operating system then just extract the .exe file using WinRar or a similar program and run the .msi file.  Problem solved.
3. Perform a quick registry edit: (This step is almost always not optional any longer)
  • Open Regedit
  • Browse to the registry key HKLM\SYSTEM\CurrentControlSet\Services\CVirtA
  • Select the display name to modify:
    • x86 - "@oem8.ifn,%CVirtA_Desc%;Cisco Systems VPN Adapter" to "Cisco Systems VPN Adapter"
    • x64 - "@oem8.ifn,%CVirtA_Desc%;Cisco Systems VPN Adapter for 64-bit Windows" to "Cisco Systems VPN Adapter for 64-bit Windows"
  • Reboot

The first two steps worked for me without the need for registry edit.  I checked and the settings were already spelled correctly on my machine.  Full disclosure my systems are clean Windows 10 installs without being upgrades.

Without installing the Sonicwall client first you will get Error 433 after trying to connect.  Checking the logs shows that it cannot download the key to complete the secure connection.

What happens is that the Sonicwall client adds the DNE Lightweight filter network client on the machine.  I tried getting it directly from Citrix and installing it that way but was unsuccessful.

Using this method you can now get some more use out of the Cisco VPN client.  If you prefer you can uninstall the Sonicwall client afterward.  I've been told by several people that the DNE software remains even after the Sonicwall client is removed.

Build 1803

WARNING:  You should uninstall the Cisco VPN client prior to running this upgrade so repairing it afterward will make it much easier.  All of the steps above still work on this latest build 1803 (OS Build 17134.1).  No other edits required to keep it running.

Build 1709 Fall Creator's Update

WARNING:  You should uninstall the Cisco VPN client prior to running this upgrade so repairing it afterward will make it much easier.  All of the steps above still work on this latest "Fall Creator's Update" upgrade of Windows 10.

Build 1703 Creator's Update EDIT: Updated 04/11/2017

WARNING:  You should uninstall the Cisco VPN client prior to running this upgrade so repairing it afterward will make it much easier.  All of the steps above still work on this latest "Creator's Build" upgrade of Windows 10.

Now for the not-so-fun-details.  I didn't uninstall prior to the upgrade and proceeded to spend the next 30 minutes clearing out registry entries until I finally found the right one to let me reinstall the product using the .MSI file.  After doing that, and making the registry edit, my VPN client is again working properly.

Version 1607 Build 14393.10 EDIT: Updated 08/03/2016

All of the steps above still work on this latest "Anniversary" build of Windows 10.  As with the 1511 build mentioned below, you will have to run a repair on the program or just do a clean install to get it working because Microsoft yet again determined that they would control which program we use.

You can go HERE to download the latest version of the media downloader and get version 1607.

And not to be left out HERE is a link to all of the new features in 1607 for IT pros.

As I update my Windows 10 machines I'll post updates if there are any issues or errors I run across with this build.  As I always say.... good luck.

BUILD 1511 EDIT: Updated 1/20/2016

I'm getting a lot of feedback about networking being broken after 1511.  I would highly advise you remove the Cisco VPN client and Sonic Global client software prior to installing build 1511.

I have now upgraded three different systems to 1511.  By removing both the Sonicwall and Cisco VPN software first, I had zero issues with it working properly afterward.

However, if the upgrade went through already, here's what you can do to help mitigate these issues.  There's no guarantee this is going to work but I have had two instances where the Cisco VPN software was removed by the 1511 upgrade and I was able to get it working by following the next steps below:

First just reinstall the VPN client using the .MSI file and not the .EXE file.  This will bypass Windows 10 checking the compatibility as I listed at the top.  Next just make the registry edits again and you'll be good to go.  After the registry edits, I have not had to restart but you can if you feel the need just to be sure.

If this does not work as an extra effort you will need to reset all networking on Windows 10.  Luckily this is pretty easy to do.

- Open an administrator command prompt
- Run "netcfg -d"
- Reboot and reconfigure your networking as needed.

Here's a sample of the output you will see:

Microsoft Windows [Version 10.0.10586]
(c) 2016 Microsoft Corporation.  All rights reserved.

C:\WINDOWS\system32\netcfg -d
SetupDiCallClassInstaller Erorr: 0x6
SetupDiCallClassInstaller Erorr: 0x6
SetupDiCallClassInstaller Erorr: 0x6
SetupDiCallClassInstaller Erorr: 0x6
SetupDiCallClassInstaller Erorr: 0x6
SetupDiCallClassInstaller Erorr: 0x6
SetupDiCallClassInstaller Erorr: 0x6
SetupDiCallClassInstaller Erorr: 0x6
NetSetup object deleted successfully on MUX
Successfully commited changes to the registry
Successfully commited changes to the registry
We are going to reboot now to complete the clean up. Save all of your work.

Press any key to continue…

I hope this helps out with the additional headaches caused by 1511.  As always if I find any more useful information with future updates to Windows 10 that affect this software, I'll be sure to update the post.

Good luck!