Windows 10 Build Numbers

I find myself needing to look up the Windows 10 build numbers more often than I care to admit, so I figured I might as well post them here. Very useful for SCCM queries or scripts that take action depending upon the OS build.

Windows 10 release information

  • Windows 10 1709 (OS build 16299)
  • Windows 10 1703 (OS build 15063)
  • Windows 10 1607 (OS build 14393)
  • Windows 10 1511 (OS build 10586)
  • Windows 10 1507 (OS build 10240)

In SCCM, the build number can be queried via the Operating System.Build Number attribute. For example, to get all computers running Windows 10 1703:

WQL

select SMS_R_System.Name from SMS_R_System inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_OPERATING_SYSTEM.BuildNumber = "15063"

The build number can also be retrieved locally by querying WMI or the system Registry.

WMI

Select BuildNumber from Win32_OperatingSystem

wmic os get buildnumber

Registry

REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v CurrentBuild

REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v CurrentBuildNumber

Advertisements

BitLocker – Determining Non-Compliance Reasons for MBAM Clients

Here’s a useful article from Microsoft on determining non-compliance reasons for MBAM 2.5 clients.

Determining why a Device Receives a Noncompliance Message

Basically, it describes how to query the non-compliance code and provides reference for what each code means. You can then use this data to troubleshoot and take corrective action as needed.

PowerShell

gwmi -class mbam_volume -Namespace root\microsoft\mbam

CMD

wmic /namespace:\\root\microsoft\mbam path MBAM_Volume where "VolumeName like 'C:%'" get ReasonsForNoncompliance

WMI

Namespace: root\Microsoft\MBAM

Select ReasonsForNoncompliance from MBAM_Volume where VolumeName like 'C:%'

 

Non-compliance Codes

0 – Cipher strength not AES 256.

1 – MBAM Policy requires this volume to be encrypted but it is not.

2 – MBAM Policy requires this volume to NOT be encrypted, but it is.

3 – MBAM Policy requires this volume use a TPM protector, but it does not.

4 – MBAM Policy requires this volume use a TPM+PIN protector, but it does not

5 – MBAM Policy does not allow non TPM machines to report as compliant.

6 – Volume has a TPM protector but the TPM is not visible (booted with recover key after disabling TPM in BIOS?).

7 – MBAM Policy requires this volume use a password protector, but it does not have one.

8 – MBAM Policy requires this volume NOT use a password protector, but it has one.

9 – MBAM Policy requires this volume use an auto-unlock protector, but it does not have one.

10 – MBAM Policy requires this volume NOT use an auto-unlock protector, but it has one.

11 – Policy conflict detected preventing MBAM from reporting this volume as compliant.

12 – A system volume is needed to encrypt the OS volume but it is not present.

13 – Protection is suspended for the volume.

14 – AutoUnlock unsafe unless the OS volume is encrypted.

15 – Policy requires minimum cypher strength is XTS-AES-128 bit, actual cypher strength is weaker than that.

16 – Policy requires minimum cypher strength is XTS-AES-256 bit, actual cypher strength is weaker than that.

 

VMware Horizon – Preparing a Gold Master VM for Cloning

As a follow up to an older post,  Prepare Windows 7 Gold Master Virtual Machine for Cloning, below is a quick batch script that I use to prepare my Windows gold VMs just before creating a snapshot and recomposing my pools.

I’ve added a few commands for my environment, but credit to this blog for the framework: https://www.ituda.com/vmware-horizon-view-recomposing-dont-forget-to-cleanup-after-you-finished/

This script has been tested on the following platforms:

  • Windows 10 Enterprise 1511
  • Windows 10 Enterprise 1607
  • Windows 10 Enterprise 1607 LTSB
  • Windows 10 Enterprise 1703

I have not tested it on Windows 7/8/8.1, but I imagine it will work fine on those platforms as well.

