soe

SCCM client = None after deploying an operating system

In an environment where you use certificates this can happen.

CLientIDManagerStartup.log will mention

Regtask: Failed to refresh MP. Error: 0x80004005

alot of times...

Below I have the 2 fixes!

Fix 1 is to take advantage of the TS Variable SMSTSPostAction to restart the computer once completed
with the value 'shutdown /r /t 0 /f'

This should ensure the cert is requested.

Fix 2:

From testing - after Fix 1 you may need to re-start the SCCM agent.
To do this create a scheduled task that runs on start-up

Program: Powershell

Arguments: -Command "& {start-sleep 120; restart-service ccmexec; Unregister-ScheduledTask -TaskName 'Restart SCCM Initial boot' -Confirm:$false;}"

Run whether or not user is logged on.

 

Export the scheduled task as 'RestartSCCM.xml' and create a package and command line to run at the end of OSD

SCHTASKS.exe /CREATE /RU system /XML "RestartSCCM.xml" /TN "Restart SCCM Initial boot"

 

Happy deploying!

Monitoring your fleets event logs - Part 2

 

Install Splunk - It's free! https://www.splunk.com/en_us/download/splunk-enterprise.html

Modify Program Files\Splunk\etc\system\local\inputs.conf

Add the lines

[WinEventLog]
evt_resolve_ad_obj = 1

 

Then we need to reboot splunk, in Splunk click Settings, then Server controls and click Restart Splunk

Next we need to add our data source, click Add Data from the launch screen, then monitor

 

Choose Local Events then ForwardedEvents and click Next

 

Click Create a new index, call it ForwardedEvents, click Save, change the Index to ForwardedEvents and then click Review, Submit

Give it some time to collect a few logins, then go to Search & Reporting

index="forwardedevents" LogName="Microsoft-Windows-User Profile Service/Operational" (EventCode=1 OR EventCode=2 OR EventCode=6 OR EventCode=7)  | transaction ComputerName startswith=eval(EventCode=1) endswith=eval(EventCode=2) | table ComputerName, duration

So I'm using the selected data, filtering for 4 event codes, then getting the time between event code 1 and 2, and putting it into a table..

Edit: This search can be a bit funny, the delay ended up being between synching the roaming profile so I've also ran

index="forwardedevents" LogName="Microsoft-Windows-User Profile Service/Operational" (EventCode=1 OR EventCode=2 OR EventCode=6 OR EventCode=7)  | transaction ComputerName startswith=eval(EventCode=6) endswith=eval(EventCode=7) | table ComputerName, duration

Then click on the Visualization tab

This also lets you dive into each login by clicking one and get the event logs!

You can save this as a report, dashboard and share with people.

 

There is so much more you can do with this software, and it takes some time to learn it. Will post more as I do..

 

 

Monitoring your fleets event logs - Part 1

Windows has an amazing feature that let's you collect logs from remote computers, it's called Windows Event forwarding and is pretty easy to set up. Once we have this data we can use free tools such as Splunk or GrayLog to analyse the data, find patterns, fix.

 

Below is the way to get started collecting the user profile logs to analyse things such as login performance with roaming profiles, something we are dealing with right now! Please note you need to enable winrm on your computers for forwarding to work.

First you need a machine that will be the data collectior.

  1. On that machine open Event Viewer and right click Subscriptions. You may get the following message to enable the service on startup

2. Now you should only collect data that you will use, in this example we are collecting the Microsoft-Windows-User Profile Service/Operational events so we will call it Microsoft-Windows-User Profile Service - Operational

3. Change the type to Source computer initiated and click Select Computer Groups

4. Add the group of machines to the Computer list and click OK

5. Click Select Events

6. We now select the Applications and Services Logs\Microsoft\Windows\User Profile Service

7. You can configure advanced settings to control how the computers forward the events.

8. Click OK

9. To get clean data we need to change the format of returned events by running the command:
wecutil ss "Microsoft-Windows-User Profile Service - Operational" /cf:Events

10. Next you deploy a group policy that tells your computers to go to the data collector for jobs

