Monday, May 18, 2015

The Case of the Mysterious Blank Desktop, part 2?

Hello everyone, 

I recently experienced an issues login into a Windows Server 2008 R2. Whenever I would log in, whether through RDP or VM Console, the only thing that would load was a blank desktop. No errors, no windows, no explorer. I wasn't able to use Remote Tools, but I was able to use PSRemote and from there was was able to pull the following log:

[HOSTNAME]: PS C:\Users\USERNAME\Documents> Get-EventLog -LogName Application | ?{$_.Source -eq 'Winlogon'} | ?{$_.EntryType -eq 'Warning'} | select -First 1 | fl * -Force


EventID            : 4006
MachineName        : HOSTNAME.DOMAIN.com
Data               : {5, 0, 0, 0}
Index              : 40795
Category           : (0)
CategoryNumber     : 0
EntryType          : Warning
Message            : The Windows logon process has failed to spawn a user application. Application name: . Command line
                      parameters: C:\Windows\system32\userinit.exe.
Source             : Winlogon
ReplacementStrings : {, C:\Windows\system32\userinit.exe}
InstanceId         : 2147487654
TimeGenerated      : 5/18/2015 8:47:26 PM
TimeWritten        : 5/18/2015 8:47:26 PM
UserName           :
Site               :
Container          :

I quickly pulled out Google and found the following article, but to my demise after checking the local group I found that the users were already added.

[HOSTNAME]: PS C:\Users\USERNAME\Documents> net localgroup users
Alias name     users
Comment        Users are prevented from making accidental or intentional system-wide changes and can run most applications

Members

-------------------------------------------------------------------------------
NT AUTHORITY\Authenticated Users
NT AUTHORITY\INTERACTIVE
DOMAIN\Domain Admins
DOMAIN\Domain Users
The command completed successfully.

Great so now what? I searched the internet trying to find someone who might have experienced a similar issue but i only found similar articles to the one linked above. I attempted to reboot, to remove the users Authenticated Users/Interactive off the group, reboot, add them again and reboot once again, but nothing.

I did have some idea of what might be causing the issue based on the article though, so I attempted moving the computer to a different OU that doesn't require UAC to be turned on. I updated the group policy and rebooted but still nothing. Frustrated I went to to Regedit and attempted to load the UAC settings to find out if it was turned on or off by using the following command that I got from this article.

[HOSTNAME]: PS C:\Users\USERNAME\Documents> (Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System).EnableLUA

To my surprise I got nothing. Null return value. I thought that was weird, so I confirmed on a different server with the same version to ensure that the command was correct, and it was returning a result of 0. So I re-added the setting using the following command, also found in the article. 

[HOSTNAME]: PS C:\Users\USERNAME\Documents> Set-ItemProperty -Path registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system -Name EnableLUA -Value 0

I rebooted and the server logged back in without any issues. I have no idea how this registry could have been deleted, or why it had this effect so if anyone has any more information please be sure to share.

I hope this might help someone out there. Do let me know if you have any questions, issues or comments. 

Kind regards, 
Me.

Thursday, May 14, 2015

Windows 10 Preview

Hello everyone, 

For the first time in my life I have a spare computer that I can use to test things on. So I signed up for Windows Insider and installed Windows 10 on my laptop which I have been using on the regular bases. I'm not much of a writer so I won't even attempt to do a full review on my experience, but I did want to comment on the quality of people that I have found on the Microsoft reviewing forums. 

The truth is that people are nasty. I went through quite a few posts and most of the posts was of people complaining and calling that Windows will be a failure. All because of the way that the UI looks. Instead of providing constructive criticism to help develop a better operating system we have people crying about the way that the task bar is, or the way the start menu looks, or the how the icons are flat! I mean come on people! We are all tech savvy here what does it matter what the system looks like as long as it works? 

Windows is quite frankly implementing some really good features not only on their desktop environment but on the server environment, and so what if it looks different? We shouldn't be using the system for how it looks but for what we can do with it. After all we can always hack our way to change the way things look. 

I do hope that people can change their outlook on how things are going with Windows 10. It will either be a success or a failure, and if its a failure its not like it was a few years back and we actually have options.

Kind regards, 
Me.

Get-DFSNFolderTarget

Hello! 

I been wondering how I can find out where a DFS target is through PowerShell for quite some time now, and perhaps I didn't look hard enough because today I found the cmdlet in the subject. 

Get-DfsnFolderTarget [-Path] <String> [[-TargetPath] <String> ] [-CimSession <CimSession[]> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]

It is a very handy command that will return the following output: 

PS Microsoft.PowerShell.Core\FileSystem::\\DFS\SHARE\PATH> Get-DfsnFolderTarget \\DFS\SHARE\PATH | fl *


Path                  : \\DFS\SHARE\PATH
State                 : Offline
ReferralPriorityClass : sitecost-normal
NamespacePath         : \\DFS\SHARE\PATH
ReferralPriorityRank  : 0
TargetPath            : \\targetServer\Share
PSComputerName        :
CimClass              : Root/Microsoft/Windows/dfsn:MSFT_DfsNamespaceFolderTarget
CimInstanceProperties : {NamespacePath, ReferralPriorityClass, ReferralPriorityRank, State...}
CimSystemProperties   : Microsoft.Management.Infrastructure.CimSystemProperties

However, I have found it to be less than helpful if I don't know exactly 
where the DFS namespace ends and the targetPath begins, for example:

\\DFS\SHARE\PATH\Something\Folder 

If I try to find the root using this path I receive the following error:

Get-DfsnFolderTarget : Cannot get DFS folder properites on
"Microsoft.PowerShell.Core\FileSystem::\\DFS\SHARE\PATH\Something\Folder"
At line:1 char:1
+ Get-DfsnFolderTarget $((Get-Item .\).PSParentPath)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (MSFT_DfsNamespaceFolderTarget:ROOT\Microsoft\...aceFolderTarget) [Get-Dfs
   nFolderTarget], CimException
    + FullyQualifiedErrorId : Windows System Error 1722,Get-DfsnFolderTarget

Get-DfsnFolderTarget : A general error occurred that is not covered by a more specific error code.
At line:1 char:1
+ Get-DfsnFolderTarget $((Get-Item .\).PSParentPath)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (MSFT_DfsNamespaceFolderTarget:ROOT\Microsoft\...aceFolderTarget) [Get-Dfs
   nFolderTarget], CimException
    + FullyQualifiedErrorId : MI RESULT 1722,Get-DfsnFolderTarget

I am not sure why though. It is simple enough to get the information form the
GUI so perhaps is my inexperience or lack of knowledge, but why can't it be 
this easy on the cmd line as well?

I do hope that it is just my lack of knowledge and that maybe one of you
might show me the right way to get the DFSFolderTarget path. 

Kind regards, 
Me