In summary, when executed the script will:

  1. Execute all queued .NET framework items
  2. Disable the Windows Update Service
  3. Configures the AppVolumes Service for automatic start, if applicable
  4. Delete all shadow copies
  5. Delete cached Windows Update downloads
  6. Delete hidden install files
  7. Delete prefetch files
  8. Run Disk Cleanup
  9. Defragment the disk
  10. Rearm Office 2016 activation, if applicable
  11. Clear the Windows Event Logs
  12. Release the currently assigned IP address
  13. Flush the local DNS cache
  14. Shut down the VM

Script code:

REM Copy this code into a blank txt file and then rename the file to VMCleanup.bat
REM Copy VMCleanup.bat to your Gold Master VM and run as an admin just before creating a snapshot
REM *****************************************************
REM Execute queued .NET Framework items
C:\Windows\Microsoft.NET\Framework\v2.0.50727\ngen.exe executeQueuedItems
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\ngen.exe executeQueuedItems
REM *****************************************************
REM Stop and Disable the Windows Update Service
sc stop wuauserv
sc config wuauserv start= disabled
REM *****************************************************
REM Set AppVolumes Service to automatic start
sc config svservice start= auto
REM *****************************************************
REM Delete shadow copies
vssadmin delete shadows /All /Quiet
REM *****************************************************
REM Delete all cached Windows Update downloads
del c:\Windows\SoftwareDistribution\Download\*.* /f /s /q
REM *****************************************************
REM Delete hidden install files
del %windir%\$NT* /f /s /q /a:h
REM *****************************************************
REM Delete prefetch files
del c:\Windows\Prefetch\*.* /f /s /q
REM *****************************************************
REM Run Disk Cleanup. Runc:\windows\system32\cleanmgr /sageset:1 and check
REM desired options before running
c:\windows\system32\cleanmgr /sagerun:1
REM *****************************************************
REM Defragment the disk
sc config defragsvc start= auto
net start defragsvc
defrag c: /U /V
net stop defragsvc
sc config defragsvc start = disabled
REM *****************************************************
REM Rearm Microsoft Office 2016 activation
"C:\Program Files (x86)\Microsoft Office\Office16\OSPPREARM.exe"
REM *****************************************************
REM Clear Windows Event Logs
wevtutil el 1>a.txt
for /f %%x in (a.txt) do wevtutil cl %%x
del a.txt
REM *****************************************************
REM Release IP address
ipconfig /release
REM *****************************************************
REM Flush DNS cache
ipconfig /flushdns
REM *****************************************************
REM Shutdown the VM
shutdown -s -f -t 15

 

Disclaimer: Scripts on this blog are provided as-is and I offer not support for them. All scripts were written for and tested in the specific environment for which they were intended for use, and are in no way guaranteed. Always test scripts in an isolated environment and please feel free to make modifications as needed. I also acknowledge that there may be alternate and/or more efficient ways to write these scripts and accomplish the same tasks, and I welcome suggestions and feedback.

Using Group Policy Preferences with Older Versions of Windows

http://www.microsoft.com/en-us/download/details.aspx?id=6955I was doing some testing with a newly created GPO that used Group Policy Preferences (GPP) to add a user account to the local administrators group, and I noticed that the policy seemed to apply properly to all of my Server 2012 and 2008 systems but not on any Server 2003 machines.

I did some research and came across an article on Microsoft’s Group Policy blog that shined some light on my issue:

Group Policy Preferences Not Applying on Some Clients: Client-Side Extension, XMLLite

The gist of it is that I needed to install the proper Client-Side  Extensions (CSEs) for Server 2003. All of the links for the individual OSes and versions are in the MS blog post, but the specific one I needed is below.

CSEs for Windows Server 2003 with SP1 or later (32-bit)

You may also need to install XMLLite in addition to the CSEs, but to quote the post:

“XMLLite is not needed if:

· Your clients run Windows Server 2008 or Windows Vista.

· Your clients Windows XP and Windows Server 2003 clients run Internet Explorer 7 and/or the latest service packs.”