Create a group policy using Computer Configuration\Policies\Administrative Templates\Windows Components\Event Forwarding

11. Select Configure target Subscription Manager

12. Set to Enabled

13. Click Show

14. Insert the line
Server=http://SERVER.FQDN:5985/wsman/SubscriptionManager/WEC,Refresh=60

15. Replace SERVER.FQDN with your data collector's name.

16. To test run GPUPDATE /FORCE on the remote machine

17. If successful, on the data machine you will see the number of source computers change and logs in the forwarded events

Visit https://blogs.technet.microsoft.com/jepayne/2015/11/23/monitoring-what-matters-windows-event-forwarding-for-everyone-even-if-you-already-have-a-siem/ for more information.

 

PART 2 

 

 

Disabling Windows File Explorer banner advertising

Microsoft has soo much advertising power with Windows 10, they can now put banners up in Windows Explorer via updates. You may see one such as this:
'Save your documents and photos to OneDrive' or 'Get the best deal on your cloud storage with OneDrive'

The setting is called Show Sync Provider Notifications however it has been used for other purposes such as when you do a feature update

 

 

 

To prevent this from happening push out a group policy User preference
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced

Value: ShowSyncProviderNotifications
Value Type: REG_DWORD
Value Data: 00000000
Base: Hex

Error message when no Asset Tag Detected

Set the computer name using the BIOS Asset Tag

If you are setting the Asset Tag the same name that the computer is, it makes sense to only have to input it once. I created a powershell script that will do the following:

If VM or Mac: Exit 0

If  computer exists in SCCM: Exit 0

If AssetTag Exists/Not empty: Set OSDComputerName to AssetTag, Exit 0

If AssetTag doesn't exist: Bring up an error message, Exit 1

 

Tested with HP and Dell machines.

Download Script https://github.com/happysccm/Files/tree/master/Check%20for%20Asset%20Tag%20-%20OSD%20AssetTag%20Check%20-%20Most%20code%20by%20Nickolaj%20and%20Dave%20Green

Update: Added optional script that uses the HP Ownership Tag

How to use:
Create a package for the script

Copy serviceUI.exe (From MDT Toolkit) to the same folder.

In the Task Sequence after initial format of the drive create a Run Command Line step using the package that you created

with the command: ServiceUI.exe -process:TSProgressUI.exe %SYSTEMROOT%\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -File AssetTag.ps1

 

Thanks Nickolaj and Dave Green for the initial form

 

