Powershell Select Xml Node Value

Select-XML will extract the required nodes – notice how the object has to be presented. To retrieve an element, specify its number, PowerShell automatically numbers the array elements starting at 0. Above is our sample. Net using C# for both the XMLDocument as well as the XDocument. If you pipe an XML document to Select-Xml, each document node will be searched separately as it comes through the pipeline. In these XML files, the root node is named Batch. count xml child nodes. AND, that group node could be anywhere in the XML. The PowerShell Summit Europe 2014 began unofficially this evening with an informal gathering for drinks and conversation – no prizes for guessing the main topic of conversation!! One of the greatest things about these Summits is the ability to talk to other people about what they are doing with PowerShell and to discover new ways to do things. Here are some sample PowerShell commands to manipulate XML contents in memory and then later dump them to an XML file. After the command returns, check the value with Get-OrganizationRelationship | Select DeliveryReportEnabled. Active Directory has a lot of great information that can be used for other systems. In your first example you want to select the value of all nodes with the name MyNode. But: If the element value is not used, copying the value into a local variable will likely cause a performance decrease. appSettings. The schema can be found inside the XML produced so to avoid a circular argument I’ll set that in a variable – it has to be a hash table as shown. hai guys i created a html form inside ajax and posted elements as array for an erp development but i cant able to assign calculated values for the text boxes because it is a dynamic form which will be added while clicking a button and i used DHTMLX framework for the project as front end so anyone pls help me in assigning the values…. Firstly, please accept my sincere apologies for the obvious lack of knowledge on my part. -Xml XmlNode[] One or more XML nodes. Better Support For Virtual Desktops]]> Sat, 09 Nov 2019 02:27:54 GMT https://forum. action uses wow64 redirection false // build the powershell script that we will use to modify an XML file createfile until EOF_EOF_EOF_EOF. ; 用Invoke-WebRequest请求一个网站每次都会遇到年龄认证,导致不能读取网页内容 提问人 darzh, 1月 ago. Let's say you have the following xml file: PS C:\> $myxmldata = Get-Content C:\temp\credentials. Every script in the zip file is in the public domain, so feel free to. The syntax being used in today's tutorial is the XPath Syntax. Xsl stuff, but then thought it'd be easier and cleaner to use the rocking cool (and far more flexible) NXSLT2, by the very smart Oleg Tkachenko. By writing an appropriate XPath expression, you can select particular elements or attributes within an XML document. In the last lesson I created a few XML documents using ConvertTo-XML including nested objects. XML Forums on Bytes. The XML file is loaded into an XmlDocument and then using XPath all the nodes where City attribute has value London are fetched as XmlNodeList. We use cookies for various purposes including analytics. '# Text' для доступа к значению узла. UPDATE Using an XDocument vs an XmlDocument, I believe this does what you're asking without using loops. With the help of PowerShell this tutorial is going to help you learn how to query XML data and save valuable time. After reading an XML file into memory as an XmlDocument object, you can select multiple nodes into a collection using the SelectNodes() method, grab a single node using the SelectSingleNode() method, retrieve an attribute using either the standard GetAttribute() method or the name of the attribute which PowerShell exposes as a property, and you. net,linq-to-xml. With the recent project I was working on I needed a way to easily add new portgroups into the XML configuration file. Below is an example of an XML file exported from Azure with the command get-azurevnetconfig –ExportToFile c:\test etwork. XML nodes are too picky about setting values #2459. You'll have to modify the xsd file to match the XML structure in your data file. Net BCL, so consuming it in Powershell might require you know a bit for the PS syntax. Format-files control which object properties are shown and how the object structure is represented. In Powershell there is an object type for XML, so you just can use the get-content Cmdlet to. Let's look at our sample file and I'll explain. I'm having a problem manipulating some XML within PowerShell. In the last. Continuing on from the previous post on getting values from an XML file using PowerShell, I'm going to talk about how to add values to an XML files. Use selectNodes to get a node list in an XML document or XPathNavigator looking for specific attribute values. XML is everywhere. Unlike element nodes, attribute nodes have text values. Creating Nodes You can create basic nodes and script nodes. WindowsUpdatePlugin in terms of updating SQL Server 2012 failover cluster instances because you can update specific SQL Server 2012 cluster instance(s), or apply an update on a selective set of cluster nodes. In this article we will be seeing how to add values to the string array from xml using Powershell. Although Windows PowerShell makes it easy to navigate XML documents, at times (because of the size of the files, the numbers of nodes, or some other non-PowerShell related element), one may want to drop down to the. An updatable dataset. The gist of it is as follows:. As you can see below, the XML data has a lot of information. Alternatively, select SQL Server AppFabric Caching Service Configuration Store Provider. StateImageList. I’d like to introduce you to TableauKit. How to iterate over all children under an xml node Solved I am trying to do a find and replace of attribute values in an xml document, but having trouble iterating over every child node, and their children, and so on in my program. Although relative and absolute paths will let you select anything you want in your XML document, they can sometimes be quite time-consuming. Xml # The sample input XML is available. The XPath expression for your document is evaluated in the context of the document root so you need to specify the plist node ideally, and I assume you want the string value so you will need to navigate to that node. AND, that group node could be anywhere in the XML. PowerShell comes with a set of xml files that all carry the extension ". So, been doing a lot of work in Azure lately and having to solve problems I have not had to deal with before. Powershell - Compare two XML documents. Learn more. In the final list that I want to produce, I only want the unique values, but at this stage I'm trying to understand how to read the actual Principal attribute. Practical PowerShell Processes with SQL Change Automation - Redgate Software. Get-Service gsv Get a list of services. Alan Varga Access Developer. If the value is a number, then the position is checked against that number. Selecting attributes in xml using xpath in powershell I am trying to use powershell and XPath to select the name attribute shown in the below xml example. The value of the *XPath* parameter is the "snip" namespace key, a colon (:), and the name of the Title element. The nodes inside your nodes just happen to be the first ones in the document. Wen we look at a exported Nessus. demo, that is the childnode of a node called properties, which is a child of one called server, which is the child of a node called group. An XML document will be processed as a collection of XML nodes. Above is our sample. Other Example on XML with PowershellQuery xml data powershell. But in ideal situation i will be getting the xml where i will dont know the node names as well as node values. I am trying to select data from a column that has xml data in it. Net BCL, so consuming it in Powershell might require you know a bit for the PS syntax. Please help me with this script: 1. To select the first "department" node in Powershell and XPATH, you run a command like the one shown below:. Get the Value of an Attribute. the only examples i can find so far have been using the. Before we start with Oracle XMLTable function it is good to know a bit about XPath. From your example:. Demonstrates some ways to iterate over direct child nodes by index. One important use of the DataSet is to encode data in XML format. I have tried all I can think of, but the results keep coming back as NULL. Using Select-XML cmdlet in PowerShell We are now ready to use Select-XML cmdlet and query the XML we just loaded in Powershell. ConvertTo-XML # SYNOPSIS Creates an XML-based representation of an object. Windows PowerShell is a task-based command-line shell and scripting language that helps IT professionals for windows Administrators. It's equivalent to using Select-Xml | Select-Object -Expand Node # Version History: # Select-Xml 2. Continuing on from the previous post on getting values from an XML file using PowerShell, I'm going to talk about how to add values to an XML files. Active Directory PowerShell C# SharePoint PowerShell. XML display as text/html instead of text/xml Hi, Currently, i wanted to display XML data is a new windows, but when i pass the string into the windows, it seem the string read as a text/html mime format. OpenNMS WMI Support. In these XML files, the root node is named Batch. It does not return elements itself but SelectXmlInfo instances. const x = document. Enter an XPath query, and use the Content, Path, or Xml parameter to specify the XML to be searched. SELECT 1 AS Tag, value is the name of the XML element that the universal table. See it in action here. Select Nodes Using XPath Navigation. What you should know is that PowerShell can easily work between either of these approaches with its parser, so the choice is yours! Before we start showing off using PowerShell to work with JSON, let's take a look at how the data is handled. If the value is a number, then the position is checked against that number. This gives me almost the result I want but I only need the value without the Server element. Selec­tNodes to get list of nodes selected by the XPath expression. In the first line, we define a hash table that contains the names of our two form fields and the values we want to submit. Select-Xml (Microsoft. I'm having a problem manipulating some XML within PowerShell. The XML Document Object Model (DOM) contains methods that allow you to use XML Path Language (XPath) navigation to query information in the DOM. I am using PHP and am using the simplexml_load_string. An updatable dataset. But how? By using a query language designed just for XML called XPath and PowerShell's XPath query cmdlet, Select-XML. This command goes through all of the existing user photos and creates thumbnails. What you might need is the RSAT tools installed on the probe-device, besides that I do not see a reason why you shouldn't be able to execute this as a regular user. WindowsUpdatePlugin in terms of updating SQL Server 2012 failover cluster instances because you can update specific SQL Server 2012 cluster instance(s), or apply an update on a selective set of cluster nodes. xml' | Select-Object -Expand Node. Config files on different servers and want to do this using PS as there can be 10 different App's running on the same server all with their own Web. Active Directory PowerShell C# SharePoint PowerShell. If the given child is a reference to an existing node in the document, appendChild() moves it from its current position to the new position (there is no requirement to remove the node from its parent node before appending it to some other node). How to iterate over all children under an xml node Solved I am trying to do a find and replace of attribute values in an xml document, but having trouble iterating over every child node, and their children, and so on in my program. Resume-Service Resume a suspended service. Windows Server > Windows PowerShell. XML display as text/html instead of text/xml Hi, Currently, i wanted to display XML data is a new windows, but when i pass the string into the windows, it seem the string read as a text/html mime format. Select-XML will extract the required nodes – notice how the object has to be presented. Get-Content cmdlet is used to read content of a xml file. This was an interesting function that I've come across. Please let me remember this syntax the next time I'm trying to search an XML file. by Michael Simmons | Sep 11, 2015 | PowerShell. This site uses cookies for analytics, personalized content and ads. It provides a lower-level abstraction over the XML file structure. Sometimes, you have to take matters into your own hands to create the exact XML format that you need. Reference sharepoint in powershell console. In one place you use Out-Null. Microsoft Scripting Guy, Ed Wilson, is here. xml before imaging. Hash Tables (also known as Associative arrays or Dictionaries) are a type of array that allows the storage of paired Keys and Values, rather like a simple database table. You need the xml path to the node, then the comparison of the attribute inside square brackets: root\employee[@id='1234'] Select all Open in new window. The XML file is loaded into an XmlDocument and then using XPath all the nodes where City attribute has value London are fetched as XmlNodeList. donc j'ai un. I've tried the same in V1. 10 White Space Handling. I am trying to use powershell to update xml nodes in my web. To follow along with the examples below, get the samplescan. Just as SQL allows you to select a set of information from a table or group of tables, XPath allows you to select a set of nodes from the DOM representation of an XML document. I am trying to filter out parts of an XML document and then output it. Use XPath to update XML using PowerShell. The first step is to create a new XML element containing your required data. It provides a lower-level abstraction over the XML file structure. urn:docid:2710995 2018-09-19T07:15:59Z Fixes an issue in which you are prompted to select a certificate from the certificate store in Windows 7 or in Windows Server 2008 R2. Config files on different servers and want to do this using PS as there can be 10 different App's running on the same server all with their own Web. " Let me add my recommendation for this book. org Issue with If Elseif Else based on xml node value. Converting XML to escaped text in XSLT - Stack Overflow. I newby in powershell. 0 -noprofile Windows PowerShell. In English, that XPath statement translates to “Give me the NAME node that has the text value of DomainController1. -Xml XmlNode[] One or more XML nodes. Search XML files with PowerShell using Select-XML. The default value the object nodes. So, been doing a lot of work in Azure lately and having to solve problems I have not had to deal with before. Set your execution policy if you see this message. urn:docid:2710995 2018-09-19T07:15:59Z Fixes an issue in which you are prompted to select a certificate from the certificate store in Windows 7 or in Windows Server 2008 R2. Castek's answer is on. Other Example on XML with PowershellQuery xml data powershell. Select Nodes Using XPath Navigation. Get XML attribute values Welcome › Forums › General PowerShell Q&A › Get XML attribute values This topic contains 0 replies, has 1 voice, and was last updated by Forums Archives 7 years, 9 months ago. Method XmlNode. I am working on a script that updates GFI MAX XML configuration files using powershell. Net Core project relations with PowerShell and yUML Kees C. by Michael Simmons | Sep 11, 2015 | PowerShell. Demonstrates how to update XML attributes. [5] Array indexes start at either zero or one, depending on the programming language, and correspondingly end at either the number of elements minus one [0. The way to get the value of an attribute, is to get its text value. In a previous tip we looked at how to export this data using PowerShell and in this tip we will look at how to load the XML data into a SQL Server table. 0 CTP 2 with the same results. In the previous example, the Select-Xml cmdlet was used to retrieve XML nodes using the XPath search query; the result is an object of nodes with no values. One object or many, PowerShell hands you control. I have an Oracle table with a CLOB field that contains XML-Data. DOM Node List. I am trying to select data from a column that has xml data in it. The XPath tester fully supports XML namespaces, but the declarations MUST be explicit and MUST be on the root XML element. Let's look at our sample file and I'll explain. So, been doing a lot of work in Azure lately and having to solve problems I have not had to deal with before. The xml:space attribute can be placed on any elements in the XML document and given a value of preserve to signal that the white space is significant. Hi all, I've recently started using PowerShell to make my life easier in my job. How-To: Use Hash Tables in PowerShell. In line 2, we store the result of the request page of the query in a variable. It's very well written and it's. How PowerShell can help programmers This post we were given cmdlet Select-Xml. Specifies one or more XML nodes. select: Required [XPath 1. Importing and Processing data from XML files into SQL Server tables. Just as SQL allows you to select a set of information from a table or group of tables, XPath allows you to select a set of nodes from the DOM representation of an XML document. 0 Easily maintain appropriate compatibility with older versions Automate complex … - Selection from Mastering Windows PowerShell Scripting - Third Edition [Book]. From your example:. To see more about that, see Tobias's Ebook Chapter on XML and PowerShell. Navigate via XPath You can use XPath to select nodes and attributes with Select-Xml cmdlet. Removing duplicate XML nodes using powershell 08 Aug 2014. It is not obvious at first, but with a little help from your friends here at PowerShellMagazine. A Quick Example XML File : M yXM. Powershell XML select node with particular value. Select Nodes Using XPath Navigation. The major difference with modules like Teaser block, Node Blocks and Node as block is that this module doesnt create a new block for every node. WMI offers many more monitoring data points on a Windows system than the Microsoft SNMP agent does. This was an interesting function that I've come across. Its converts XML elements to properties on. Good Morning. I want to add data to a xml export file. Getting XML values in PowerShell # Get InnerXML value of Email node and assign it to string Popular Tags. Basically the task is supposed to pull all the powershell scripts from the fixlets, download them, run them and then output the results to a log file. Select XML Nodes by Name [C#] To find nodes in an XML file you can use XPath expressions. The way to learn PowerShell is to browse and nibble, rather than to sit down to a formal five-course meal. What is happening that. CLIXML is an XML-based format to serialize objects. As far as describing node locations, both of these expressions have a different meaning depending on where they are located within the greater XPath value. #whitespace nodes when including xml. For this reason the scripts used to apply themes are completely different than the xml files used for the import/export process. Each of the "intrinsic events" listed above takes a value that is a script. For more information about the method that Windows PowerShell uses to select the command to Xml {ConvertTo, Select} or for a command element, such as a. NET Forums / Data Access / XML and XmlDataSource Control / how to get node attribute-value? using SelectNodes(" ") how to get node attribute-value? using SelectNodes(" ") [Answered] RSS 3 replies. This issue occurs after you install a certificate that does not contain a UPN value in the SAN field. The following commands uses these XML File Creating a XML File, create a document root, create subelements, add and set attributes, save the file Loading an existing XML File, read an element, do some XPATH queries He. Synopsis PowerShell script to delete the parent node from Quick Launch or from Global Navigation. We use cookies for various purposes including analytics. which should select all table nodes in the configuration node. Microsoft Scripting Guy, Ed Wilson, is here. I’m working with the same file from Remote Desktop Manager (RDM) and adding remote management configurations based on DNS checks. fichier de configuration que j'essaie de rechercher un attribut spécifique à l'intérieur, puis de l'éditer en utilisant la version 4. To add a MAK key, use the PIDKEY element to enter the 25 character volume license key. Selecting attributes in xml using xpath in powershell I am trying to use powershell and XPath to select the name attribute shown in the below xml example. The syntax being used in today's tutorial is the XPath Syntax. Free dependency graph generation using PowerShell and yUML # Find the references xml nodes Select-Xml # Get the node values foreach {$_. In the last. This is more complex than other solutions but benefits perform. By Jeffery Hicks; 10/02/2012; If you've been following me for any length of time you have probably heard me mention that PowerShell is all about the objects. Is there a way to select a parent node (and be able to use the child elements of that node) by the value of a child element of that node? Example: John Doe Inside this CommandText node. AutoDiscoveryAddresses in the XML node Configuration \ appSettings \ add :. If you pipe an XML document to Select-Xml, each document node will be searched separately as it comes through the pipeline. Appreciate your help. Define the XPath – in this case get the nodes labelled one:Notebook. For more information, see Select Nodes Using XPath Navigation. XPath have some core XPath functions like Node functions, Numeric functions, String functions, Boolean functions. 0 CTP 2 with the same results. This site uses cookies for analytics, personalized content and ads. The way to get the value of an attribute, is to get its text value. I am working on a script that updates GFI MAX XML configuration files using powershell. windows,powershell. Filtering using XPath is not limited to queries that make sure that existing value is equal to value that we are interested in. For most things it is enough to read XML file and convert it to XmlDocument object using XML type accelerator:. How can I add elements to an XML file with PowerShell? A. I am having trouble reading the session timeout value (20) from the attached config file. I'm far from an expert with either powershell or XML but glad it wasn't just me who found this odd. Personally I would go with Out-Null since it is more the PowerShell way, and I think it looks nicer. Parsing XML Child Nodes and Converting to DateTime with PowerShell Posted on March 21, 2015 by SQLDBAwithTheBeard As part of my organiser role for SQLSaturday Exeter ( Training Day Information here and Saturday Information here ) I needed to get some schedule information to input into a database. In the last post, we worked with CSV types of files. It's best to be consistent. The script is executed whenever the event occurs for that element. You call it by passing the URL to your My Sites host. The XPath Language. It calls itself to work out the list of reports of a user and the reports of any of their reports from a particular AD arrangement where users' managers are held in a manager field! er yes, you can read that again now. Hi All, I need to write a powershell script which reads a. In other words, an XML document that you could use outside of PowerShell. These are duplicated in code by calling AddParam on the HTTP Request object for each parameter. Forums; you have created an element is to then select it using xpath - to force it as a string value. Using Select-XML cmdlet in PowerShell We are now ready to use Select-XML cmdlet and query the XML we just loaded in Powershell. In English, that XPath statement translates to "Give me the NAME node that has the text value of DomainController1. An XML document will be processed as a collection of XML nodes. I will provide a few straightforward samples about XPath expression with which you could follow without difficulty. The Scripts works with a token File. This article describes how to add, delete, update, and select nodes in XML in C#. no input parameters and will not return any output values. An object that contains all the child nodes of the node. -Xpath string An XPath search query. You can find these sections in a notebook like. I'm trying to write the start and end-date of this script in a logfile. An alternative to the above operation would be to select the XML value into a new XML variable, make the change, and then select the variable value:. Java Programmer. This As I did last year, and the years before that, I wanted to review my last PowerShell resolutions and see how well I did and then take a look at the coming year and pick a few things that I’d like to strive for either in learning new things with PowerShell or as part of the community. The Select -Expand The Node Statement is important for this example because it returns the node (the value) of the heading property. I could have add to the list with the virtual name as: Items. It is generll better to use XPath to return nodes as it will bypass the PowerShell engine. Learn how to use and/or conditional arguments in xpath queries. Next, we need an easy way to tell PowerShell to pluck out just that one number (I see 6. XMLElement and it's various attribute related method. Powershell - Compare two XML documents. The PowerShell Extended Type System (ETS) is XML-based, too. '# Text' для доступа к значению узла. -Xpath string An XPath search query. It provides a lower-level abstraction over the XML file structure. Value } PowerShell 2. If your XML includes a default namespace, you must still add a prefix and namespace URI to the XmlNamespaceManager; otherwise, you will not get any nodes selected. Part 3 has, as its tasty confections, collections, hashtables, arrays and strings. The Select-XML cmdlet returns any nodes that are type module within the file. In one place you use Out-Null. I need to remove the nodes where the Status is "Fixed" and save the xml. If this 'dynamic path' points to several elements (like configuration. When using "regular" xml-read I get to the top sections (options, users, and so on) but not the "item key" nodes within each. Accessing the alias drive in powershell 3; Adding functions to the powershell ise menu; Basic line editing tricks powershell; Breaking down a powershell script; Casting values in powershell; Changing powershells look and feel; Constant and read only variables; Create xml variable powershell; Creating aliases in powershell; Creating and changing. There sure should be. I’m working with the same file from Remote Desktop Manager (RDM) and adding remote management configurations based on DNS checks. PowerShell имеет встроенные функции XML и XPath. 101 - Oct 25, 2017). Since you posted an XML fragment, I'll assume that it was exported from the log and has a root tag. The way to learn PowerShell is to browse and nibble, rather than to sit down to a formal five-course meal. These 2 commands create powershell specific XML files. In the previous example, the Select-Xml cmdlet was used to retrieve XML nodes using the XPath search query; the result is an object of nodes with no values. Let’s look at our sample file and I’ll explain. Node } Number ----- 2. To enable Windows PowerShell remoting, start Windows PowerShell with the "Run as administrator" option, and then use the Enable-PSRemoting cmdlet. The CSV ("Comma Separated Value") file format is often used to exchange data between disparate applications. Technically speaking, within XSLT, all match and select attributes are XPath expressions. As a result, many of us find the need to work with XML and traditional text editors don't cut it. AND, that group node could be anywhere in the XML. If we want to retrieve all IPv4 addresses from the hosts that are currently up we can ask for addresses (using //host/address path) and filter them on the information both on current level (to make sure we get correct address type) and value of attribute on node that has the same parent as node we want to retrieve (‘state’ on ‘status. PowerShell makes handling XML. clearly with no joy. I newby in powershell. Continuing on from the previous post on getting values from an XML file using PowerShell, I'm going to talk about how to add values to an XML files. What you should know is that PowerShell can easily work between either of these approaches with its parser, so the choice is yours! Before we start showing off using PowerShell to work with JSON, let's take a look at how the data is handled. If you pipe an XML document to Select-Xml, each document node will be searched separately as it comes through the pipeline. A client lost the source files for their reports, as well as the reporting services installation. UPDATE Using an XDocument vs an XmlDocument, I believe this does what you're asking without using loops. For more information, see Select Nodes Using XPath Navigation. Cannot convert value “System. OpenNMS includes the ability to monitor Windows systems using WMI (Windows Management Instrumentation). How to parse a XML file and get the Node value using Powershell ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★. If you are given just the raw XML, you can load up the XML document. There is often the need import XML files into SQL Server which can be done several ways and in this tip we will look at a simple way to do this using just T-SQL commands. In Powershell, there is a pretty easy way for parsing XML. I have tried all I can think of, but the results keep coming back as NULL. If the given child is a reference to an existing node in the document, appendChild() moves it from its current position to the new position (there is no requirement to remove the node from its parent node before appending it to some other node). PowerShell: Dynamically Color PosH Generated HTML:Part 2 PowerShell: Dynamically Color PosH Generated HTML:Part 3. So i could get the all the node values in tabular from. (PowerShell) Iterate over Direct Child Nodes by Index. PowerShell provides a data structure, the array, which stores a fixed-size sequential collection of elements of the any type. I often have to check Web. Let’s look at our sample file and I’ll explain. In the last. Above is my xml file , my question is how do I read from this xml file in powershell and populate an array that i can later loop through and preform actions based on the contents of the array. 0] and by the model attribute on this element. You'll have to modify the xsd file to match the XML structure in your data file. Please let me remember this syntax the next time I’m trying to search an XML file. ConvertTo-XML # SYNOPSIS Creates an XML-based representation of an object. Select-XML will extract the required nodes – notice how the object has to be presented. Unlike element nodes, attribute nodes have text values. Of course, it never hurts to escape any character. More likely, however, you’ll want to add it as a Class Library (this is true for calling it through PowerShell as well). The value of the XPath parameter is the "snip" namespace key, a colon (:), and the name of the Title element. The ETS is responsible for turning objects into readable text. Learn how to create custom XML in PowerShell. Each "input" or "select" tag found in the HTML is a form parameter having a name and value. Control elements such as INPUT, SELECT, BUTTON, TEXTAREA, and LABEL all respond to certain intrinsic events.