After installing the CSEs on my machines, they started processing the GPPs normally.

Drop Down

As a side-note for anyone interested; The GPP to add user accounts to local groups is located under Computer Configuration -> Preferences -> Control Panel Settings -> Local Users and Groups.

To modify a local group, right-click and select New – > Local Group, choose Update as the action, pick a group from the Group Name drop down menu, in my case Administrators (built-in) (make sure to use the drop down and not the ellipses button; see image), and then use the Add button at the bottom of the window to add either local or domain accounts to that group.

Most of the guides I’ve found suggest using Computer Configuration\Policies\Windows Settings\Security Settings\Restricted Groups to add users to the local administrators group, but this policy acts to replace any existing memberships rather than merge with them, so keep this in mind if you have Group Policy Objects linked at higher OUs which add users to the same groups. If you want to preserve the existing memberships, consider using GPPs to make the modifications instead.

-Rick

Alt Methods to Fix: “The Trust Relationship Between This Workstation and the Primary Domain Failed”

 

For any Windows admin, this error is a familiar sight.

The typical fix, and Microsoft’s recommended resolution, is to log in with a local admin account, join the system to a workgroup, and then rejoin it to the domain.

However, I ran into this blog post a while back which details some cool alternative methods and saved the link in case it should come in handy some day, which it has on several occasions.

DON’T REJOIN TO FIX: The trust relationship between this workstation and the primary domain failed

Basically, he lists two distinct methods for resetting the computer password:

  1. use netdom.exe

netdom.exe resetpwd /s:<server> /ud:<user> /pd:*

<server> = a domain controller in the joined domain

< user> = DOMAIN\User format with rights to change the computer password

“Where you get netdom.exe depends on what version of Windows you’re running.”

“On Windows Vista and Windows 7 you can get it from the Remote Server Administration Tools (RSAT).”

Download RSAT for Windows 7 SP1 here

Download RSAT for Windows 8.1 here

You can read some additional notes about this method in the blog post. (link here)

  1. via Powershell

Reset-ComputerMachinePassword [-Credential <PSCredential>] [-Server <String>]

“You can use the Get-Credential cmdlet for a secure way to generate a PSCredential, which can be stored in a variable and used in a script.  You will want to generate a credential for an Active Directory user with sufficient rights to change the computer’s password.  The Server parameter is the domain controller to use when setting the machine account password.”

Here’s a TechNet article on the Reset-ComputerMachinePassword command for additional reference.

-Rick

SCCM 2012 R2 Client Installation Fails on Windows Server 2003

http://www.microsoft.com/en-us/download/details.aspx?id=4933

If your environment is like mine, you may be forced to manage some legacy systems with Configuration Manager, some of which may be running older operating systems like Windows Server 2003.

You may also find that the SCCM client refuses to install on Server 2003.

Luckily, the fix is easy enough. The SCCM client requires BITS 2.5 to be installed as a prerequisite. You can download BITS 2.5 for Windows Server 2003 here.

After downloading and installing BITS 2.5 on your Windows Server 2003 systems, you should be able to deploy the SCCM client without a problem.

Sources:

SCCM Not installing 2012 SP1 client on Server 2003 clients

SCCM 2012 and Server 2003×64\XPx64

-Rick

SCCM 2012 R2 – Error When Running Reports – UserTokenSIDS: A Specified logon session does not exist

UserTokenSIDs

 

After installing my SCCM 2012 R2 Primary Site, I attempted to test out the reporting feature and kept running into the following error when trying to run any of the built-in reports:

The DefaultValue expression for the report parameter ‘UserTokenSIDs’ contains an error: a specified login session does not exist. It may already have been terminated.

I did some research and eventually tied it back to my SQL Server Reporting Services (SSRS) configuration.

I have SSRS installed on my primary site server with the reporting database sitting on a remote system running SQL Server 2012,  and when I initially set up SSRS I had it using the Local System built-in account as the service account.

SRSLocal

 