Disabling (Adobe's) Office Add-ins

I don't think outlook should be making PDFs.. You can disable the add-ins with group policy

Download Office ADMX files
2013: https://www.microsoft.com/en-au/download/details.aspx?id=35554

2016: https://www.microsoft.com/en-au/download/details.aspx?id=49030

Copy the files under ADMX to your policy central store

Now create a group policy, browse to

User Configuration > Administrative Template > Microsoft Outlook 2016 > Miscellaneous > List Of Manage add-ins

Edit the policy setting, click show

Then specify the add-ins you want to disable with a value 0

To block other add-ins you need to find the progID for the addin, they can be found in the registry for each app in the suite:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\Outlook\Addins or HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\Outlook\Addins

To block Adobe out of Office altogether:

Admin Templates - For each List of manage Add-ins

Microsoft Excel 2016:
PDFMaker.OfficeAddin 0

Microsoft Excel 2013:
PDFMaker.OfficeAddin 0

Microsoft Word 2016:
PDFMaker.OfficeAddin 0

Microsoft Word 2013:
PDFMaker.OfficeAddin 0

Microsoft Powerpoint 2016:
PDFMaker.OfficeAddin 0

Microsoft Powerpoint 2013:
PDFMaker.OfficeAddin 0

Microsoft Outlook 2016:
AdobeAcroOutlook.SendAsLink 0
PDFMOutlook.PDFMOutlook 0

Microsoft Outlook 2013:
AdobeAcroOutlook.SendAsLink 0
PDFMOutlook.PDFMOutlook 0

 

 

Another option (less harsh) is to change the load behaviour to 2 via registry after install or possibly a preference. This makes the plugin not loaded by default but allows the user to load it manually.

Example Reg https://1drv.ms/t/s!Apq2Xflj18I1wGkFeyX_T3lbtM5G

 

MDT Toolkit files fail to download - could not resolve source

IMG_6554

If this happens during OSD, it is likely due to 2 settings in the BIOS.

 

I recommend

WIN7 -

Boot mode: Legacy
Sata mode: AHCI

Win10-

Boot mode: UEFI
Sata mode: AHCI

 

 

From the log:
The task sequence execution engine failed executing the action (Use Toolkit Package) in the group (Initialization) with the error code 2147942561
Action output: ... ursiveCreatePath(sPath.substr(0, nPos), psa), HRESULT=800700a1 (e:\nts_sccm_release\sms\framework\core\ccmcore\path.cpp,104)
RecursiveCreatePath(sPath.substr(0, nPos), psa), HRESULT=800700a1 (e:\nts_sccm_release\sms\framework\core\ccmcore\path.cpp,104)
RecursiveCreatePath( sNormalizedPath, psa ), HRESULT=800700a1 (e:\nts_sccm_release\sms\framework\core\ccmcore\path.cpp,159)
DownloadContentLocally (pszSource, sSourceDirectory, dwFlags, hUserToken, mapNetworkAccess), HRESULT=800700a1 (e:\nts_sccm_release\sms\framework\tscore\resolvesource.cpp,3582)
TS::Utility::ResolveSource (pszPkgID, sPath, 0, hUserToken, mapNetworkAccess), HRESULT=800700a1 (e:\nts_sccm_release\sms\client\osdeployment\installsoftware\runcommandline.cpp,399)
cmd.Execute(pszPkgID,sProgramName, dwCmdLineExitCode), HRESULT=800700a1 (e:\nts_sccm_release\sms\client\osdeployment\installsoftware\main.cpp,372)
Failed to resolve the source for SMS PKGID=PS10098B, hr=0x800700a1
Install Software failed to run command line, hr=0x800700a1. The operating system reported error 2147942561: The specified path is invalid.

 

Microsoft Edge and Enterprise Mode

Microsoft really wants everyone to use it's shiny new browser, and I think everyone should. It is a completely new browser built for the modern web however there are limitations to building a browser just for the modern web mainly being legacy support of activex controls and Java so it's understandable that companies don't want Edge as the default browser however there is another way. The new Enterprise mode group policy lets companies decide what web pages will open in Internet Explorer instead. Ideally it would have been nice to have these sandboxed in an Internet Explorer tab however Microsoft wants the end user to know that this is what the organization has decided.

Setting up Edge Enterprise Mode

The first thing you need to do is download and install the Enterprise Mode Site List manager

https://www.microsoft.com/en-us/download/confirmation.aspx?id=42501

This is a simple tool that creates and versions a xml file that the client computer reads when launching the Edge Browser.

You can add and edit sites in this tool and then save as an XML File

Example adding ebay.com

enterprise mode for Edge

You can later turn off Open in IE once the business website is compatible with Edge.

Once you have made your list Click File > Save to XML

Now have a look at the xml file, it should look something like

 

<rules version="7">
<docMode />
<emie>
<domain exclude="true">ebay.com</domain>
<domain doNotTransition="true" exclude="false">cnet.com</domain>
</emie>
</rules>

This example sets eBay to load up in Internet Explorer and we have set cnet.com to now open in Edge from now on.

Once you are happy with your config it's time to test it as a group policy

The policy is Computer Configuration > Windows Components > Microsoft Edge > Configure the Enterprise Mode List

enterprise mode group policy

The value here can be

  • Drive Letter C:\EnterpriseMode.xml
  • Web URL http://localhost:8080/EnterpriseMode.xml
  • Network Share \\NetworkShare\EnterpriseMode.xml (I recommend placing this inside the group policy folder on Sysvol)

Alternatively you can also send all intranet sites to Internet Explorer using the group policy setting 'Send all intranet sites to Internet Explorer 11'

Testing

Using Edge browser enterprise mode

 

Hey Cortana! How do I add additional speeches during OSD so you work?

cortana

For Cortana to work with your language you need to install the appropriate speech pack however if you are connected to an enterprise WSUS you won't be able to see additional downloads for your language.

To work around this you can get the language cab files from the 'Windows 10 Features on Demand' iso available via volume license and MSDN downloads, then use dism commands to apply the desired language packages. Currently the available ones are

  • German - Germany (Microsoft-Windows-LanguageFeatures-Speech-de-de-Package.cab)
  • English - Australia (Microsoft-Windows-LanguageFeatures-Speech-en-au-Package.cab)
  • English - Canada (Microsoft-Windows-LanguageFeatures-Speech-en-ca-Package.cab)
  • English - United Kigndom (Microsoft-Windows-LanguageFeatures-Speech-en-gb-Package.cab)
  • English - India (Microsoft-Windows-LanguageFeatures-Speech-en-in-Package.cab)
  • English - United States (Microsoft-Windows-LanguageFeatures-Speech-en-us-Package.cab)
  • Spanish - Spain (Microsoft-Windows-LanguageFeatures-Speech-es-es-Package.cab)
  • French - France (Microsoft-Windows-LanguageFeatures-Speech-fr-fr-Package.cab)
  • Italian - Italy (Microsoft-Windows-LanguageFeatures-Speech-it-it-Package.cab)
  • Japanese - Japan (Microsoft-Windows-LanguageFeatures-Speech-ja-jp-Package.cab)
  • Chinese - China (Microsoft-Windows-LanguageFeatures-Speech-zh-cn-Package.cab)
  • Chinese - Hong Kong (Microsoft-Windows-LanguageFeatures-Speech-zh-hk-Package.cab)
  • Chinese - Taiwan (Microsoft-Windows-LanguageFeatures-Speech-zh-tw-Package.cab)

Note: Cortana is currently only available in United States, Japan, Australia, and Canada and India (in English) however having the speech packs installed will help your deployment if other markets open up.

You can also install the Text to speech pack along side. For example

Microsoft-Windows-LanguageFeatures-TextToSpeech-en-au-Package.cab adds Aussie Catherine and British James however Cortana doesn't use them.

Cortana speech settings

 

To deploy during OSD create a package with the desired speech packs and an Install.bat file. The following  example of install.bat sets up English-Australia and also adds text to speech voices, you can add additional packages by changing the PackagePath:

DISM /Online /Add-Package /PackagePath:Microsoft-Windows-LanguageFeatures-TextToSpeech-en-au-Package.cab
DISM /Online /Add-Package /PackagePath:Microsoft-Windows-LanguageFeatures-Speech-en-au-Package.cab

And then create a Run Command Line step in the task sequence referencing the package with Disable 64-bit file system redirection

OSD Cortana Speech

install.bat

 

To set the default Speech Language you need to modify the default user reg. This can be achieved in 3 commands during the task sequence

Load Default User Registry

reg load HKU\DefaultTemp "C:\Users\Default\NTUSER.DAT"

Set Default SpeechRecognizer

reg add "HKU\DefaultTemp\Software\Microsoft\Speech_OneCore\Settings\SpeechRecognizer" /v RecognizedLanguage /t REG_SZ /d en-AU /F

Unload Default User Registry

 reg unload HKU\DefaultTemp

OSD default profile

Ensure the Operating System applys to C: drive not D: drive

reeval

This problem will increase more and more as everyone starts to use wim's instead of the OS media in SCCM.

There are a few workarounds for this problem however the best method is to force the new OS the reevaluate Drive Letters with 3 easy steps after applying the OS

Create a Run Command Line step for each of the 3 commands

Reg.exe load HKLM\Temp %OSDTargetSystemDrive%\Windows\system32\config\system

Reg.exe delete HKLM\Temp\MountedDevices /va /f

Reg.exe unload HKLM\Temp

 

This forces the default behaviour of Windows to choose the drive letter.

 

For more information and other workarounds see http://blogs.technet.com/b/configurationmgr/archive/2014/04/28/how-to-ensure-that-windows-installs-on-c-during-a-system-center-2012-configuration-manager-osd-task-sequence.aspx