windows-itpro-docs/windows/deployment/deploy-windows-mdt/configure-mdt-for-userexit-scripts.md
John Liu 9444d5ca5b
add new issues for multiple window platforms (#882)
* Update windows/security/information-protection/windows-information-protection/testing-scenarios-for-wip.md

Co-Authored-By: Trond B. Krokli <38162891+illfated@users.noreply.github.com>

* Update windows/security/threat-protection/windows-defender-exploit-guard/enable-controlled-folders-exploit-guard.md

Co-Authored-By: JohanFreelancer9 <48568725+JohanFreelancer9@users.noreply.github.com>

* Update policy-csp-update.md

In 1903 we deprecated the value of 32 and combined Semi-Annual Channel (Targeted) with the Semi-Annual Channel. We need to communicate this change in the documentation.

* chore: Replace tab after unorderd list marker

* Update windows/security/identity-protection/credential-guard/credential-guard-manage.md

Co-Authored-By: Trond B. Krokli <38162891+illfated@users.noreply.github.com>

* markdown syntex issue

There was a syntex issue with formating. It has been fixed.

* Update MDM Path

https://docs.microsoft.com/en-us/windows/client-management/mdm/policy-csp-browser#browser-allowflash

Issue 
https://github.com/MicrosoftDocs/windows-itpro-docs/issues/3553

* HTML Tag fix

There was issue with HTML tag in live 203 and has been fixed.

* Update windows/security/information-protection/windows-information-protection/testing-scenarios-for-wip.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/windows-defender-exploit-guard/enable-controlled-folders-exploit-guard.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/deployment/update/waas-overview.md

Co-Authored-By: Trond B. Krokli <38162891+illfated@users.noreply.github.com>

* Update waas-overview.md

* Update hello-hybrid-cert-whfb-settings-policy.md

removing extra "want"

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: JohanFreelancer9 <48568725+JohanFreelancer9@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: JohanFreelancer9 <48568725+JohanFreelancer9@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: JohanFreelancer9 <48568725+JohanFreelancer9@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: JohanFreelancer9 <48568725+JohanFreelancer9@users.noreply.github.com>

* Update hello-planning-guide.md

* Update windows/deployment/update/waas-delivery-optimization-reference.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/deployment/update/waas-delivery-optimization-reference.md

Co-Authored-By: Trond B. Krokli <38162891+illfated@users.noreply.github.com>

* Update whiteboard-collaboration.md

* Update hello-key-trust-policy-settings.md

* Update integrate-configuration-manager-with-mdt.md

* Update use-system-center-configuration-manager-to-manage-devices-with-semm.md

* Update start-layout-xml-desktop.md

Added syntax and note

* remove reference about Windows 10 Pro 

https://github.com/MicrosoftDocs/windows-itpro-docs/issues/3255

* Fixed Typo

* Adding Question to FAQ

https://github.com/MicrosoftDocs/windows-itpro-docs/issues/4288

* Adding Question to FAQ

https://github.com/MicrosoftDocs/windows-itpro-docs/issues/4288

* Updated with TVM refs

* Emphasize Device Sync

https://github.com/MicrosoftDocs/windows-itpro-docs/issues/4401

* Update windows/security/threat-protection/windows-defender-atp/configure-mssp-support.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/windows-defender-atp/configure-mssp-support.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* fix: MD005/list-indent

Inconsistent indentation for list items at the same level

* Update integrate-configuration-manager-with-mdt.md

* Update use-system-center-configuration-manager-to-manage-devices-with-semm.md

* Update enable-admx-backed-policies-in-mdm.md

Added two links to notes.

* Update windows/configuration/start-layout-xml-desktop.md

Co-Authored-By: JohanFreelancer9 <48568725+JohanFreelancer9@users.noreply.github.com>

* Update index.md

Corrected typo: 'annd' to 'and'

* Update windows/security/identity-protection/hello-for-business/hello-planning-guide.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update devices/surface-hub/whiteboard-collaboration.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/identity-protection/hello-for-business/hello-key-trust-policy-settings.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/identity-protection/hello-for-business/hello-key-trust-policy-settings.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update windows/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Create troubleshooting-agpm40-upgrades.md

* Update TOC.md

Addition of Troubleshooting AGPM Upgrades top-level link

* Update windows-10-upgrade-paths.md

* Update white-glove.md

Removed a singular reference to WG and replaced with white glove

* remove last 3 blocks in IT Admin

* Fixes typo issue in line 47

Closes #4557

* Update metadata to replace non-existent author

* Update index.md

Typo - corrected 'Bitlocker' to 'BitLocker'

* Rename windows/security/threat-protection/windows-defender-atp/configure-mssp-support.md to windows/security/threat-protection/microsoft-defender-atp/configure-mssp-support.md

* Update hello-planning-guide.md

* Update configure-wd-app-guard.md

* Update configure-wd-app-guard.md

* Update configure-wd-app-guard.md

* Update kiosk-xml.md

* Update kiosk-xml.md

* Update waas-servicing-differences.md

Removed double use of the word critical

* Minor update to properly reflect supported macros

* Update applocker-csp.md

* Update kiosk-xml.md

* Update applocker-csp.md

* updated image needed 

I don't have rights to upload a new file (the updated error image)

More details here: https://github.com/MicrosoftDocs/windows-itpro-docs/issues/2489

* MDOP May 2019 Servicing Release: new Hotfix Link

Microsoft Desktop Optimization Pack May 2019 Servicing Release.
Replaces the outdated MDOP link to July 2018 Servicing Release.

Thanks to CaptainUnlikely for the Technet blogs information update.

Closes #4574

* Creating a WDATP alert requires recommendedAction

Otherwise the following will be returned by the API:

```
{"error":{"code":"BadRequest","message":"recommendedAction argument is missing"}}
```

* Update windows/security/threat-protection/windows-defender-application-guard/configure-wd-app-guard.md

Co-Authored-By: JohanFreelancer9 <48568725+JohanFreelancer9@users.noreply.github.com>

* Update guidelines-for-assigned-access-app.md

* Corrected typo

 Changed "ConnecionSuccess" to "ConnectionSuccess

* Update install-wd-app-guard.md

* Update self-deploying.md

Added additional links.

* Update install-wd-app-guard.md

* Update hello-hybrid-cert-trust-devreg.md

* Update waas-delivery-optimization.md

fixed typo

* Fixed a small typo

Changed "wwitches" to "switches".

* Update for the month June 2019

I have added the content for surface hub based on an update KB4503289. There was no update released for a hub for the month of July. 

Problem: https://github.com/MicrosoftDocs/windows-itpro-docs/issues/4586

* Update devices/surface-hub/surface-hub-update-history.md

Co-Authored-By: Trond B. Krokli <38162891+illfated@users.noreply.github.com>

* typo

typo the Action Sataus column instead of the Action Status column

* Correcting small mistake on which version of Win10 displays MBEC

Correcting initial mistake when changed docs.

* Updated links

Hotlink for configuring MTP integration and API support was missing and has been updated.

Problem: https://github.com/MicrosoftDocs/windows-itpro-docs/issues/4569

* Resolves #4620 - typo in command line

Issue #4620

Set-ProcesMitigation -Name c:\apps\lob\tests\testing.exe -Enable AuditDynamicCode
should be
Set-ProcessMitigation -Name c:\apps\lob\tests\testing.exe -Enable AuditDynamicCode

* HTML to MarkDown in hello-hybrid-aadj-sso-cert.md

This is a combined effort to alleviate a translation bug as well as
improving the MarkDown codestyle in this document, both for the English
(en-us) version of the document as well as the translated versions.

This change should in theory close the issue tickets #3451 and #3453
after the scripted translation process has been re-run on this document.

This solution is based on a user discussion in issue ticket #4589 .

* Update windows/deployment/windows-autopilot/self-deploying.md

Co-Authored-By: Nicole Turner <39884432+nenonix@users.noreply.github.com>

* Update index.md

* Update waas-configure-wufb.md

* Update hello-features.md

Removes \ typo

* Update windows-analytics-get-started.md

adding IE site discovery to GDPR blurb

* Update sideload-apps-in-windows-10.md

* Update upgrade-readiness-deployment-script.md

replacing support email with official support channels

* missing bold on GUI element

* formatting again - italicize typed word

* fixing warnings

* restored missing art, somehow

* CAT Auto Pulish for Windows Release Messages - CAT_AutoPublish_2019080917545405 (#881)
2019-08-09 19:17:27 -07:00

75 lines
3.2 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Configure MDT for UserExit scripts (Windows 10)
description: In this topic, you will learn how to configure the MDT rules engine to use a UserExit script to generate computer names based on a prefix and the computer MAC Address.
ms.assetid: 29a421d1-12d2-414e-86dc-25b62f5238a7
ms.reviewer:
manager: laurawi
ms.author: greglin
keywords: rules, script
ms.prod: w10
ms.mktglfcycl: deploy
ms.localizationpriority: medium
ms.sitesec: library
ms.pagetype: mdt
audience: itpro
author: greg-lindsay
ms.topic: article
---
# Configure MDT for UserExit scripts
In this topic, you will learn how to configure the MDT rules engine to use a UserExit script to generate computer names based on a prefix and the computer MAC Address. MDT supports calling external VBScripts as part of the Gather process; these scripts are referred to as UserExit scripts. The script also removes the colons in the MAC Address.
## Configure the rules to call a UserExit script
You can call a UserExit by referencing the script in your rules. Then you can configure a property to be set to the result of a function of the VBScript. In this example, we have a VBScript named Setname.vbs (provided in the book sample files, in the UserExit folder).
```
[Settings]
Priority=Default
[Default]
OSINSTALL=YES
UserExit=Setname.vbs
OSDComputerName=#SetName("%MACADDRESS%")#
```
The UserExit=Setname.vbs calls the script and then assigns the computer name to what the SetName function in the script returns. In this sample the %MACADDRESS% variable is passed to the script
## The Setname.vbs UserExit script
The Setname.vbs script takes the MAC Address passed from the rules. The script then does some string manipulation to add a prefix (PC) and remove the semicolons from the MAC Address.
```
Function UserExit(sType, sWhen, sDetail, bSkip)
UserExit = Success
End Function
Function SetName(sMac)
Dim re
Set re = new RegExp
re.IgnoreCase = true
re.Global = true
re.Pattern = ":"
SetName = "PC" & re.Replace(sMac, "")
End Function
```
The first three lines of the script make up a header that all UserExit scripts have. The interesting part is the lines between Function and End Function. Those lines add a prefix (PC), remove the colons from the MAC Address, and return the value to the rules by setting the SetName value.
**Note**  
The purpose of this sample is not to recommend that you use the MAC Address as a base for computer naming, but to show you how to take a variable from MDT, pass it to an external script, make some changes to it, and then return the new value to the deployment process.
## Related topics
[Set up MDT for BitLocker](set-up-mdt-for-bitlocker.md)
[Configure MDT deployment share rules](configure-mdt-deployment-share-rules.md)
[Simulate a Windows 10 deployment in a test environment](simulate-a-windows-10-deployment-in-a-test-environment.md)
[Use the MDT database to stage Windows 10 deployment information](use-the-mdt-database-to-stage-windows-10-deployment-information.md)
[Assign applications using roles in MDT](assign-applications-using-roles-in-mdt.md)
[Use web services in MDT](use-web-services-in-mdt.md)
[Use Orchestrator runbooks with MDT](use-orchestrator-runbooks-with-mdt.md)