After going back and reviewing the documentation and reading over various blog posts, I realized using Local System as the service account wasn’t going to work and I needed to specify a domain resource account to use with the proper permissions set.

Configuring Reporting in Configuration Manager

Configure a Service Account for Reporting Services

Reporting Services Configuration Manager (SSRS)

So I created a new resource account specifically for SCCM and SSRS, named SMSRS, and made sure to add it to the local SMS Admins group on the site server and grant it sysadmin and remote access permissions to the reporting databases on my SQL server. I then reconfigured the SSRS Service Account and Current Report Server Database Credential settings to use this new SMSRS account.

After restarting the service, I was able to run reports in SCCM without any further trouble.

A few quick additional notes:

  • Before changing the service account for SSRS, be sure to back up the encryption key for the original account so you don’t lose the ability to talk to the existing reporting database.
  • After changing the service account, perform a restore of the backed-up encryption key.

Instructions for backing up and restoring SSRS encryption keys for SQL Server 2012 are here:

Back Up and Restore Reporting Services Encryption Keys

SSRSEncryptionKeys

  • The service account used for SSRS must be a member of the domain local security group Windows Authorization Access Group and have Allow Read tokenGroupsGlobalAndUniversal permissions in Active Directory.

SCCM 2012 R2 Upgrade Breaks SSRS with UserTokenSIDs contains an error

-Rick

SCCM 2012 R2 – Configure Software Inventory

SftInv

Shortly after installing SCCM 2012 R2 and getting the client installed on a few test systems, I noticed that the Inventoried Software section under Assets and Compliance\Asset Intelligence was empty and there was no application information showing up in Resource Explorer. I double checked that I had enabled Software Inventory in my client settings, which I had, so I started doing some research.

Turns out that I was missing two key settings to get what I wanted.

First, I neglected to specify any file types for the SCCM client to include in its software inventory.

Configuration Manager 2012 Software Inventory Missing

I had initially made the assumption that there was a built-in process for discovering installed software and that the “Inventory these file types” setting was only to specify additional file types as needed. As the blog post above suggests, in SCCM 2012 this isn’t the case.  If you don’t explicitly tell the client what to look for, it won’t return any results.

To correct this, I added two wild card entries to the client settings for file types:

  1. *.exe in %ProgramFiles%
  2. *.exe in %ProgramFiles(x86)%

FileTypes

After adding these rules and giving my clients time to get the new settings and run another software inventory cycle, I started seeing results in Asset Intelligence.

However, when I opened up Resource Explorer I found that the only information available under Software was simple file names, paths, and the modified date, among a few other minor file details. Useful, but not quite what I was looking for.

I can’t find the article that I came across now (I’ll try to add it later), but after doing some more research I found  out that you can also add software inventory functionality to the Hardware Inventory pass to get more details about installed applications. Luckily, enabling this was easy enough and just required adding a few additional classes to the hardware inventory client settings.

With Hardware Inventory selected click the Set Classes…. button, which brings up a list of the available items to be included in the hardware inventory. To enable additional software inventory functionality, just check the Installed Applications, Installed Executable, and Installed Software classes from the list.

HardwareInv

After doing this, Resource Explorer now has these new classes available and I’m able to see product GUIDs, version numbers, install dates, file hashes, uninstall strings, and more. Much more useful.

ResEx

-Rick

Mobile Device Management Article

Source: http://blog.commontime.com/google-mdm-not-a-world-beater/

Back in mid-2012, I was featured in an article for EdTech Higher Education Magazine on Mobile Device Management solutions. For anyone interested in the MDM space, you can read the article online at:

How to Save Money, Time and Sanity with Mobile Device Management Software

SCCM 2012 R2 – Installation & Configuration

As a follow-up to my System Center 2012 R2 Infrastructure Planning post on SCCM, I’ll use this post to consolidate some of the resources that I found for the installation and configuration of Configuration Manager 2012 R2.

