<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>neo</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/neo/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/neo/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:25:19 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>AWS: Obtain BlendedCost billing data</title>
      <link>https://docs.microsoft.com/archive/blogs/neo/aws-obtain-blendedcost-billing-data</link>
      <pubDate>Sat, 21 Apr 2018 18:52:32 GMT</pubDate>
      <dc:creator><![CDATA[ketanbhut]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/neo/?p=335</guid>
      <description><![CDATA[There may be a case when you might want to use Get-CECostAndUsage Cmdlet, however I thought it might...]]></description>
      <content:encoded><![CDATA[There may be a case when you might want to use <a href="https://docs.aws.amazon.com/powershell/latest/reference/items/Get-CECostAndUsage.html">Get-CECostAndUsage </a>Cmdlet, however I thought it might be helpful to document some examples. The AWS documentation doesn't display any example. Below is my attempt to come up with some examples, which I found useful for me, may be someone else does too.

&nbsp;

Running the Cmdlet without any parameters, doesn’t reveal what we are looking for, so I checked the command reference: <a href="https://docs.aws.amazon.com/powershell/latest/reference/items/Get-CECostAndUsage.html">https://docs.aws.amazon.com/powershell/latest/reference/items/Get-CECostAndUsage.html</a>. None of the parameters appear to be mandatory, still I got this error without any parameters:

"Time period is required"

<a href="https://msdnshared.blob.core.windows.net/media/2018/04/pic11.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/04/pic11-1024x180.png" alt="" class="alignnone size-large wp-image-345" width="1024" height="180" /></a>

&nbsp;

I guessed period is DateInterval, so went ahead and created it for sample, but hit another parameter required error:

"Granularity can only be MONTHLY or DAILY"

<a href="https://msdnshared.blob.core.windows.net/media/2018/04/pic21.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/04/pic21-1024x215.png" alt="" class="alignnone size-large wp-image-355" width="1024" height="215" /></a>

I made sure again I provided Granularity, trying DAILY and hit another parameter 'metric' missing:

"Selected metrics cannot be null"

<a href="https://msdnshared.blob.core.windows.net/media/2018/04/pic31.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/04/pic31-1024x189.png" alt="" class="alignnone size-large wp-image-365" width="1024" height="189" /></a>

Valid values for metric are BlendedCost, UnblendedCost, UsageQuantity, NormalizedUsageAmount, AmortizedCost. I tried one of them and hit another error:

<a href="https://msdnshared.blob.core.windows.net/media/2018/04/pic41.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/04/pic41-1024x151.png" alt="" class="alignnone size-large wp-image-375" width="1024" height="151" /></a>

Sounds good so far, I had to enable cost explorer access to my user. So now I activated <strong>IAM user/role access to billing information </strong><a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html">https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html</a> to grant my IAM user access to billing info. And here is the result:

<a href="https://msdnshared.blob.core.windows.net/media/2018/04/pic51.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/04/pic51-1024x129.png" alt="" class="alignnone size-large wp-image-385" width="1024" height="129" /></a>

I’m sure heading somewhere. After expanding the ResultsByTime object, I could eventually land to a result I was looking for that looked similar to the Cost Management Dashboard on the AWS console

<a href="https://msdnshared.blob.core.windows.net/media/2018/04/pic61.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/04/pic61-1024x557.png" alt="" class="alignnone size-large wp-image-395" width="1024" height="557" /></a>

Here is from the AWS web console billing home:

<a href="https://msdnshared.blob.core.windows.net/media/2018/04/pic71.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/04/pic71.png" alt="" class="alignnone wp-image-405" width="323" height="264" /></a><a href="https://msdnshared.blob.core.windows.net/media/2018/04/pic81.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/04/pic81.png" alt="" class="alignnone wp-image-415" width="401" height="186" /></a><a href="https://msdnshared.blob.core.windows.net/media/2018/04/pic71.png"></a>

&nbsp;

So, here is what I added to a script, so I get to know the cost for current month right away:

&lt;Edit&gt;

Please note, accessing Cost Explorer APIs are chargeable.

Reference: <a href="https://aws.amazon.com/aws-cost-management/pricing/">https://aws.amazon.com/aws-cost-management/pricing/</a>

&lt;/Edit&gt;

&nbsp;

&lt;Code&gt;
<pre>#Print cost details for the Account for current month
$currDate = Get-Date
$firstDay = Get-Date $currDate -Day 1 -Hour 0 -Minute 0 -Second 0
$lastDay = Get-Date $firstDay.AddMonths(1).AddSeconds(-1)
$firstDayFormat = Get-Date $firstDay -Format 'yyyy-MM-dd'
$lastDayFormat = Get-Date $lastDay -Format 'yyyy-MM-dd'

$interval = New-Object Amazon.CostExplorer.Model.DateInterval
$interval.Start = $firstDayFormat
$interval.End = $lastDayFormat

$costUsage = Get-CECostAndUsage -TimePeriod $interval -Granularity MONTHLY -Metric BlendedCost

$costUsage.ResultsByTime.Total["BlendedCost"]</pre>
&lt;/Code&gt;]]></content:encoded>
    </item>
    <item>
      <title>Create/Update AD users and Group Membership</title>
      <link>https://docs.microsoft.com/archive/blogs/neo/295</link>
      <pubDate>Fri, 30 Mar 2018 11:43:37 GMT</pubDate>
      <dc:creator><![CDATA[ketanbhut]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/neo/?p=295</guid>
      <description><![CDATA[Many of the times, you need to create users, groups, (test)OU for quick setting up environment. You...]]></description>
      <content:encoded><![CDATA[Many of the times, you need to create users, groups, (test)OU for quick setting up environment. You may have a list of users and attributes in a CSV file for this purpose. However, generally the need to add certain users to be part of certain groups is based of of some logic. For example: HR, Marketing, Sales &lt;-- they all represent sort of 'Department'. This also happens to be one of the attributes for an AD user account. There could be many more domain groups represented by attributes, to name a few: country, city..

Attached script is an attempt to automate similar tasks. It pick certain attribute from AD user accounts and makes sure they are part of groups represented by certain attributes. Again, for example 'Department' attribute will display various departments for various users and they are likely to be in their respective department groups. It can pickup users from CSV file and check for all the users' attributes and check (or create) groups to add memberships to. If users are missing from AD, they will be created.

Below are some sample examples:

EXAMPLE: .\createUsersAndGroups.ps1 -csvFilePath .\listOfUsers.csv -Attribute surname 1. Above example will create users from listof users from the CSV file into the default UsersContainer since OU is not provided. 2. It will pick the 'surname' attribute from the user objects and group them with their surnames to create groups, if missing. 3. It will add/update respective users to their surname groups.

EXAMPLE .\createUsersAndGroups.ps1 -csvFilePath .\listOfUsers.csv -Attribute surname -OUName 'TestingOU' 1. Above example will check for OU existance 'TestingOU' under domain root, i.e., OU=TestingOu,DC=Contoso,DC=Local - and will create if missing. 2. It will create users from listof users from the CSV file into the newly created OU. 3. It will pick the 'surname' attribute from the user objects and group them with their surnames to create groups, if missing. 4. It will add/update respective users to their surname groups.

==&gt; Here is sample output:
PS C:\bridge\createADUsersGroupsOU&gt; .\createUsersAndGroups.ps1 -csvFilePath .\listOfUsers.csv -Attribute Company -Verbose
VERBOSE: 30-Mar-2018 || 16:45:44.086 :: .\listOfUsers.csv successfully imported
VERBOSE: 30-Mar-2018 || 16:45:44.086 :: ************ Attempting create users from .\listOfUsers.csv ************
VERBOSE: 30-Mar-2018 || 16:45:44.086 :: User johnd already exists - updated attributes as per CSV file.
VERBOSE: 30-Mar-2018 || 16:45:44.086 :: User test1 already exists - updated attributes as per CSV file.
VERBOSE: 30-Mar-2018 || 16:45:44.086 :: ************ Attempting to add users with attribute Company to Company groups
************
VERBOSE: 30-Mar-2018 || 16:45:44.086 :: The group myCompany F5 already exists
VERBOSE: 30-Mar-2018 || 16:45:44.086 :: Users with myCompany F5 Company updated to the group myCompany F5:
kt muskant vimalt manharlalt kirtibent parint suhanat poorvit maharshit manishm falgunim sarthakm dhwanim
VERBOSE: 30-Mar-2018 || 16:45:44.086 :: The group Fantasy Land Inc already exists
VERBOSE: 30-Mar-2018 || 16:45:44.086 :: Users with Fantasy Land Inc Company updated to the group Fantasy Land Inc:
Johnd
VERBOSE: 30-Mar-2018 || 16:45:44.086 :: The group Testing Mania already exists
VERBOSE: 30-Mar-2018 || 16:45:44.086 :: Users with Testing Mania Company updated to the group Testing Mania:
test1

The script can be downloaded from Scripting Gallery: <a href="https://gallery.technet.microsoft.com/CreateUpdate-AD-users-and-3251787c">Script</a>]]></content:encoded>
    </item>
    <item>
      <title>Compare two text files with PowerShell</title>
      <link>https://docs.microsoft.com/archive/blogs/neo/compare-two-text-files-with-powershell</link>
      <pubDate>Thu, 29 Mar 2018 12:06:09 GMT</pubDate>
      <dc:creator><![CDATA[ketanbhut]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/neo/?p=225</guid>
      <description><![CDATA[Many of the times, we have need to compare 2 code files which are identical but some minor...]]></description>
      <content:encoded><![CDATA[Many of the times, we have need to compare 2 code files which are identical but some minor differences, mainly due to spelling/typing mistakes.

This script tries to attend this issue by comparing 2 files line by line ignoring white space, tabs, line breaks.

Here is sample output:

<a href="https://msdnshared.blob.core.windows.net/media/2018/03/resultSample_apr18.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/03/resultSample_apr18.png" alt="" class="alignnone size-full wp-image-305" width="1360" height="260" /></a>

Download Link: <a href="https://gallery.technet.microsoft.com/Compare-two-text-files-a1f6a78f/file/196499/1/compareTextFiles.ps1">Script</a>

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Backup Documents, Desktop and Favorites folder</title>
      <link>https://docs.microsoft.com/archive/blogs/neo/backup-documents-desktop-and-favorites-folder</link>
      <pubDate>Sat, 17 Mar 2018 17:36:02 GMT</pubDate>
      <dc:creator><![CDATA[ketanbhut]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/neo/?p=145</guid>
      <description><![CDATA[&nbsp;

&nbsp;

This script creates folder structure at the target backup location and copies...]]></description>
      <content:encoded><![CDATA[&nbsp;

&nbsp;

This script creates folder structure at the target backup location and copies Desktop, Documents and Favorites from User's profile

It takes a target variable targetFolder, to be the parent backup location. Feel free to modify as needed. It creates folder structure under targetFolder in YYYY_MMM_DD_HH.MM format and creates Desktop, Documents and Favorities folders
All files are copied under their respective folders in exact folder structure.

Disclaimer : This script is tested and working in my environment,
it is recommended that you test it in a test environment
before using in your production environment

<a href="https://msdnshared.blob.core.windows.net/media/2018/03/backupUserData.zip">backupUserData</a>]]></content:encoded>
    </item>
    <item>
      <title>Get Groupmembers' Memberships</title>
      <link>https://docs.microsoft.com/archive/blogs/neo/get-groupmembers-memberships</link>
      <pubDate>Tue, 03 May 2016 20:29:46 GMT</pubDate>
      <dc:creator><![CDATA[ketanbhut]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/neo/?p=77</guid>
      <description><![CDATA[Many of the times, you might need to search the entire forest for a particular set of users, on the...]]></description>
      <content:encoded><![CDATA[<span style="color: #000000;font-family: Calibri">Many of the times, you might need to search the entire forest for a particular set of users, on the basis of a security group memberships. Here is a quick attempt to create a CSV file out of it. The script picks each member of the group in the parameter and export their direct group membership. I had a need to run this task on a regular basis and provide a report with regular schedule. I’d put this script to run from schedule task and save the output to a central location.</span>

<span style="color: #000000;font-family: Calibri"> <a href="https://msdnshared.blob.core.windows.net/media/2016/05/groupMembership.png"><img src="https://msdnshared.blob.core.windows.net/media/2016/05/groupMembership-1024x116.png" alt="" class="alignnone size-large wp-image-85" width="1024" height="116" /></a></span>

<span style="color: #000000;font-family: Calibri"> <a href="https://msdnshared.blob.core.windows.net/media/2016/05/getGroupMembersMembership_1.2.ps1_.zip">getGroupMembersMembership_1.2.ps1_</a></span>

&nbsp;

<span style="color: #000000;font-family: Calibri"> </span>

<span style="color: #000000;font-family: Calibri">Hope this helps someone. </span>

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>MDT2012: Populate MDT application bundle and its dependencies via PowerShell</title>
      <link>https://docs.microsoft.com/archive/blogs/neo/mdt2012-populate-mdt-application-bundle-and-its-dependencies-via-powershell</link>
      <pubDate>Wed, 11 Mar 2015 00:28:32 GMT</pubDate>
      <dc:creator><![CDATA[ketanbhut]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/neo/2015/03/11/mdt2012-populate-mdt-application-bundle-and-its-dependencies-via-powershell/</guid>
      <description><![CDATA[Recently came across this need of pulling MDT Application bundles and apps in bundle, that is its...]]></description>
      <content:encoded><![CDATA[<p>Recently came across this need of pulling MDT Application bundles and apps in bundle, that is its dependencies. MDT 2012 lets you create a bundle of applications in which you can list multiple applications to be installed, together. Recently, I had a requirement to populate all of the bundles in MDT Share and its dependencies/applications which should be available whenever needed with current information.</p>
<p>I figured using MDT PowerShell module, can be pretty handy at this task. The only thing I&rsquo;m using this module, is to utilize MDTProvider so that I can browse through entire share. I wrote this little script that takes few parameters and creates an output CSV file with bundles and apps of the bundle.</p>
<p><span style="color: #006400; font-family: Lucida Console;">Here is how it is used: </span></p>
<p>--&nbsp;Example:</p>
<p>&nbsp;&nbsp;&nbsp; .\pupulateBundles.ps1 -mdtShare "\\Server1\Share1" -Server "Server1" -standardApps "\applications\Image Deployment\Standard Apps" -appBundles "\applications\Image Deployment\App Bundles"</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/59/93/79/populateBundles_1.zip" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-59-93-79/populateBundles_5F00_1.zip">populateBundles_1.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Populate list of Applications / Dependencies in an Application Bundle in MDT 2012</title>
      <link>https://docs.microsoft.com/archive/blogs/neo/populate-list-of-applications-dependencies-in-an-application-bundle-in-mdt-2012</link>
      <pubDate>Wed, 07 Jan 2015 23:37:00 GMT</pubDate>
      <dc:creator><![CDATA[ketanbhut]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/neo/2015/01/07/populate-list-of-applications-dependencies-in-an-application-bundle-in-mdt-2012/</guid>
      <description><![CDATA[MDT 2012 lets you create a bundle of applications in which you can list multiple applications to be...]]></description>
      <content:encoded><![CDATA[<p>MDT 2012 lets you create a bundle of applications in which you can list multiple applications to be installed, together. Recently, I had a requirement to populate all of the bundles in MDT Share and its dependencies/applications which should be available whenever needed with current information.<p><br>I figured using MDT PowerShell module, can be pretty handy at this task. The only thing I&rsquo;m using this module, is to utilize MDTProvider so that I can browse through entire share.</p><p><br>Here is the snippet of the code:</p><p style="text-align: justify;">&nbsp;</p><p style="text-align: justify;">&nbsp;</p><pre class="scroll"><code class="cplusplus"><span style="background-color: #c0c0c0;">## Check for module and import, if not already. </span><br><span style="background-color: #c0c0c0;"> if(-not(Get-Module -Name MicrosoftDeploymentToolkit))</span><br><span style="background-color: #c0c0c0;"> {</span><br><span style="background-color: #c0c0c0;"> try</span><br><span style="background-color: #c0c0c0;"> {</span><br><span style="background-color: #c0c0c0;"> Import-Module "C:Program FilesMicrosoft Deployment ToolkitbinMicrosoftDeploymentToolkit.psd1" -ErrorAction Stop</span><br><span style="background-color: #c0c0c0;"> }</span><br><span style="background-color: #c0c0c0;"> catch</span><br><span style="background-color: #c0c0c0;"> {</span><br><span style="background-color: #c0c0c0;"> &ldquo;Boooo&rdquo;</span><br><span style="background-color: #c0c0c0;"> $_.exception | fl * -Force</span><br><span style="background-color: #c0c0c0;"> }</span><br><span style="background-color: #c0c0c0;"> }</span><br> <br><span style="background-color: #c0c0c0;"> ## Create a drive using MDT provider. </span><br><span style="background-color: #c0c0c0;"> if(!(Test-Path SERVER1:))</span><br><span style="background-color: #c0c0c0;"> {</span><br><span style="background-color: #c0c0c0;"> New-PSDrive -Name "SERVER1" -PSProvider MDTProvider -Root "\SERVER1ShareName1"</span><br><span style="background-color: #c0c0c0;"> }</span><br> <br><span style="background-color: #c0c0c0;"> ## Populate all objects from bundles &amp; apps. All dependency apps in bundles reside in Apps path. </span><br><span style="background-color: #c0c0c0;"> $allBundles = dir "SERVER1:applicationsApp Bundles"</span><br><span style="background-color: #c0c0c0;"> $stdapps = dir "SERVER1:applicationsApps"</span><br> <br><span style="background-color: #c0c0c0;"> ## Create CSV file </span><br><span style="background-color: #c0c0c0;"> $csvFile = New-Item -Type file -Path "C:ProgramDatatemp1" -Name ((Get-Date -f MMM-dd-yyyy-HH-mm-ss)+".csv") -Force</span><br> <br><span style="background-color: #c0c0c0;"> "Name, Bundle, Guid, Version, Path, Commandline" | Out-File $csvFile -Append -Encoding ascii</span><br> <br> <br><span style="background-color: #c0c0c0;"> ## Populate and fill data into CSV</span><br><span style="background-color: #c0c0c0;"> foreach ($bundle in $allBundles) </span><br><span style="background-color: #c0c0c0;"> { </span><br><span style="background-color: #c0c0c0;"> "------------------------------------------------------------"+ ","+ ","+ ","+ ","| Out-File $csvFile -Append -Encoding ascii</span><br><span style="background-color: #c0c0c0;"> $bundle.name + ",****"+ ",****"+ ",****"+ ",****"| Out-File $csvFile -Append -Encoding ascii</span><br><span style="background-color: #c0c0c0;"> "------------------------------------------------------------"+ ","+ ","+ ","+ ","| Out-File $csvFile -Append -Encoding ascii</span><br><span style="background-color: #c0c0c0;"> foreach ($dep in $bundle.dependency) </span><br><span style="background-color: #c0c0c0;"> {</span><br><span style="background-color: #c0c0c0;"> $stdapps | foreach {</span><br><span style="background-color: #c0c0c0;"> if($_.guid -eq $dep)</span><br><span style="background-color: #c0c0c0;"> {</span><br><span style="background-color: #c0c0c0;"> $_.name + "," +$bundle.Name +","+ $_.guid + "," +$_.version + "," +("\SERVER1ShareName1" + $_.workingdirectory.remove(0,2)) + "," + $_.Commandline + "," </span><br><span style="background-color: #c0c0c0;"> }</span><br> <br><span style="background-color: #c0c0c0;"> } | Out-File $csvFile -Append -Encoding ascii</span><br> <br> <br><span style="background-color: #c0c0c0;"> }</span><br> <br><span style="background-color: #c0c0c0;"> } </span><br> <br><span style="background-color: #c0c0c0;"> ## Open CSV</span><br> <br><span style="background-color: #c0c0c0;"> &amp; $csvFile</span> <br> </code></pre><p style="text-align: justify;">&nbsp;</p><p style="text-align: justify;">&nbsp;</p><p style="text-align: justify;">You can modify the script as per your need, like adding/replacing more properties etc.. Once the object is in hand, you can fetch anything around it.</p></p>
]]></content:encoded>
    </item>
    <item>
      <title>MDT: Import-MDTApplication : The system cannot find the path specified error</title>
      <link>https://docs.microsoft.com/archive/blogs/neo/mdt-import-mdtapplication-the-system-cannot-find-the-path-specified-error</link>
      <pubDate>Wed, 15 Oct 2014 12:15:00 GMT</pubDate>
      <dc:creator><![CDATA[ketanbhut]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/neo/2014/10/15/mdt-import-mdtapplication-the-system-cannot-find-the-path-specified-error/</guid>
      <description><![CDATA[This many not be the only root cause for this error while you run into this error while running this...]]></description>
      <content:encoded><![CDATA[<p>This many not be the only root cause for this error while you run into this error while running this Commandlet, but I found this very easy to come up with this error and difficult to diagnose on the basis of normal method of troubleshooting.</p>
<p>This is MDT 2012 Update 1 and trying to publish applications for Windows 7.</p>
<p>&nbsp;</p>
<p>So, here is the error:</p>
<p><span style="background-color: #c0c0c0;">VERBOSE: Performing operation "import" on Target "Application".</span><br /><span style="background-color: #c0c0c0;">VERBOSE: Beginning application import</span><br /><span style="background-color: #c0c0c0;">VERBOSE: Copying application source files from X:\AutoDesk\Design Review\2013\Sequenced App\Autodesk_DesignReview_2013_UN_01_APPV to <a href="file://\\WN39065\PHSDeploy$\Applications\00021089_Design"><span style="background-color: #c0c0c0;">\\WNServer1\PHSDeploy$\Applications\Design</span></a> Review</span><br /><span style="background-color: #c0c0c0;">Import-MDTApplication : The system cannot find the path specified at</span></p>
<p><span style="background-color: #c0c0c0;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Import-MDTApplication -path $MDTBaseAppFolder -enable "True" -Name $App.Name - ...</span><br /><span style="background-color: #c0c0c0;">+&nbsp;&nbsp;&nbsp; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span><br /><span style="background-color: #c0c0c0;">&nbsp;&nbsp;&nbsp; + CategoryInfo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : InvalidOperation: (:) [Import-MDTApplication], DeploymentPointException</span><br /><span style="background-color: #c0c0c0;">&nbsp;&nbsp;&nbsp; + FullyQualifiedErrorId : Win32Error,Microsoft.BDD.PSSnapIn.ImportApplication</span></p>
<p>&nbsp;</p>
<p>All I'm doing is, trying to run Import-MDTApplication with parameters as below:</p>
<p><span style="background-color: #c0c0c0;">Import-MDTApplication -path $MDTBaseAppFolder -enable "True" -Name $App.Name -ShortName $App.ShortName -Version $App.Version -Publisher $App.Publisher -Language $App.Language -CommandLIne $App.CommandLIne -WorkingDirectory $App.WorkingDirectory -ApplicationSourcePath $App.AppSourcePath -DestinationFolder $App.DestinationFolder -Verbose</span></p>
<p>&nbsp;</p>
<p>Above command is wrapped into a PS1 script file called APPV5Install.ps1, which will take inputs for above parameters from a CSV file taken as a script parameter. This is to simplify task and do multiple entries into MDT.</p>
<p>The CSV file has similar to below data:</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/22/2677.MDT_Error.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-22/2677.MDT_5F00_Error.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/22/2677.MDT_Error.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-22/2677.MDT_5F00_Error.PNG" alt="" border="0" /></a></p>
<p>The issue was, there was a trailing space after 'Destinationfolder' and 'WorkingDirectory' field. After removing the space, I was able to import application successfully.</p>]]></content:encoded>
    </item>
    <item>
      <title>How to filter event log more efficiently.</title>
      <link>https://docs.microsoft.com/archive/blogs/neo/how-to-filter-event-log-more-efficiently</link>
      <pubDate>Sun, 26 May 2013 20:14:00 GMT</pubDate>
      <dc:creator><![CDATA[ketanbhut]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/neo/2013/05/26/how-to-filter-event-log-more-efficiently/</guid>
      <description><![CDATA[Many of the times, we might need to dig deep into the event log, which might not be easily...]]></description>
      <content:encoded><![CDATA[<div class="WordSection1">
<p class="MsoNormal"><strong><span style="font-size: 14pt" lang="EN-IN"> </span></strong></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN">Many of the times, we might need to dig deep into the event log, which might not be easily available through default fields available. For example, below event contains much more information than it displays in the event log. </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN">Log Name:<span>      </span>Microsoft-Windows-<span class="SpellE">GroupPolicy</span>/Operational</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN">Source:<span>        </span>Microsoft-Windows-<span class="SpellE">GroupPolicy</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN">Date:<span>          </span>5/27/2013 2:08:57 PM</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN">Event ID:<span>      </span>7004</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN">Task Category: None</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN">Level:<span>         </span>Error</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN">Keywords:<span>      </span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN">User:<span>          </span>SYSTEM</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN">Computer:<span>      </span>PC1.fabrikam.com</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN">Description:</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN">Manual processing of policy failed for computer <span class="SpellE">fabrikam</span>\PC1$ in 243 seconds.</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN">Event Xml:</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN">&lt;Event <span class="SpellE">xmlns</span>="https://schemas.microsoft.com/win/2004/08/events/event"&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"><span>  </span>&lt;System&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"><span>    </span>&lt;Provider Name="Microsoft-Windows-<span class="SpellE">GroupPolicy</span>" <span class="SpellE">Guid</span>="{fEAgB4h-97j1-45k2-A64C-4D69FFFD92C9}" /&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"><span>    </span>&lt;<span class="SpellE">EventID</span>&gt;7004&lt;/<span class="SpellE">EventID</span>&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"><span>    </span>&lt;Version&gt;1&lt;/Version&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"><span>    </span>&lt;Level&gt;2&lt;/Level&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"><span>    </span>&lt;Task&gt;0&lt;/Task&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"><span>    </span>&lt;<span class="SpellE">Opcode</span>&gt;2&lt;/<span class="SpellE">Opcode</span>&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"><span>    </span>&lt;Keywords&gt;0x4000000000000000&lt;/Keywords&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"><span>    </span>&lt;<span class="SpellE">TimeCreated</span> <span class="SpellE">SystemTime</span>="2013-05-27T02:08:57.106317800Z" /&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"><span>    </span>&lt;<span class="SpellE">EventRecordID</span>&gt;138644&lt;/<span class="SpellE">EventRecordID</span>&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"><span>    </span>&lt;Correlation <span class="SpellE">ActivityID</span>="{2B97A5FB-108B-4FtB-BCy8-A8uAE40C1E42}" /&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"><span>    </span>&lt;Execution <span class="SpellE">ProcessID</span>="640" <span class="SpellE">ThreadID</span>="3040" /&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"><span>    </span>&lt;Channel&gt;Microsoft-Windows-<span class="SpellE">GroupPolicy</span>/Operational&lt;/Channel&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"><span>    </span>&lt;Computer&gt; PC1.fabrikam.com&lt;/Computer&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"><span>    </span>&lt;Security <span class="SpellE">UserID</span>="S-1-5-18" /&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"><span>  </span>&lt;/System&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"><span>  </span>&lt;<span class="SpellE">EventData</span>&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"><span>    </span>&lt;Data Name="<span class="SpellE">PolicyElaspedTimeInSeconds</span>"&gt;243&lt;/Data&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"><span>    </span>&lt;Data Name="<span class="SpellE">ErrorCode</span>"&gt;1053&lt;/Data&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"><span>    </span>&lt;Data Name="<span class="SpellE">PrincipalSamName</span>"&gt;FABRIKAM\PC1$&lt;/Data&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"><span>    </span>&lt;Data Name="<span class="SpellE">IsMachine</span>"&gt;1&lt;/Data&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"><span>    </span>&lt;Data Name="<span class="SpellE">IsConnectivityFailure</span>"&gt;false&lt;/Data&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"><span>  </span>&lt;/<span class="SpellE">EventData</span>&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN">&lt;/Event&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><strong><span style="font-size: 14pt" lang="EN-IN"> </span></strong></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN">A simple filter around critical/errors/warning on this provider would look like this:</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">PS C:\WINDOWS\system32&gt; $query = @”</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">&lt;<span class="SpellE">QueryList</span>&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN"><span>  </span>&lt;Query Id="0" Path="Microsoft-Windows-<span class="SpellE">GroupPolicy</span>/Operational"&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN"><span>    </span>&lt;Select Path="Microsoft-Windows-GroupPolicy/Operational"&gt;*[<span class="GramE">System[</span>(Level=1<span>  </span>or Level=2 or Level=3)]]&lt;/Select&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN"><span>  </span>&lt;/Query&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">&lt;/<span class="SpellE">QueryList</span>&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">“@</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">PS C:\WINDOWS\system32&gt; Get-<span class="SpellE">WinEvent</span> -<span class="SpellE">FilterXml</span> $query</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN"><span>   </span><span class="SpellE">ProviderName</span>: Microsoft-Windows-<span class="SpellE">GroupPolicy</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="color: #000000;background-color: #e2e6f2"><span class="SpellE"><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN">TimeCreated</span></span><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN"><span>                     </span>Id <span class="SpellE">LevelDisplayName</span> Message</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">-----------<span>                     </span>-- ---------------- -------</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">5/27/2013 2:08:57 PM<span>          </span>7004 Error<span>            </span>Manual processing of policy failed for computer FABRIKAM\PC1$ in 243 seconds.</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">5/27/2013 1:18:28 PM<span>          </span>7004 Error<span>            </span>Manual processing of policy failed for computer FABRIKAM\PC1$ in 0 seconds.</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">5/27/2013 1:18:28 PM<span>          </span>7326 Error<span>            </span>Group Policy failed to discover the Domain Controller details in 0 milliseconds.</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">5/27/2013 12:27:03 PM<span>         </span>7004 Error<span>            </span>Manual processing of policy failed for computer FABRIKAM\PC1$ in 251 seconds.</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">5/27/2013 11:32:52 AM<span>         </span>7004 Error<span>            </span>Manual processing of policy failed for computer FABRIKAM\PC1$ in 0 seconds.</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">.</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">.</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">.</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">.</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN">Let’s check the first event and try to see what it displays by default</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">PS C:\WINDOWS\system32&gt; Get-<span class="SpellE">WinEvent</span> -<span class="SpellE">FilterXml</span> $query | select -First 1 | <span class="SpellE">fl</span> *</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">Message<span>              </span>: Manual processing of policy failed for computer <span class="SpellE">fabrikam</span>\pc1$ in 243 seconds.</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">Id<span>                   </span>: 7004</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">Version<span>              </span>: 1</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">Qualifiers<span>           </span>:</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">Level <span>               </span>: 2</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">Task<span>                 </span>: 0</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="color: #000000;background-color: #e2e6f2"><span class="SpellE"><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN">Opcode</span></span><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN"><span>               </span>: 2</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">Keywords<span>             </span>: 4611686018427387904</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="color: #000000;background-color: #e2e6f2"><span class="SpellE"><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN">RecordId</span></span><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN"><span>             </span>: 138644</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="color: #000000;background-color: #e2e6f2"><span class="SpellE"><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN">ProviderName</span></span><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN"><span>         </span>: Microsoft-Windows-<span class="SpellE">GroupPolicy</span></span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="color: #000000;background-color: #e2e6f2"><span class="SpellE"><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN">ProviderId</span></span><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN"><span>           </span>: aea1b4fa-97d1-45f2-a64c-4d69fffd92c9</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="color: #000000;background-color: #e2e6f2"><span class="SpellE"><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN">LogName</span></span><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN"><span>              </span>: Microsoft-Windows-<span class="SpellE">GroupPolicy</span>/Operational</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="color: #000000;background-color: #e2e6f2"><span class="SpellE"><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN">ProcessId</span></span><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN"><span>            </span>: 640</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="color: #000000;background-color: #e2e6f2"><span class="SpellE"><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN">ThreadId</span></span><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN"><span>             </span>: 3040</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="color: #000000;background-color: #e2e6f2"><span class="SpellE"><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN">MachineName</span></span><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN"><span>          </span>: pc1.fabrikam.com</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="color: #000000;background-color: #e2e6f2"><span class="SpellE"><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN">UserId</span></span><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN"><span>               </span>: S-1-5-18</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="color: #000000;background-color: #e2e6f2"><span class="SpellE"><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN">TimeCreated</span></span><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN"><span>          </span>: 5/27/2013 2:08:57 PM</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="color: #000000;background-color: #e2e6f2"><span class="SpellE"><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN">ActivityId</span></span><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN"><span>          </span><span> </span>: 2b97a5fb-108b-4fdb-bcc8-a85ae40c1e42</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="color: #000000;background-color: #e2e6f2"><span class="SpellE"><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN">RelatedActivityId</span></span><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN"><span>    </span>:</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="color: #000000;background-color: #e2e6f2"><span class="SpellE"><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN">ContainerLog</span></span><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN"><span>         </span>: Microsoft-Windows-<span class="SpellE">GroupPolicy</span>/Operational</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="color: #000000;background-color: #e2e6f2"><span class="SpellE"><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN">MatchedQueryIds</span></span><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN"><span>      </span>: {}</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">Bookmark<span>             </span>: <span class="SpellE">System.Diagnostics.Eventing.Reader.EventBookmark</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="color: #000000;background-color: #e2e6f2"><span class="SpellE"><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN">LevelDisplayName</span></span><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN"><span>     </span>: Error</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="color: #000000;background-color: #e2e6f2"><span class="SpellE"><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN">OpcodeDisplayName</span></span><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN"><span>    </span>: Stop</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="color: #000000;background-color: #e2e6f2"><span class="SpellE"><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN">TaskDisplayName</span></span><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN"><span>      </span>:</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="color: #000000;background-color: #e2e6f2"><span class="SpellE"><span class="GramE"><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN">KeywordsDisplayNames</span></span></span><span class="GramE"><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN"> :</span></span><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN"> {}</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">Properties<span>           </span>: {<span class="SpellE">System.Diagnostics.Eventing.Reader.EventProperty</span>, <span class="SpellE">System.Diagnostics.Eventing.Reader.EventProperty</span>,</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN"><span>                       </span><span class="SpellE">System.Diagnostics.Eventing.Reader.EventProperty</span>, <span class="SpellE">System.Diagnostics.Eventing.Reader.EventProperty</span>...}</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"> </span><span lang="EN-IN"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN">Convert it to XML:</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #ffffff none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 10pt" lang="EN-IN"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">PS C:\WINDOWS\system32&gt; [xml]</span><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">$evt1 =<span class="GramE">(</span>Get-<span class="SpellE">WinEvent</span> -<span class="SpellE">FilterXml</span> $query | select -First 1).<span class="SpellE">toXML</span>() # Cast it with [ xml ]
</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">PS C:\WINDOWS\system32&gt; $evt1</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">Event</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">-----</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">Event</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">PS C:\WINDOWS\system32&gt; $evt1.Event.EventData</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">Data</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">----</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">{<span class="SpellE">PolicyElaspedTimeInSeconds</span>, <span class="SpellE">ErrorCode</span>, <span class="SpellE">PrincipalSamName</span>, <span class="SpellE">IsMachine</span>...}</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">PS C:\WINDOWS\system32&gt; $evt1.Event.EventData.Data</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">Name<span>                                                               </span>#text</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">----<span>                                                               </span>-----</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="color: #000000;background-color: #e2e6f2"><span class="SpellE"><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN">PolicyElaspedTimeInSeconds</span></span><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN"><span>                                         </span>241</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="color: #000000;background-color: #e2e6f2"><span class="SpellE"><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN">ErrorCode</span></span><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN"><span>                                                          </span>1053</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="color: #000000;background-color: #e2e6f2"><span class="SpellE"><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN">PrincipalSamName</span></span><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN"><span>                         </span><span>                          </span><span class="SpellE">fabrikam</span>\pc1$</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="color: #000000;background-color: #e2e6f2"><span class="SpellE"><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN">IsMachine</span></span><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN"><span>                                                          </span>1</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="color: #000000;background-color: #e2e6f2"><span class="SpellE"><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN">IsConnectivityFailure</span></span><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN"><span>                                              </span>false</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">PS C:\WINDOWS\system32&gt; $evt1.Event.System</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">Provider<span>      </span>: Provider</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="color: #000000;background-color: #e2e6f2"><span class="SpellE"><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN">EventID</span></span><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN"><span>       </span>: 7004</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">Version<span>       </span>: 1</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">Level<span>         </span>: 2</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">Task<span>          </span>: 0</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="color: #000000;background-color: #e2e6f2"><span class="SpellE"><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN">Opcode</span></span><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN"><span>        </span>: 2</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">Keywords<span>      </span>: 0x4000000000000000</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="color: #000000;background-color: #e2e6f2"><span class="SpellE"><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN">TimeCreated</span></span><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN"><span>   </span>: <span class="SpellE">TimeCreated</span></span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="color: #000000;background-color: #e2e6f2"><span class="SpellE"><span class="GramE"><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN">EventRecordID</span></span></span><span class="GramE"><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN"> :</span></span><span style="font-family: Consolas;font-size: 9pt" lang="EN-IN"> 138660</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">Correlation<span>   </span>: Correlation</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">Execution<span>     </span>: Execution</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">Channel<span>       </span>: Microsoft-Windows-<span class="SpellE">GroupPolicy</span>/Operational</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">Computer<span>      </span>: pc1.fabrikam.com</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">Security<span>      </span>: Security</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN">Now, you can see we have control over <span class="SpellE">EventData</span> and System channel, as we could see in XML format of the Event. Let’s see if we want to filter out events only containing the error code 1053 and export them to a file, here is how it could look like:</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">PS C:\WINDOWS\system32&gt; $file = New-Item -Name log1053.txt -Path c:\temp -Force -type file</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">PS C:\WINDOWS\system32&gt; Get-<span class="SpellE">WinEvent</span> -<span class="SpellE">FilterXml</span> $query | %{</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN"><span> </span><span>      </span>$<span class="SpellE">evt</span> = [xml<span class="GramE">]$</span>_.<span class="SpellE">toxml</span>(); # Cast here with [ xml ]
</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN"><span> </span><span>      </span><span class="GramE">if(</span>$<span class="SpellE">evt.Event.EventData.Data</span> | ?{$_.'#text' -<span class="SpellE">eq</span> 1053 -and $_.name -<span class="SpellE">eq</span> "<span class="SpellE">errorcode</span>"})</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN"><span> </span><span>      </span>{</span></p>
<p class="MsoNormal" style="text-indent: 0.5in;line-height: normal;margin: 0in 0in 0.0001pt 0.5in"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">$_ | <span class="SpellE">fl</span> * | Out-File $file -Append</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;text-indent: 0.5in;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN">}</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span style="background: #e2e6f2 none repeat scroll 0% 0%;color: #000000;font-family: Consolas;font-size: 9pt" lang="EN-IN"><span> </span>}</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal"><span lang="EN-IN">Hope this is helpful. </span></p>

</div>]]></content:encoded>
    </item>
    <item>
      <title>How to add local group to AD LDS Readers role using PowerShell</title>
      <link>https://docs.microsoft.com/archive/blogs/neo/how-to-add-local-group-to-ad-lds-readers-role-using-powershell</link>
      <pubDate>Sun, 19 May 2013 18:35:00 GMT</pubDate>
      <dc:creator><![CDATA[ketanbhut]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/neo/2013/05/19/how-to-add-local-group-to-ad-lds-readers-role-using-powershell/</guid>
      <description><![CDATA[Posting this snippet in case someone needs to add a local group to AD LDS readers role, using...]]></description>
      <content:encoded><![CDATA[<div class="WordSection1">
<p><span style="color: black; font-family: 'Arial','sans-serif'; font-size: 9pt;">Posting this snippet in case someone needs to add a local group to AD LDS readers role, using PowerShell/ADSI.</span></p>
<p class="MsoNormal" style="background: white;"><span style="font-family: 'Lucida Console'; font-size: 9pt;">&nbsp;</span></p>
<p class="MsoNormal" style="background: white;"><span style="color: darkgreen; font-family: 'Lucida Console'; font-size: 9pt;">#Get the SID of a local group</span></p>
<p class="MsoNormal" style="background: white;"><span style="color: orangered; font-family: 'Lucida Console'; font-size: 9pt;">$myGroup</span><span style="font-family: 'Lucida Console'; font-size: 9pt;"> <span style="color: darkgray;">=</span> <span style="color: blue;">New-Object</span> <span style="color: blueviolet;">security.principal.ntaccount</span>(<span style="color: darkred;">"myGroup2"</span>)</span></p>
<p class="MsoNormal" style="background: white;"><span style="color: orangered; font-family: 'Lucida Console'; font-size: 9pt;">$myGroupSid</span><span style="font-family: 'Lucida Console'; font-size: 9pt;"> <span style="color: darkgray;">=</span> <span style="color: orangered;">$myGroup</span><span style="color: darkgray;">.</span>Translate(<span style="color: darkgray;">[</span><span style="color: teal;">security.principal.securityidentifier</span><span style="color: darkgray;">]</span>)</span></p>
<p class="MsoNormal" style="background: white;"><span style="font-family: 'Lucida Console'; font-size: 9pt;">&nbsp;</span></p>
<p class="MsoNormal" style="background: white;"><span style="color: darkgreen; font-family: 'Lucida Console'; font-size: 9pt;">#connect to partition</span></p>
<p class="MsoNormal" style="background: white;"><span style="color: orangered; font-family: 'Lucida Console'; font-size: 9pt;">$readersRole</span><span style="font-family: 'Lucida Console'; font-size: 9pt;"> <span style="color: darkgray;">=</span> <span style="color: darkgray;">[</span><span style="color: teal;">adsi</span><span style="color: darkgray;">]</span><span style="color: darkred;">"LDAP://mdt:389/CN=Readers,CN=Roles,DC=myPartition"</span></span></p>
<p class="MsoNormal" style="background: white;"><span style="font-family: 'Lucida Console'; font-size: 9pt;">&nbsp;</span></p>
<p class="MsoNormal" style="background: white;"><span style="color: darkgreen; font-family: 'Lucida Console'; font-size: 9pt;">#Add the group as member to Readers </span></p>
<p class="MsoNormal" style="background: white;"><span style="color: orangered; font-family: 'Lucida Console'; font-size: 9pt;">$memberToAdd</span><span style="font-family: 'Lucida Console'; font-size: 9pt;"> <span style="color: darkgray;">=</span> <span style="color: darkred;">"&lt;SID=</span><span style="color: orangered;">$myGroupSid</span><span style="color: darkred;">&gt;"</span></span></p>
<p class="MsoNormal" style="background: white;"><span style="color: orangered; font-family: 'Lucida Console'; font-size: 9pt;">$readersRole</span><span style="color: darkgray; font-family: 'Lucida Console'; font-size: 9pt;">.</span><span style="font-family: 'Lucida Console'; font-size: 9pt;">member<span style="color: darkgray;">.</span>Add(<span style="color: orangered;">$memberToAdd</span>)</span></p>
<p class="MsoNormal" style="background: white;"><span style="color: orangered; font-family: 'Lucida Console'; font-size: 9pt;">$readersRole</span><span style="color: darkgray; font-family: 'Lucida Console'; font-size: 9pt;">.</span><span style="font-family: 'Lucida Console'; font-size: 9pt;">CommitChanges()</span></p>
<p class="MsoNormal" style="background: white;"><span style="font-family: 'Lucida Console'; font-size: 9pt;">&nbsp;</span></p>
<p class="MsoNormal" style="background: white;"><span style="font-family: 'Lucida Console'; font-size: 9pt;">&nbsp;</span></p>
<p class="MsoNormal" style="background: white;"><span style="color: darkgreen; font-family: 'Lucida Console'; font-size: 9pt;">#connect to partition again, to confirm (or can use adsiedit.msc)</span></p>
<p class="MsoNormal" style="background: white;"><span style="color: orangered; font-family: 'Lucida Console'; font-size: 9pt;">$readersRole</span><span style="font-family: 'Lucida Console'; font-size: 9pt;"> <span style="color: darkgray;">=</span> <span style="color: darkgray;">[</span><span style="color: teal;">adsi</span><span style="color: darkgray;">]</span><span style="color: darkred;">"LDAP://mdt:389/CN=Readers,CN=Roles,DC=myPartition"</span></span></p>
<p class="MsoNormal" style="background: white;"><span style="color: orangered; font-family: 'Lucida Console'; font-size: 9pt;">$readersRole</span><span style="color: darkgray; font-family: 'Lucida Console'; font-size: 9pt;">.</span><span style="font-family: 'Lucida Console'; font-size: 9pt;">member</span></p>
<p class="MsoNormal" style="background: white;"><span style="font-family: 'Lucida Console'; font-size: 9pt;">&nbsp;</span></p>
<p class="MsoNormal">&nbsp;</p>
</div>]]></content:encoded>
    </item>
  </channel>
</rss>