Task Scheduler Error “A specified logon session does not exist” – Fix via Command Line and PowerShell for Scripting

This is very know issue, if you search internet, you will get multiple blog post with same solution for this issue, and if you follow the steps, it actually resolve this issue.

In simple word, solution of this problem is

  1. Logon to the faulty system.
  2. Open SECPOL.MSC from Run
  3. Go to Security Settings | Local Policies | Security Options
  4. Open Network access: Do not allow storage of passwords and credentials for network authentication
  5. To resolve this issue, simply set this policy to Disabled.

But, my problem is little bit different, I was working on a script to validate the Local Admin password of multiple remote systems, I found best way to validate this is to create a ONSTART task with local admin credentials with schtasks.exe via PS Remoting (WSMan). Something like this

If the scheduled task created successfully, it means the local admin account authenticating. Now the problem is, when I was trying to run this remotely on multiple Windows 2008 R2 servers, I am getting “A specified logon session does not exist” and my script reporting wrong status. Solution is already available, but who will made those changes on hundreds of servers manually, and I am also not sure why this policy was enabled. So I don’t want made any permanent changes on all the servers for validating local admin password.

What I did is, logged on to a problematic system, and extracted the local security policy configuration using this command
Continue reading

How to boot Windows Server 2016 Technical Preview with GUI (Server with Desktop Experience) from VHD

The reason behind writing this article is to use my Laptop (having Intel i3 4th Gen and 8 GB of RAM) as my LAB for testing new Windows Server 2016 TP4 and to do that I have to use boot from VHD option. There are multiple ways to boot your system from VHD but I don’t find a simple and effective one. Second reason is I wanted to boot the Windows Server 2016 TP4 with GUI (aka Desktop Experience), coz I like the new Windows GUI.

So, let’s get started.

First, you have to download the Windows Server 2016 TP ISO from here. Once downloaded, extract the ISO content to a folder (I have extracted to C:\MyData\WinSvr2016). Now you have to create a VHD and mount it with any available drive letter (I selected V). Use the following set of command one by one from PowerShell or Command prompt with administrative privilege.

Continue reading

Setup your own Monitoring – Disk Space Utilization Monitoring tool for free

It is always recommended to keep tracking of the disk space utilization for you servers. This will help us to get the idea of our future requirement. There are multiple tools available for track this but you have to pay for most of them. Recently I also had similar kind of requirement and I was asked to provide the free solution for this.

There are some free tools available but all of them having some short of limitation, and also for security reason, it is not recommended to install any free tools on the server. So, I had to look for some alternatives, and I thought why we don’t use the PowerShell to get the disk space utilization details daily and kept it in MS Access database using Microsoft Access Database Engine 2010, which is available for free.

Requirements:

How to Setup:

First you have to download and install MS Access Database Engine. Once the installation complete, you have to create a blank database with a table name DiskUtilization which will have following field.

image001

image003
If you do not have MS Access installed, then you could also download and use the following blank database for Disk Utilization.

  DiskUtilization (560.0 KiB, 641 hits)


Continue reading