My SCCM environment consists of a Stand-Alone Primary Site Server with a remote SQL Server, both running Windows Server 2012 R2, so much of this information will be geared towards similar environments.

First and foremost I highly recommend bookmarking and reading through the System Center 2012 Configuration Manager Survival Guide and the Windows-noob System Center 2012 Configuration Manager Guides. I’ve found both to be invaluable resources as they contain step-by-step guides for installing and configuring most of the major SCCM 2012 features. Since these guides are fairly exhaustive I wont bother reposting most of what they already cover, so if you don’t see something here check them out.

Pre-Installation Tasks

Again, my SCCM environment will consist of two Windows Server 2012 R2 servers:

Server 1 – SCCM Primary Site Server and SQL Reporting Services

Server 2 – SQL Server for Site and Reporting Databases

  1. Extend the Active Directory Schema

Information on deciding if to extend the AD Schema for SCCM and details of the process:

Extending the Schema in System Center 2012 Configuration Manager

Extending the AD Schema for Configuration Manager 2012

Deploying SCCM 2012 Part 2 – Creating Container, Extending the AD Schema 

  1. Create resource accounts in Active Directory

Some good resources on the common accounts needed for SCCM:

Using System Center 2012 Configuration Manager – Part 1. Installation – CAS

System Center 2012 Service Accounts & Permissions

Technical Reference for Accounts Used in Configuration Manager

These sources list a number of accounts but, for a sake of simplicity in a relatively small environment, I created a single SMSAdmin account that I will be using for just about everything in SCCM. All of the resource accounts listed require little more than domain user and local administrative privileges on the Site and SQL servers.  The only additional step that was needed was to delegate permissions for the SMSAdmin account to join computers to the domain for OSD, which I just did to a single test OU for the time being.

Joining a computer to domain by delegating to domain user

  1. Add Server Roles to Server 1

SCCM 2012 Installation Guide

Configuration Manager 2012 Implementation and Administration

Prepare the Windows Environment for Configuration Manager

  • Installed Windows Server Update Services (WSUS)
  • Installed IIS with the following Role Services:
    • Common HTTP Features
      • Default Document
      • Directory Browsing
      • HTTP Errors
      • Static Content
      • HTTP Redirection
    • Health and Diagnostics
      • HTTP logging
      • Logging tools
      • Request Monitor
      • Tracing
    • Performance
      • Static Content Compression
    • Security
      • Request Filtering
      • Basic Authentication
      • URL Authorization
      • IP and Domain Restrictions
      • Windows Authentication
    • Application Development
      • .NET Extensiblity 3.5
      • .NET Extensiblity 4.5
      • ASP.NET 3.5
      • ASP.NET 4.5
      • ASP
      • ISAPI Extensions
      • ISAPI Filters
    • Management Tools
      • IIS Management Console
        • IIS 6 Management Compatibility
          • IIS 6 Metabase Compatibility
          • IIS 6 Management Console
          • IIS 6 Scripting Tools
          • IIS 6 WMI Compatibility
      • IIS Management Scripts and Tools
      • Management Service
  1. Add Features on Server 1

  • .NET Framework 3.5 Features
    • .NET Framework 3.5
    • HTTP Activation
  • .NET Framework 4.5 Features
    • .NET Framework 4.5
    • ASP.NET 4.5
    • WCF Services
      • TCP Port Sharing
  • Background Intelligent Transfer Service (BITS)
    • IIS Server Extension
  • Remote Differential Compression
  • Remote Server Administration Tools
    • Feature Administration Tools
      • BITS Server Extensions Tools
  • SMB 1.0/CIFS File Sharing Support
  • User Interfaces and Infrastructure
    • Graphical Management Tools and Infrastrucure
    • Server Graphical Shell
  • Windows PowerShell
    • Windows PowerShell 4.0
    • Windows PowerShell 2.0
    • Windows PowerShell ISE
  • WoW64 Support
  1. Download and Install Windows ADK for Windows 8.1 on Server 1

Windows Assessment and Deployment Kit (Windows ADK) for Windows 8.1

Installed the following:

  • Deployment Tools
  • Windows PE
  • User State Migration Tool (USMT)
  1. Run SCCM Prerequisite Check on Server 1

http://technet.microsoft.com/library/gg712320.aspx#BKMK_PrerequisiteChecker

To ensure my server was fully prepared for SCCM, I ran the prerequisite checker included on the installation media. With the media mounted, browse to and run “SMSSETUP\BIN\x64\prereqchk.exe /local” to run all checks.

The prerequisite check failed for me on the SQL server pass because SQL is not locally installed on the Primary Site Server, but all other checks passed.

  1. Install SQL Server on Server 2

We chose to go with SQL Server 2012, but if you prefer a different version see the requirements chart:

SQL Server versions that are supported by System Center 2012 Configuration Manager

System Center 2012 Configuration Manager Best Practices:

“SQL Collation must be set to ‘SQL_Latin1_General_CP1_CI_AS'”

“Why is it important ? well firstly because it is a setting that most people don’t change (as it’s hidden from view) and secondly it’s set based on your regional settings. When you install SQL Server (which ConfigMgr needs to host it’s database) the SQL Collation is ‘set in stone’ during setup, that’s why knowing what your SQL Collation is and what it should be are important prior to running ConfigMgr setup. To learn how to identify your SQL Collation on a running SQL Server and how to change SQL Collation during SQL Server setup see this post  . Having the wrong SQL Server Collation will require you to reinstall SQL Server from scratch, and that takes time and effort.”

“Best Practices for SQL Server Installation”

“A lot of early adopters of System Center 2012 Configuration Manager are having issues getting SQL Server installed correctly.  Many issues are due to having the wrong supported version or cumulative update applied.  For information on supported versions please see Supported Configurations for Configuration Manager : http://technet.microsoft.com/en-us/library/gg682077.aspx#BKMK_SupConfigSQLDBconfig  
SQL server issues can also be seen when having the wrong certificate applied or by misconfiguring the port.  For SQL Server installation and configuration tips see the support blog http://blogs.technet.com/b/configurationmgr/archive/2012/05/03/fix-unable-to-connect-cas-or-primary-to-the-sql-database-during-the-system-center-2012-configuration-manager-setup.aspx 

SQL Server Installation Guides:

Installing SQL Server for SCCM 2012 SP1

See Step 11 here:

Using System Center 2012 Configuration Manager – Part 1. Installation – CAS

These guides are for SQL Server 2008, but still a good reference for setting up 2012.

I used a custom instance name (e.g. OrgSCCM) to help distinguish the SCCM databases and added my SMSAdmin resource account to the local admin group on Server 2.

  1. Install SQL Server Reporting Services on Server 1

To install SSRS, I just ran the SQL Server 2012 installer and selected only the Reporting feature. I also used a custom instance name e.g. SCCMSRS.

After installation, I then just used the Reporting Services Configuration Manager on Server 1 to point it to the SCCM DB instance on Server 2 for the Reporting Server Database location using the SMSAdmin account.

Install and Configure SCCM on Server 1

Now we’re ready to install Configuration Manager. For the installation and basic setup of SCCM components, I generally referred to the two master guides that I mentioned at the start of this post. Some specific guides:

Using SCCM 2012 RC in a LAB – Part 1. Installation

Using SCCM 2012 RC in a LAB – Part 3. Configuring Discovery and Boundaries

Using SCCM 2012 RC in a LAB – Part 4. Configuring Client Settings and adding roles

Using SCCM 2012 RC in a LAB – Part 2. Add SUP and WDS

Once again, they’re  geared towards lab environments but they proved more than adequate to get me up and running and comfortable enough with the basics to make the customizations I needed.

 

I’ll create additional posts in the coming weeks on SCCM 2012 R2 as I get further into my testing to highlight any issues that I run in to and provide solutions.

-Rick