<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-9212075168000095632</atom:id><lastBuildDate>Wed, 11 Sep 2024 01:03:17 +0000</lastBuildDate><title>Mikey&#39;s Powershell Blog</title><description></description><link>http://mikeyspowershellblog.blogspot.com/</link><managingEditor>noreply@blogger.com (Unknown)</managingEditor><generator>Blogger</generator><openSearch:totalResults>42</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9212075168000095632.post-1992362670710941639</guid><pubDate>Sat, 04 Feb 2023 16:44:00 +0000</pubDate><atom:updated>2023-02-05T14:15:32.187-06:00</atom:updated><title>Finding Installed Applications (Get-ItemProperty vs. Get-WMIObject)</title><description>&lt;p&gt;&amp;nbsp;Greetings everyone!&lt;/p&gt;&lt;p&gt;Forgive my absence.&amp;nbsp; I am working on my AZ-900 certification and there is a lot to learn!&lt;/p&gt;&lt;p&gt;This week I was given a list of servers.&amp;nbsp; I was tasked with getting all the applications installed on each of those servers.&amp;nbsp; So, I donned my PowerShell battle armor and faced the challenge.&lt;/p&gt;&lt;p&gt;First, I used the following code:&lt;br /&gt;get-itemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-object DisplayName, DisplayVersion, Publisher, InstallDate | FT -AutoSize&lt;/p&gt;&lt;p&gt;This did give me a list of applications that had an Uninstall registry entry.&amp;nbsp; However, I know there were other programs that were not on the list.&amp;nbsp; So, I decided to use the following code:&lt;br /&gt;Get-WmiObject -Class Win32_Product | Select-object Name | FT -AutoSize&lt;/p&gt;&lt;p&gt;It did give me more applications than the get-itemProperty code, but it took a lot longer for the list to appear.&amp;nbsp; The Get-itemProperty took 65 milliseconds.&amp;nbsp; The Get-WmiObject took 1 minute 22 seconds.&lt;/p&gt;&lt;p&gt;One article said to use Get-CIMInstance instead of Get-WmiObject in order to get a quicker response.&amp;nbsp; Get-CIMInstance took 1 minute and 37 seconds.&amp;nbsp; Oh, well.&lt;/p&gt;&lt;p&gt;I am still looking for a reason why the itemProperty command runs faster than the WmiObject command.&amp;nbsp; But, my main point is that there are two different ways to list what is installed on a computer, and that Get-WmiObject lists more installed apps than the other command.&lt;/p&gt;&lt;p&gt;As always, post a comment if you have any questions, or if you know why one is faster than the other.&amp;nbsp; I would appreciate it.&amp;nbsp; 😀&lt;/p&gt;&lt;p&gt;Until next time...&lt;/p&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Mikey&#39;s PowerShell Blog RSS Feed&lt;/div&gt;</description><link>http://mikeyspowershellblog.blogspot.com/2023/02/finding-install-applications-get.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9212075168000095632.post-3569536561312752157</guid><pubDate>Mon, 16 Jan 2023 22:00:00 +0000</pubDate><atom:updated>2023-01-16T16:00:14.804-06:00</atom:updated><title>Reviewing the Fundamentals</title><description>&lt;p&gt;&amp;nbsp;Greetings everyone!&lt;/p&gt;&lt;p&gt;I haven&#39;t posted in a while due to the holidays, the flu, and taking some much needed time off.&amp;nbsp; But, I am back and I want to talk about how, sometimes, revisiting the fundamentals is beneficial.&lt;/p&gt;&lt;p&gt;I downloaded Jeff Hicks&#39; &quot;The PowerShell Practice Primer&quot; (https://leanpub.com/psprimer).&amp;nbsp; For $29.95, it is well worth the spend.&amp;nbsp; Why?&amp;nbsp; Well, let me tell ya...&lt;/p&gt;&lt;p&gt;As you all know, I love PowerShell!&amp;nbsp; It has saved me a lot of time and headache, especially when managing Active Directory.&amp;nbsp; So, I want to keep my skills sharp and I thought Jeff&#39;s book would do that for me.&amp;nbsp; The exercises in the book showed me that I often overthink a solution to a problem.&amp;nbsp; For example, Exercise 11 asks you to get all of the &#39;get&#39; commands in the PSReadLine module.&amp;nbsp; This was something I didn&#39;t know how to do.&amp;nbsp; After fumbling with some of the cmdlets, I looked at the solutions and found the following:&lt;br /&gt;Get-Command -module PSReadLine -Verb get&lt;/p&gt;&lt;p&gt;Another example, I am used to putting output into a variable and then doing a ForEach loop to get the information I need.&amp;nbsp; &amp;nbsp;Exercise 19 asks to create an XML file for all processes running under my account name.&amp;nbsp; My solution was:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;$processes = get-process -IncludeUserName&lt;br /&gt;$me_process = Foreach ($process in $processes)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; If ($process.UserName -like &quot;*me*&quot;)&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; $process.ProcessName;$process.UserName&lt;br /&gt;&amp;nbsp; }&amp;nbsp; &lt;br /&gt;}&lt;br /&gt;$me_process | Export-Clixml C:\users\trekr\documents\exer19.xml&amp;nbsp;&lt;/p&gt;&lt;p&gt;As you can see, I used a variable and a ForEach loop...not efficient what so ever.&lt;/p&gt;&lt;p&gt;The solution was much simpler:&lt;/p&gt;&lt;p&gt;Get-Process -IncludeUserName |
where-object {$_.Username -eq &quot;$($env:USERDOMAIN)\$($env:USERNAME)&quot; } |
Export-Clixml -Path myprocs.xml&lt;/p&gt;&lt;p&gt;Pipelines make things simpler.&amp;nbsp; I had forgotten that.&lt;/p&gt;&lt;p&gt;We should be creating efficient code.&amp;nbsp; Which is why I decided to practice my skills.&amp;nbsp; I feel that people who script, no matter their experience, benefit from stepping back and examining their coding style.&amp;nbsp; Any little change may be what is needed to improving their coding.&lt;/p&gt;&lt;p&gt;I would be interested in your opinion on this.&amp;nbsp; So, please feel free to comment.&lt;/p&gt;&lt;p&gt;Until next time...&lt;/p&gt;&lt;p&gt;NOTE: Jeff Hicks gave me permission to use the examples from his book.&amp;nbsp; He&#39;s a good guy.&lt;/p&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Mikey&#39;s PowerShell Blog RSS Feed&lt;/div&gt;</description><link>http://mikeyspowershellblog.blogspot.com/2023/01/reviewing-fundamentals.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9212075168000095632.post-3687715289903729882</guid><pubDate>Mon, 19 Dec 2022 15:16:00 +0000</pubDate><atom:updated>2022-12-19T09:16:05.105-06:00</atom:updated><title>Finding Mailbox With a Specific Proxy Address</title><description>&lt;p&gt;&amp;nbsp;Hello everyone!&lt;/p&gt;&lt;p&gt;I recently got a request to find a mailbox that is using a specific proxy address.&amp;nbsp; I have been working for my company for over 3 years and I found it interesting we haven&#39;t been ask to do this sooner.&amp;nbsp; It is requests like this that shows the usefulness of PowerShell.&lt;/p&gt;&lt;p&gt;The first script that was created just checked Active Directory for the proxy address:&lt;br /&gt;&lt;i&gt;Get-ADUser -Filter * -Properties proxyaddresses | Select -Object Name,@{L=&quot;ProxyAddresses&quot;;E={($_.ProxyAddresses -match &#39;^smtp:&#39;)}} | fl&lt;/i&gt;&lt;/p&gt;&lt;p&gt;You will get the following output:&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEi9jhdLQy2Dq9DAC8UzOJe9GXV_bG0wUvo-hh5soE51qZVoKAi8By2VLgmw5xy8PrneLB6kz_bScXLoL3fCeLP3lWMLP7ytOMWRKne_b9-CAZxS4_VTKBQMlB5RvQ288j8lpVi9OlhZBuU4g9zCD8lnUgVwfsR9qwbv3E7qoxcCnfnH_d1M4GUwOxhaQw&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;456&quot; data-original-width=&quot;536&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEi9jhdLQy2Dq9DAC8UzOJe9GXV_bG0wUvo-hh5soE51qZVoKAi8By2VLgmw5xy8PrneLB6kz_bScXLoL3fCeLP3lWMLP7ytOMWRKne_b9-CAZxS4_VTKBQMlB5RvQ288j8lpVi9OlhZBuU4g9zCD8lnUgVwfsR9qwbv3E7qoxcCnfnH_d1M4GUwOxhaQw&quot; width=&quot;282&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span face=&quot;-apple-system, BlinkMacSystemFont, Segoe UI, system-ui, Apple Color Emoji, Segoe UI Emoji, Segoe UI Web, sans-serif&quot; style=&quot;color: #242424;&quot;&gt;&lt;span style=&quot;background-color: #e8ebfa; font-size: 14px;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Since I believe in the concept of &quot;complete work&quot;, I changed the script to search Exchange Online for the proxy addresses.&amp;nbsp; Connect to MSOL and use the following:&lt;br /&gt;&lt;i&gt;Get-MSOLUser -all | Select-Object UserPrincipalName&lt;/i&gt;,&lt;i&gt;,@{L=&quot;ProxyAddresses&quot;;E={($_.ProxyAddresses -match &#39;^smtp:&#39;)}} | fl&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;This will give you the same output format as the first script.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;For both scripts, you can substitute &quot;-match &#39;^smtp:&#39;&quot; for something more specific.&amp;nbsp; For example, if you want to search for proxy addresses that start with &quot;HR&#39;, you can change the script as follows:&lt;br /&gt;&lt;i&gt;Select-object Name,@{L=&quot;ProxyAddresses&quot;;E={($_.ProxyAddress -match &#39;^smtp:hr*&#39;)}}I&lt;/i&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;As always, I hope you found this information useful.&amp;nbsp; Please feel free to post a comment or question.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Until next time...&lt;/div&gt;&lt;span face=&quot;-apple-system, BlinkMacSystemFont, Segoe UI, system-ui, Apple Color Emoji, Segoe UI Emoji, Segoe UI Web, sans-serif&quot; style=&quot;color: #242424;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Mikey&#39;s PowerShell Blog RSS Feed&lt;/div&gt;</description><link>http://mikeyspowershellblog.blogspot.com/2022/12/finding-mailbox-with-specific-proxy.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEi9jhdLQy2Dq9DAC8UzOJe9GXV_bG0wUvo-hh5soE51qZVoKAi8By2VLgmw5xy8PrneLB6kz_bScXLoL3fCeLP3lWMLP7ytOMWRKne_b9-CAZxS4_VTKBQMlB5RvQ288j8lpVi9OlhZBuU4g9zCD8lnUgVwfsR9qwbv3E7qoxcCnfnH_d1M4GUwOxhaQw=s72-c" height="72" width="72"/><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9212075168000095632.post-2998411217089614963</guid><pubDate>Sun, 11 Dec 2022 15:31:00 +0000</pubDate><atom:updated>2022-12-11T09:31:24.419-06:00</atom:updated><title>Pulling list of Azure servers</title><description>&lt;p&gt;&amp;nbsp;Greetings everyone!&lt;/p&gt;&lt;p&gt;Sorry for the delay but I had either a cold, the flu, or, possibly, the plague.&amp;nbsp; But I am back with another terrific script from my good friend, Ross Jurek.&lt;/p&gt;&lt;p&gt;Ross created a script that will gather all Azure subscriptions, based on your Azure account, and list the virtual machines for each subscription.&amp;nbsp; The following information is retrieved:&lt;br /&gt;Name&lt;br /&gt;OS&lt;br /&gt;Location&lt;br /&gt;The state of the VM&lt;/p&gt;&lt;p&gt;Here is the script:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;i&gt;Connect-AzAccount -Verbose -Tenant &amp;lt;your tenant ID&amp;gt;&amp;nbsp;&lt;/i&gt;&lt;/p&gt;&lt;p&gt;&lt;i&gt;$VMReport = @()&lt;br /&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;#Get All Subscriptions&lt;/span&gt;&lt;br /&gt;$subs = Get-AzSubscription&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #93c47d;&quot;&gt;#Arry to store list of VMs&lt;/span&gt;&lt;br /&gt;$vmobjs = @()&lt;br /&gt;&lt;span style=&quot;color: #93c47d;&quot;&gt;#loop through each subscription&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;p&gt;&lt;i&gt;foreach ($sub in $subs)&lt;br /&gt;{&lt;br /&gt;&lt;span style=&quot;color: #93c47d;&quot;&gt;#Display the current processing subscription&lt;/span&gt;&lt;br /&gt;Write-Host &quot;Processing subscription $($sub.Name)&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; try&lt;br /&gt;&amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #93c47d;&quot;&gt;#Select the subscription&lt;br /&gt;&amp;nbsp; &amp;nbsp; #please add the condition if you want to skip a particular subscription&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; Select-AzSubscription -SubscriptionId $sub.SubscriptionId -ErrorAction Continue&lt;/i&gt;&lt;/p&gt;&lt;p&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #93c47d;&quot;&gt;#Get all the VMs information&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; $vms = Get-AzVm&amp;nbsp;&lt;/i&gt;&lt;/p&gt;&lt;p&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #93c47d;&quot;&gt;#loop through all the VMs&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach ($vm in $vms)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $PowerState = Get-AzVM&amp;nbsp; -Name $vm.Name -Status | select-object PowerState&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $vm.Name , $vm.StorageProfile.OsDisk.OsType , $vm.Location , $PowerState.PowerState&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $VMReport += New-Object psobject -Property @{&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;VMName&quot; = $vm.Name&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;VMOSType&quot; = $vm.StorageProfile.OsDisk.OsType&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;VMLocation&quot; = $vm.Location&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;VMState&quot; = $PowerState.PowerState&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; catch&lt;br /&gt;&amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Write-Host $error[0]&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;/i&gt;&lt;/p&gt;&lt;p&gt;&lt;i&gt;}&lt;/i&gt;&lt;/p&gt;&lt;p&gt;&lt;i&gt;&lt;span style=&quot;color: #93c47d;&quot;&gt;#export to csv format&lt;/span&gt;&lt;br /&gt;Remove-Item c:\temp\AzureServerList.csv -ErrorAction Ignore&lt;br /&gt;$VMReport | Export-Csv &quot;c:\temp\AzureServerList.csv&quot;&lt;/i&gt;&lt;/p&gt;&lt;p&gt;&lt;i&gt;Disconnect-AzAccount&lt;/i&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times;&quot;&gt;I have a Virtual Studio subscription and I didn&#39;t want that information to be part of the output.&amp;nbsp; I made the following change to the $subs = Get-AzSubscription command&lt;br /&gt;$subs = Get-AzSubscription | where-object { $_.Name -like &quot;My Cloud*&quot;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times;&quot;&gt;I had an issue when I first tried the script.&amp;nbsp; I kept getting the following message for each VM:&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;-webkit-font-smoothing: antialiased; background-color: #e8ebfa; box-sizing: border-box; color: #242424; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, system-ui, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Web&amp;quot;, sans-serif; font-size: 14px;&quot;&gt;WARNING: There are more than 100 VMs in the result.&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;Only the statuses of 100 VMs are shown to avoid throttling.&lt;span style=&quot;-webkit-font-smoothing: antialiased; box-sizing: border-box;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;To get the actual status of each VM, please provide a VM name with -Status param&lt;/span&gt;&lt;span style=&quot;background-color: #e8ebfa; color: #242424; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, system-ui, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Web&amp;quot;, sans-serif; font-size: 14px;&quot;&gt;eter.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times;&quot;&gt;I talked with Ross about this and he recommended I either install or upgrade my Az module.&amp;nbsp; So, if you get the error, try either of the following:&lt;br /&gt;install-module -name Az -RequiredVersion 9.1.1&lt;br /&gt;update-module -name Az -RequiredVersion 9.1.1&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times;&quot;&gt;Again, I want to thank Ross Jurek for sharing this code with us.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times;&quot;&gt;Please leave a comment if you have any questions feedback.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times;&quot;&gt;Until next time...&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Mikey&#39;s PowerShell Blog RSS Feed&lt;/div&gt;</description><link>http://mikeyspowershellblog.blogspot.com/2022/12/pulling-list-of-azure-servers.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9212075168000095632.post-6794499438000670800</guid><pubDate>Sun, 27 Nov 2022 23:47:00 +0000</pubDate><atom:updated>2022-11-28T09:11:52.613-06:00</atom:updated><title>Update on the MIM Script from Last Post</title><description>&lt;p&gt;On PowerShell Power Users LinkedIn group, Tim Clapper posted a way to speed up the main script.&amp;nbsp; Here two snippets from the the script I posted:&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;results&lt;/span&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;get-aduser&lt;/span&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;-filter&lt;/span&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;-properties&lt;/span&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;where-object&lt;/span&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$_&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;givenName&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;-eq&lt;/span&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$FirstName&lt;/span&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;-and&lt;/span&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$_&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;sn&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;-like&lt;/span&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$tempLastName&lt;/span&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;}&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;select-object&lt;/span&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;givenname&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;sn&lt;/span&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color: #222222; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;Measure-object&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;While&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$results&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;count&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;-eq&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: purple; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;)&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;#this checks if there is an account with the first name and last name.&amp;nbsp; If $results.count is zero, the while loop is exited.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$tempLastName&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$LastName&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$counter&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&lt;span style=&quot;color: orangered;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: orangered;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;#This command now looks for a first name and last name+counter.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$results&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;get-aduser&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;-filter&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;-properties&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;where-object&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$_&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;givenName&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;-eq&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$FirstName&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;-and&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$_&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;sn&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;-like&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$tempLastName&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;}&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;select-object&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;givenName&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;sn&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;measure-object&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$counter&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; color: #222222; line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;Tim recommended I make the following changes to speed up the script:&lt;br /&gt;1. Instead of using the where-object statement, move the conditions to the -filter switch&lt;br /&gt;2. Instead of using &#39;sn&#39;, use &#39;surname&#39;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; color: #222222; line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;The changes would look like the following:&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$results&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;get-aduser&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;-filter(&lt;/span&gt;&lt;span style=&quot;color: red; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;givenName&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;-eq&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$FirstName&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;-and&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;surname&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;-like&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$tempLastName)&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;select-object&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;givenName&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;surname&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;measure-object&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in;&quot;&gt;Within the While loop&lt;br /&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;While&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$results&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;count&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;-eq&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: purple; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;)&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;#this checks if there is an account with the first name and last name.&amp;nbsp; If $results.count is zero, the while loop is exited.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$tempLastName&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$LastName&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$counter&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&lt;span style=&quot;color: orangered;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: orangered;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;#This command now looks for a first name and last name+counter.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$results&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: blue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;get-aduser&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: navy; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;-filter(&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: red; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;givenName&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;-eq&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$FirstName&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;-and&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;surname&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;-like&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$tempLastName)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: blue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;select-object&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: blueviolet; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;givenName&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: blueviolet; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;surname&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: blue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;measure-object&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;span style=&quot;font-size: 13.2px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$counter&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; color: #222222; line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;I&#39;ve tested the code and it does run faster since the code isn&#39;t searching all of Active Directory with the Where-Object command.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span&gt;Test the change for yourself and let me know what you think. You can find the full code and MIM activity screen shot at&amp;nbsp;https://github.com/mikeegan400/MIM-Test-for-Unique-First-and-Last-Name&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span&gt;A huge thank you to Tim Clapper.&amp;nbsp; He is one of the many PowerShell fans in the LinkedIn PowerShell group.&amp;nbsp; I highly recommend you join!&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span&gt;Until next time...&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Mikey&#39;s PowerShell Blog RSS Feed&lt;/div&gt;</description><link>http://mikeyspowershellblog.blogspot.com/2022/11/update-on-mim-script-from-last-post.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9212075168000095632.post-1489165130995145635</guid><pubDate>Mon, 21 Nov 2022 13:46:00 +0000</pubDate><atom:updated>2022-11-21T07:46:17.267-06:00</atom:updated><title>Triumphant Return and a MIM Script</title><description>&lt;p&gt;&amp;nbsp;I&#39;M BACK!!&amp;nbsp; It has been way too long but I am back.&lt;/p&gt;&lt;p&gt;I will be posting more scripts that we create and use in the company I work for.&amp;nbsp; They will be mostly GET- scripts against Active Directory, as well as the PowerShell commands we use in our Microsoft Identity Management (MIM) environment.&lt;/p&gt;&lt;p&gt;So, let&#39;s get started with a MIM script that we use to look for unique first name and last name within the MIM portal.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;As you may or may not know, the MIM portal has PowerShell
version 2.0 embedded in the portal.&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;In
order to use the get-ADuser, you need to be running PowerShell version 3.0. I
was able to find a workaround so that the main script can be executed using PowerShell
3.0. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;I created two scripts, the main scripts and the script that
runs inside the activity.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;This is the code that is running within the PowerShell activity:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;As you can see, the command that starts with $templastname runs the PowerShell command but it runs it under version 3.0.&amp;nbsp; This was how I was able to work around the PowerShell 2.0 limit within the MIM portal.&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;PARAM&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: dimgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: deepskyblue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;parameter&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt;(mandatory&lt;/span&gt;&lt;span style=&quot;color: dimgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #a82d00; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;$true&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: dimgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #a82d00; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;$FirstName&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: dimgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;,[&lt;/span&gt;&lt;span style=&quot;color: deepskyblue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;parameter&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt;(mandatory&lt;/span&gt;&lt;span style=&quot;color: dimgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #a82d00; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;$true&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: dimgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #a82d00; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;$LastName&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: #a82d00; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$tempLastName&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: dimgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;powershell&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;-version&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: purple; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;3.0&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;-command&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&quot;c:\scripts\test_unique_lastname.ps1
&lt;/span&gt;&lt;span style=&quot;color: #a82d00; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$firstName&lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a82d00; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$lastname&lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&quot;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: #a82d00; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$tempLastName&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;This is the main script.&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;#This
makes the variables available to the script.&lt;/span&gt;&lt;span style=&quot;color: darkblue;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;PARAM&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: deepskyblue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;parameter&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt;(mandatory&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;$true&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;$FirstName&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;,[&lt;/span&gt;&lt;span style=&quot;color: deepskyblue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;parameter&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt;(mandatory&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;$true&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;$LastName&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;#This
loads the module in case it isn’t already loaded&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;import-module&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;activedirectory&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;#This
sets the counter for&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;$counter&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: purple; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;$tempLastName&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;$LastName&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;#This command looks for an account that contains the first name and last name similar to what was entered in the portal&lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&lt;o:p&gt;$&lt;/o:p&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;results&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;get-aduser&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;-filter&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;-properties&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;where-object&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt; {&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$_&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;givenName
&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;-eq&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$FirstName&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;-and&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$_&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;sn &lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;-like&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$tempLastName&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;} &lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;select-object&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;givenname&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;sn&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;Measure-object&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;While&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;$results&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;count
&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;-eq&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: purple; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;)&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;#this checks if there is an account with the first name and last name.&amp;nbsp; If $results.count is zero, the while loop is exited.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;$tempLastName&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;$LastName&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;$counter&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&lt;span style=&quot;color: orangered;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: orangered;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;#This command now looks for a first name and last name+counter.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;$results&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;get-aduser&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;-filter&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;-properties&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;where-object&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt; {&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;$_&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt;givenName &lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;-eq&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;$FirstName&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;-and&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;$_&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt;sn &lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;-like&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;$tempLastName&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt;} &lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;select-object&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;givenName&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;sn&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;measure-object&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;$counter&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9pt;&quot;&gt;&lt;span style=&quot;color: #04ff00;&quot;&gt;#This value is returned to the PowerShell activity in the portal&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: orangered;&quot;&gt;$tempLastName&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;; mso-color-alt: windowtext;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Lucida Console&amp;quot;; font-size: 9.0pt; mso-bidi-font-family: &amp;quot;Lucida Console&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The scripts and the screenshots of the PowerShell activity
are available in my GitHub account, https://github.com/mikeegan400/MIM-Test-for-Unique-First-and-Last-Name.&amp;nbsp; Please feel free to contact me if you have
any questions or comments.&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Mikey&#39;s PowerShell Blog RSS Feed&lt;/div&gt;</description><link>http://mikeyspowershellblog.blogspot.com/2022/11/triumphant-return-and-mim-script.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9212075168000095632.post-3434794110948278445</guid><pubDate>Mon, 17 Oct 2022 15:12:00 +0000</pubDate><atom:updated>2022-10-17T10:12:14.188-05:00</atom:updated><title>Long time, no see</title><description>&lt;p&gt;&amp;nbsp;I have been doing a lot of PowerShell scripting in my current job.&amp;nbsp; The best part is that most of the team are PowerShell enthusiasts.&amp;nbsp; So, I am getting a lot of ideas and suggestions for new scripts...which I will share with you folks.&lt;/p&gt;&lt;p&gt;My plan is to post one day a week.&amp;nbsp; The topics will vary from cool scripts to resources to helpful tips.&lt;/p&gt;&lt;p&gt;I am excited to get back to this blog.&amp;nbsp; I hope you will all find it helpful.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Until next time,&lt;br /&gt;Mike&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Mikey&#39;s PowerShell Blog RSS Feed&lt;/div&gt;</description><link>http://mikeyspowershellblog.blogspot.com/2022/10/long-time-no-see.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9212075168000095632.post-8511521089196521490</guid><pubDate>Tue, 11 Jun 2019 13:14:00 +0000</pubDate><atom:updated>2019-06-11T08:14:45.703-05:00</atom:updated><title>Monitor Changes in a Folder</title><description>I receive a daily email from Powershell.com (&lt;a href=&quot;http://www.powershell.com/&quot;&gt;www.powershell.com&lt;/a&gt;).&amp;nbsp; When I saw this script I said to myself, &quot;There were times I really could have used this.&quot;.&amp;nbsp; Particularly when I wanted to know what files were affected when running an update.&amp;nbsp; I saved this file as Run-fileWatcher.ps1:&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;


In this example, I created a folder called Test_Folder&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
# Change the $folder
variable to the folder you want to monitor&lt;/div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;

$folder =
&quot;C:\Test_Folder&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;

$filter = &#39;*&#39;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;# looks for all changes&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;try&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;

{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;

&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;$fsw = New-Object
System.IO.FileSystemWatcher $folder , $filter -ErrorAction Stop # the
FileSystemWatcher component watches for changes in the LastWrite and LastAccess
properties of a file.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;

}&lt;/span&gt;&lt;br /&gt;


&lt;br /&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;catch
[System.ArgumentException] # checks for errors&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;

{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;

&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Write-Warning &quot;Oops: $_&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;

&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;return&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;

}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;

&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;$fsw.IncludeSubdirectories
= $true &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;

$fsw.NotifyFilter =
[IO.NotifyFilters]&#39;FileName, LastWrite&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;

&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;do&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;

{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;

&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;$result = $fsw.WaitForChanged([
System.IO.WatcherChangeTypes]::All, 1000)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;

&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;if ($result.TimedOut) { continue }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;

&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;$result&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;

&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Write-Host &quot;Change in $($result.Name) -
$( $result.ChangeType)&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;

&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;} while ($true)&lt;/span&gt;&lt;br /&gt;


&lt;br /&gt;&lt;br /&gt;
While the script was running, I created a file called Test.txt.&amp;nbsp; Inside the file, I entered &quot;This is a test.&quot;&amp;nbsp; I saved the file to c:\test_folder, and the output was:&lt;br /&gt;
&lt;img height=&quot;97&quot; src=&quot;data:image/png;base64,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&quot; width=&quot;640&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
When I deleted the file, the output was:&lt;br /&gt;
&lt;img src=&quot;data:image/png;base64,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&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
It should be possible to write the output to a file, but I haven&#39;t tested that yet.&amp;nbsp; I will put that on my list, as well&amp;nbsp;as adding modification time and date.&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
I hope you found this helpful.&amp;nbsp; Again, go to &lt;a href=&quot;http://www.powershell.com/&quot;&gt;www.powershell.com&lt;/a&gt; and sign up for their email.&amp;nbsp; Some of their scripts I use regularly.&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
Later,&lt;br /&gt;
Mike E&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Mikey&#39;s PowerShell Blog RSS Feed&lt;/div&gt;</description><link>http://mikeyspowershellblog.blogspot.com/2019/06/monitor-changes-in-folder.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9212075168000095632.post-4322583006174285457</guid><pubDate>Tue, 04 Jun 2019 12:48:00 +0000</pubDate><atom:updated>2019-06-04T07:48:31.046-05:00</atom:updated><title>Finding Items in Group Policies</title><description>&lt;span style=&quot;font-family: Times, &amp;quot;Times New Roman&amp;quot;, serif; font-size: small;&quot;&gt;I have had occasion to look for specific information within a client&#39;s group policies.&amp;nbsp; In particular, what drives are being mapped for a group of users.&amp;nbsp; This client a quite a few organizational units (OUs) and, thus, quite a few groups policies (GPOs).&amp;nbsp; To simplify this process, I looked for a Powershell solution to help me.&amp;nbsp; This is what I found:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
Param&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;(&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;# This section is the -StringToFind parameter&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;[Parameter(Mandatory=$true,&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;ValueFromPipelineByPropertyName=$true,&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Position=0)]&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;[String]&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;$StringToFind&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Begin&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;$GPOsToCheck = get-gpo -all |Sort-Object
-property displayname # gather all GPO information and sort by displayname&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Write-Host &quot; Checking through&quot;
$GPOsToCheck.count &quot;GPO&#39;s&quot;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Process&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
$ListOFAffectedGPOs
= @()&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
$count = 1&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
$GPOsToCheckCount =
$GPOsToCheck.count&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
foreach ($item in
$GPOsToCheck) # go through&amp;nbsp;the list of group policies&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
{&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
$Result =
Get-GPOReport -name $item.DisplayName -ReportType XML&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
if ($Result -match
$StringToFind) # check if Result variable information matches the string&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
{&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
$ListOFAffectedGPOs
+= $item.DisplayName &lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
}&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
else&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
{&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
}&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
Write-Host
&quot;$count of $GPOsToCheckCount&quot;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
$count++&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
}&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
Write-Host
&quot;List of GPO&#39;s that contain $StringToFind&quot;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;-ForegroundColor Green&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
$ListOFAffectedGPOs&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;End&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, &amp;quot;Times New Roman&amp;quot;, serif; font-size: small;&quot;&gt;The syntax of the script is:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Get-GPOThatContains.ps1 -StringToFind password&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; margin: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Times, &amp;quot;Times New Roman&amp;quot;, serif;&quot;&gt;Here is the output based on my home AD domain:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;PS C:\scripts&amp;gt; .\Get-GPOsThatContain.ps1 -StringToFind password&lt;br /&gt;&amp;nbsp;Checking through 9 GPO&#39;s&lt;br /&gt;1 of 9&lt;br /&gt;2 of 9&lt;br /&gt;3 of 9&lt;br /&gt;4 of 9&lt;br /&gt;5 of 9&lt;br /&gt;6 of 9&lt;br /&gt;7 of 9&lt;br /&gt;8 of 9&lt;br /&gt;9 of 9&lt;br /&gt;List of GPO&#39;s that contain password&lt;br /&gt;Default Domain Policy&lt;br /&gt;testdest&lt;br /&gt;TestSource&lt;br /&gt;Windows 7 Screen Lock&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;The script finds all GPOs, evaluates each policy for the string to find (in this case &#39;password&#39;), and lists the policies that have that string.&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;I have found this script very useful when we need to quickly find a GPO entry or when onboarding a new client.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;I hope you have found this helpful.&amp;nbsp; Please let me know if you have any questions.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;Mike&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;calibri&amp;quot;; margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/span&gt;&lt;br /&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Mikey&#39;s PowerShell Blog RSS Feed&lt;/div&gt;</description><link>http://mikeyspowershellblog.blogspot.com/2019/06/finding-items-in-group-policies.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9212075168000095632.post-7051712502750461058</guid><pubDate>Sun, 26 May 2019 17:25:00 +0000</pubDate><atom:updated>2019-05-26T12:25:07.826-05:00</atom:updated><title>Add Entry to Windows Event Logs</title><description>When I have created scripts, that are to used in Production, I put in code that will write events to a specific Event Log so, in the event of a failure, I can use my events as a starting point for resolving the issue.&lt;br /&gt;
&lt;br /&gt;
Writing your own events is relatively easy.&amp;nbsp; As an example, let&#39;s say I have a process&amp;nbsp;that should be running 24x7.&amp;nbsp; The first thing to do is to look for the process:&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;$process = get-process MyProcess -ErrorAction SilentlyContinue&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;The &#39;-ErrorAction SilentlyContinue&#39; is needed because the get-process code would fail if the process isn&#39;t running.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next step is to make the appropriate event log available to add events:&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;New-EventLog -LogName Application -Source &quot;My Process Code&quot;&lt;/span&gt;&lt;br /&gt;
The &#39;Log-Name&#39; parameter needs to have the correct event log.&amp;nbsp; In this example, we want to add the events to the Application log&lt;br /&gt;
The &#39;-Source&#39; parameter is used to give name/label to the event.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At this point, we have the following code for the script:&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;$process = get-process MyProcess -ErrorAction SilentlyContinue&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;New-EventLog - LogName Application -Source &quot;My Process Code&quot;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;Now that we have information about the process, and have the event log ready, we need to evaluate the $process variable. First, let&#39;s check to see if the $process was running:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;if($process) {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-EventLog -LogName Application -Source &quot;My Process Code&quot; -EntryType&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; information&amp;nbsp;-EventID 3000 -Message &quot;My Process is running&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;This line of code states that IF $process is true (because there is information in the variable), then write a event into the Application log, the source is My Process Code, the entry type is Information, give the event ID as 3000, and the message is the process is running.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;Now, what if $process is empty, meaning the process was not running?&amp;nbsp; We add and Else statement to handle this situation:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Else {&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-EventLog -LogName Application -Source &quot;My Process Code&quot; -EntryType Error -EventID 3001 Message &quot;My Process is not running&quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;As you can see, only change we made were the entry type, the event ID, and the message.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;In my scripts, I will add a line, in the Else code, that restarts the process.&amp;nbsp; So, it would look like this:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Else {&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;Write-EventLog -LogName Application -Source &quot;My Process Code&quot; -EntryType Error -EventID 3001 Message &quot;My Process is not running&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Invoke-expression &quot;C:\Applications\MyProcess.exe&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;Here is what the complete script will look like:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;$process = get-process MyProcess -ErrorAction SilentlyContinue&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;New-EventLog - LogName Application -Source &quot;My Process Code&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;if($process) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-EventLog -LogName Application -Source &quot;My Process Code&quot; -EntryType&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; information&amp;nbsp;-EventID 3000 -Message &quot;My Process is running&quot;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Else {&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;Write-EventLog -LogName Application -Source &quot;My Process Code&quot; -EntryType Error -EventID 3001 Message &quot;My Process is not running&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Invoke-expression &quot;C:\Applications\MyProcess.exe&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;I hope you find this article helpful.&amp;nbsp; Please feel free to contact me if you have any questions.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;Mike&lt;/span&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Mikey&#39;s PowerShell Blog RSS Feed&lt;/div&gt;</description><link>http://mikeyspowershellblog.blogspot.com/2019/05/add-entry-to-windows-event-logs.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9212075168000095632.post-6713680980699445864</guid><pubDate>Wed, 22 May 2019 16:03:00 +0000</pubDate><atom:updated>2019-05-22T11:03:05.750-05:00</atom:updated><title>I&#39;m coming back</title><description>Greetings everyone!&lt;br /&gt;
&lt;br /&gt;
After a lengthy hiatus, I will be coming back with some cool scripts I have been using over the last 14 months.&lt;br /&gt;
&lt;br /&gt;
So, stay tuned!&lt;br /&gt;
&lt;br /&gt;
Mike&lt;div class=&quot;blogger-post-footer&quot;&gt;Mikey&#39;s PowerShell Blog RSS Feed&lt;/div&gt;</description><link>http://mikeyspowershellblog.blogspot.com/2019/05/im-coming-back.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9212075168000095632.post-4889798882056122085</guid><pubDate>Sun, 13 May 2018 22:56:00 +0000</pubDate><atom:updated>2018-05-13T17:56:48.630-05:00</atom:updated><title>BREAKING NEWS: Powershell isn&#39;t always the answer</title><description>Greetings!&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
It is hard for me to say that Powershell isn&#39;t the end all, be all for automation.&amp;nbsp; But, at times, the simplest solution is the best.&amp;nbsp; In this case it was stopping and starting custom applications.&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
We have a server that needs to run two custom applications.&amp;nbsp; We will call these App1 and App2.&amp;nbsp; These applications have to be running in the foreground.&amp;nbsp;&amp;nbsp;The first script stopped&amp;nbsp;the applications by using a .bat file that contained the following code:&lt;br /&gt;
TASKKILL /IM&amp;nbsp;App1.exe /F&lt;br /&gt;
TASKKILL /IM&amp;nbsp;App2.exe /F&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
The script to start the applications contained the following code:&lt;br /&gt;
START C:\app1.exe&lt;br /&gt;
START C:\app2.exe&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
We were using Task Scheduler to run the scripts every morning at 4:00am.&amp;nbsp; When the tasks ran, the apps would stop but the apps wouldn&#39;t start in the foreground.&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
At first we thought we could create a Powershell script to get the applications to run in the foreground.&amp;nbsp; Unfortunately, we had the same problem when we created a scheduled task to run the Powershell script.&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
As we were trying to figure out why this was happening, our boss, Amos, came into the room and asked if he could take a look at the scheduled task.&amp;nbsp; After a minute he said, &quot;I found the problem. You have to use &lt;strong&gt;Run only when user is logged on&lt;/strong&gt;.&amp;nbsp; This setting will start the applications in the foreground.&amp;nbsp; Using &lt;strong&gt;Run whether user is logged on or not&lt;/strong&gt; will force the applications to start in the background.&quot;&amp;nbsp; We made the changes and the applications started correctly.&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
So, we learned that it is necessary to know how to use the tools that will run your scripts.&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
I hope you find this useful.&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
Mike&lt;div class=&quot;blogger-post-footer&quot;&gt;Mikey&#39;s PowerShell Blog RSS Feed&lt;/div&gt;</description><link>http://mikeyspowershellblog.blogspot.com/2018/05/breaking-news-powershell-isnt-always.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9212075168000095632.post-5648491037062281297</guid><pubDate>Mon, 30 Apr 2018 13:28:00 +0000</pubDate><atom:updated>2018-04-30T08:28:54.099-05:00</atom:updated><title>Web Site Restart</title><description>Greetings,&lt;br /&gt;
We have had occasion to find a way to restart a web site when we get a notification that the site is unavailable.&amp;nbsp; The restart process includes restarting the associated application pool (app pool) and the site itself.&amp;nbsp; In PowerShell, this task is simple to accomplish.&amp;nbsp; The code is as follows:&lt;br /&gt;
&lt;br /&gt;
 &lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$wstate&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;Get-Website&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-Name&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&#39;Default Web Site&#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$pstate&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;Get-IISAppPool&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-Name&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;DefaultAppPool&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;if&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; (&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$wstate&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;state &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-ne&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&quot;Started&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;Restart-WebAppPool&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-Name&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;DefaultAppPool&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;Start-Website&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-Name&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&#39;Default Web Site&#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;We will use the Default Web Site in this example.&amp;nbsp; The first line (&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$wstate&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;Get-Website&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-Name&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&#39;Default Web Site&#39;&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;), &lt;span style=&quot;color: black;&quot;&gt;gets all the information regarding the default web site, including its state (started, stopped).&amp;nbsp; The second line (&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$pstate&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;Get-IISAppPool&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-Name&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;DefaultAppPool&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; ) gets the information regarding the app pool for the default web site.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;Within the IF statement, if the state of the website ($wstate) is not &#39;Started&#39; then the app pool is restarted (Restart-WebAppPool) and the web site is started (Start-Website).&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;To verify the site has started you can add the following commands to start a browser and browse to the site: &lt;/span&gt;&lt;br /&gt;
 &lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$url&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&#39;http://&amp;lt;your web site&amp;gt;&#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$ie&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;Visible &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$true&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$ie&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;new-object&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-ComObject&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;internetexplorer.application&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$ie&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;Navigate(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$url&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;) &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;I hope this information is helpful.&amp;nbsp; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;Mike&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Mikey&#39;s PowerShell Blog RSS Feed&lt;/div&gt;</description><link>http://mikeyspowershellblog.blogspot.com/2018/04/web-site-restart.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9212075168000095632.post-578450883123469062</guid><pubDate>Mon, 23 Apr 2018 12:17:00 +0000</pubDate><atom:updated>2018-04-23T07:17:17.261-05:00</atom:updated><title>When did these Pings run?</title><description>Greetings.&lt;br /&gt;
&lt;br /&gt;
Took a little break from the blog.&amp;nbsp; I&#39;m back and I have a script I created for my colleague, Tom.&lt;br /&gt;
&lt;br /&gt;
Tom called me and wanted to know if there was a way to get time stamps when pinging a server.&amp;nbsp; To clarify, show a time stamp for each return value from the ping. In addition, the script should run like the Ping -t command and dump the output into a text file.&lt;br /&gt;
&lt;br /&gt;
I researched how to ping within Powershell and found that the Test-Connection cmdlet will do what Tom has requested.&amp;nbsp; I started by creating a variable that will be used by the While loop&lt;br /&gt;
&lt;br /&gt;
$i = 1&lt;br /&gt;
&lt;br /&gt;
Then, we create the While loop&lt;br /&gt;
While ($i = 1){&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
This will run the commands within the loop until $i is something other than 1.&lt;br /&gt;
&lt;br /&gt;
Now, we create the body of the script.&amp;nbsp; We will run the script against Google (&lt;a href=&quot;http://www.google.com/&quot;&gt;www.google.com&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
test-connection &lt;a href=&quot;http://www.google.com/&quot;&gt;www.google.com&lt;/a&gt;&amp;nbsp;| select @{N=&#39;Time&#39;;E={[dateTime}::Now}},@{N=&#39;Destination&#39;;E={$_.address}},replysize,@{N=&#39;Time(ms)&#39;;E={$_.Responsetime}} | export-csv -append c:\ping.txt&lt;br /&gt;
&lt;br /&gt;
In the &#39;select&#39; statement:&lt;br /&gt;
@{N=&#39;Time&#39;;E={[dateTime]::Now}}....This will create a column called &#39;Time&#39; and this column will hold information from the [dateTime]::Now expression&lt;br /&gt;
&lt;br /&gt;
@{N=&#39;Destination&#39;;E={$_.address}}...this will create a column called &#39;Destination&#39; containing the information in the $_.address field&lt;br /&gt;
&lt;br /&gt;
replysize...this is the size of the reply pack in Bytes&lt;br /&gt;
&lt;br /&gt;
@{N=&#39;Time(ms)&#39;;E={$_.ResponseTime}}...this will create a column called &#39;Time(ms)&#39; containing the information in the $_.ResponseTime field&lt;br /&gt;
&lt;br /&gt;
The last part of the statement will send the output to a file called Ping.txt in a comma-separated value (CSV) format&lt;br /&gt;
&lt;br /&gt;
In the end, the script will look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: orangered;&quot;&gt;&lt;span style=&quot;color: orangered;&quot;&gt;&lt;span style=&quot;color: orangered;&quot;&gt;$i&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;color: purple;&quot;&gt;&lt;span style=&quot;color: purple;&quot;&gt;&lt;span style=&quot;color: purple;&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&lt;span style=&quot;color: purple;&quot;&gt;&lt;span style=&quot;color: purple; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt; &lt;span style=&quot;color: darkblue;&quot;&gt;&lt;span style=&quot;color: darkblue;&quot;&gt;&lt;span style=&quot;color: darkblue;&quot;&gt;While&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; (&lt;span style=&quot;color: orangered;&quot;&gt;&lt;span style=&quot;color: orangered;&quot;&gt;&lt;span style=&quot;color: orangered;&quot;&gt;$i&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;color: purple;&quot;&gt;&lt;span style=&quot;color: purple;&quot;&gt;&lt;span style=&quot;color: purple;&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;test-connection&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;color: blueviolet;&quot;&gt;&lt;span style=&quot;color: blueviolet;&quot;&gt;&lt;span style=&quot;color: blueviolet;&quot;&gt;www.google.com&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;|&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;select&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; @{N&lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkred;&quot;&gt;&lt;span style=&quot;color: darkred;&quot;&gt;&lt;span style=&quot;color: darkred;&quot;&gt;&#39;Time&#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;;E&lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;{&lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;&lt;span style=&quot;color: teal;&quot;&gt;&lt;span style=&quot;color: teal;&quot;&gt;dateTime&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;]::&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Now}}&lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;@{N&lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkred;&quot;&gt;&lt;span style=&quot;color: darkred;&quot;&gt;&lt;span style=&quot;color: darkred;&quot;&gt;&#39;Destination&#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;;E&lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;{&lt;span style=&quot;color: orangered;&quot;&gt;&lt;span style=&quot;color: orangered;&quot;&gt;&lt;span style=&quot;color: orangered;&quot;&gt;$_&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;address}}&lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet;&quot;&gt;&lt;span style=&quot;color: blueviolet;&quot;&gt;&lt;span style=&quot;color: blueviolet;&quot;&gt;replysize&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;@{N&lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkred;&quot;&gt;&lt;span style=&quot;color: darkred;&quot;&gt;&lt;span style=&quot;color: darkred;&quot;&gt;&#39;Time(ms)&#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;; E&lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;{&lt;span style=&quot;color: orangered;&quot;&gt;&lt;span style=&quot;color: orangered;&quot;&gt;&lt;span style=&quot;color: orangered;&quot;&gt;$_&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;ResponseTime}} &lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;&lt;span style=&quot;color: darkgrey;&quot;&gt;|&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;export-csv&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;color: navy;&quot;&gt;&lt;span style=&quot;color: navy;&quot;&gt;&lt;span style=&quot;color: navy;&quot;&gt;-append&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; c:\&lt;span style=&quot;color: blueviolet;&quot;&gt;&lt;span style=&quot;color: blueviolet;&quot;&gt;&lt;span style=&quot;color: blueviolet;&quot;&gt;ping.txt&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: darkgreen;&quot;&gt;&lt;span style=&quot;color: darkgreen;&quot;&gt;&lt;span style=&quot;color: darkgreen; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgreen;&quot;&gt;&lt;span style=&quot;color: darkgreen;&quot;&gt;&lt;span style=&quot;color: darkgreen; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: small;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: darkgreen;&quot;&gt;&lt;span style=&quot;color: darkgreen;&quot;&gt;&lt;span style=&quot;color: darkgreen; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: small;&quot;&gt; }&lt;/span&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Some of you may be saying, &quot;There isn&#39;t any code that changes $i to something other than 1.&quot;&amp;nbsp; And you would be correct.&amp;nbsp; This script will run until you manually stop the script, in most cases by using CTRL-C.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The output of the script will look like this:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfjTcTgJ9KH_FzoBSqq48O_wbOImOyRvMiq58esJgF5NVz35XjZKbQE48PYzUwhpRrwklrwtjzYSaorATmMpQS4fbJu-VHg9vZJTVMw5a_0qhIHFRutTbYK0mKo14o4AMhboUiiKOZJDlo/s1600/ping_result.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfjTcTgJ9KH_FzoBSqq48O_wbOImOyRvMiq58esJgF5NVz35XjZKbQE48PYzUwhpRrwklrwtjzYSaorATmMpQS4fbJu-VHg9vZJTVMw5a_0qhIHFRutTbYK0mKo14o4AMhboUiiKOZJDlo/s1600/ping_result.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;103&quot; data-original-width=&quot;439&quot; height=&quot;75&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfjTcTgJ9KH_FzoBSqq48O_wbOImOyRvMiq58esJgF5NVz35XjZKbQE48PYzUwhpRrwklrwtjzYSaorATmMpQS4fbJu-VHg9vZJTVMw5a_0qhIHFRutTbYK0mKo14o4AMhboUiiKOZJDlo/s320/ping_result.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfjTcTgJ9KH_FzoBSqq48O_wbOImOyRvMiq58esJgF5NVz35XjZKbQE48PYzUwhpRrwklrwtjzYSaorATmMpQS4fbJu-VHg9vZJTVMw5a_0qhIHFRutTbYK0mKo14o4AMhboUiiKOZJDlo/s1600/ping_result.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&amp;nbsp;&lt;/a&gt;&lt;br /&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfjTcTgJ9KH_FzoBSqq48O_wbOImOyRvMiq58esJgF5NVz35XjZKbQE48PYzUwhpRrwklrwtjzYSaorATmMpQS4fbJu-VHg9vZJTVMw5a_0qhIHFRutTbYK0mKo14o4AMhboUiiKOZJDlo/s1600/ping_result.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;﻿&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div align=&quot;left&quot; class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
﻿&lt;/div&gt;
&amp;nbsp;I hope you find this script helpful.&amp;nbsp; Be sure to comment if you have any questions.&lt;br /&gt;
&lt;br /&gt;
Mike&lt;div class=&quot;blogger-post-footer&quot;&gt;Mikey&#39;s PowerShell Blog RSS Feed&lt;/div&gt;</description><link>http://mikeyspowershellblog.blogspot.com/2018/04/when-did-these-pings-run.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfjTcTgJ9KH_FzoBSqq48O_wbOImOyRvMiq58esJgF5NVz35XjZKbQE48PYzUwhpRrwklrwtjzYSaorATmMpQS4fbJu-VHg9vZJTVMw5a_0qhIHFRutTbYK0mKo14o4AMhboUiiKOZJDlo/s72-c/ping_result.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9212075168000095632.post-5969593211019608381</guid><pubDate>Mon, 09 Apr 2018 10:37:00 +0000</pubDate><atom:updated>2018-04-09T05:37:53.179-05:00</atom:updated><title>Remoting into Workgroup PCs and a Book Recommendation</title><description>Greetings!&lt;br /&gt;
&lt;br /&gt;
While trying to connect to a workstation on our network I discovered the workstation wasn&#39;t on our AD domain but was configured for WORKGROUP.&amp;nbsp; That got me thinking, &quot;Can I access WORKGROUP machines via Powershell?&quot;.&amp;nbsp; And, by golly, you can.&amp;nbsp; Here&#39;s how:&lt;br /&gt;
&lt;br /&gt;
Prerequisite work (this needs to be done on each PC you want to access):&lt;br /&gt;
Make sure the workstations are within the same IP and subnet mask range&lt;br /&gt;
&lt;br /&gt;
Open your firewall settings&lt;br /&gt;
On the left panel, select &quot;Allow an app or feature through Firewall&quot;&lt;br /&gt;
Click on &quot;Change Settings&quot;.&amp;nbsp; This will give you access to the apps and features in the list.&lt;br /&gt;
Scroll down and select Windows Management Instrumentation (WMI).&lt;br /&gt;
Click on the Private box&lt;br /&gt;
Scroll down and select Windows Remote Management&lt;br /&gt;
Click on the Private box&lt;br /&gt;
Click on OK&lt;br /&gt;
Close the Firewall window&lt;br /&gt;
&lt;br /&gt;
Configuring Powershell:&lt;br /&gt;
Open Powershell with elevated privileges&lt;br /&gt;
At the prompt, type:&lt;br /&gt;
&lt;em&gt;new-itemproperty -path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -name LocalAccountTokenFilterPolicy -propertytype DWord -value 1&lt;/em&gt;&lt;br /&gt;
&amp;nbsp; NOTE: the LocalAccountTokenFilterPolicy setting sets how admin credentials are applied to a &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;remote computer.&amp;nbsp; A value of 1 is what is used to build the evaluated token&lt;br /&gt;
At this point you should be able to create a PSSession to your computer by typing:&lt;br /&gt;
&lt;em&gt;enter-pssession localhost&lt;/em&gt;&lt;br /&gt;
&amp;nbsp;You should see a prompt similar to &lt;em&gt;[localhost]: PS C:\Users.&lt;/em&gt;&lt;br /&gt;
Type &lt;em&gt;exit-pssession&lt;/em&gt;&amp;nbsp; to exit out of the session&lt;br /&gt;
&lt;br /&gt;
If all of the above tasks work on both computers, you should be able to create a session from one computer to another.&amp;nbsp; For example, I have two test workstations, 192.168.100.5 and 192.168.100.6.&amp;nbsp; In order for me to create a session from 100.5 to 100.6, I will do the following:&lt;br /&gt;
On 100.5&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;em&gt;enter-pssession -computername 192.168.100.6 &lt;/em&gt;&lt;br /&gt;
The prompt will look list &lt;em&gt;[192.168.100.6]: PS C:\users &lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
From here I can start and stop services/processes.&amp;nbsp; I can create files and directories.&amp;nbsp; I will be looking for a way to copy files from a session to the host.&lt;br /&gt;
&lt;br /&gt;
Again, to disconnect the session, type &lt;em&gt;exit-possession&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&lt;/em&gt;&lt;br /&gt;
I know this seems like&amp;nbsp;a lot of steps just to allow PSRemoting to WORKGROUP computers.&amp;nbsp; But I know there are still some environments where they have non-domain computers.&amp;nbsp; Why should they be deprived of experiencing Powershell&#39;s greatness?&lt;br /&gt;
&lt;br /&gt;
Now, my book recommendation.&lt;br /&gt;
I don&#39;t do book reviews as well as I should.&amp;nbsp; But, Don Jones&#39; new book, &quot;Be The Master&quot;, is worth reading.&amp;nbsp; The main theme of the book is that we all have something to share/teach others.&amp;nbsp; Mr. Jones uses the analogy of the master and apprentice.&amp;nbsp; The master would share all of their knowledge with the apprentice, sometimes at the cost to the apprentice.&amp;nbsp; This allows for a craft/talent to move on (and sometimes is improved upon) to future generations.&amp;nbsp; What I got out of this book&amp;nbsp;is that there are people out there who want to know things that I know.&amp;nbsp; That is why I post stuff to this blog.&amp;nbsp; I love Powershell and I want to share some of the things I have found.&lt;br /&gt;
&lt;br /&gt;
It&#39;s a quick ready (about 105 pages) and is available via Amazon at $8.&lt;br /&gt;
&lt;br /&gt;
Well that&#39;s what I have for this week.&amp;nbsp; I hope you found both items helpful.&lt;br /&gt;
&lt;br /&gt;
Mike&lt;br /&gt;
&lt;em&gt;&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Mikey&#39;s PowerShell Blog RSS Feed&lt;/div&gt;</description><link>http://mikeyspowershellblog.blogspot.com/2018/04/remoting-into-workgroup-pcs-and-book.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9212075168000095632.post-4744244847936955222</guid><pubDate>Mon, 02 Apr 2018 18:32:00 +0000</pubDate><atom:updated>2018-04-02T13:32:40.037-05:00</atom:updated><title>My Process Stopped Processing</title><description>Greetings,&lt;br /&gt;
Last week I was tasked to&amp;nbsp;create a Powershell script that detects the status of a process running on a Windows 10 computer.&amp;nbsp; If the process wasn&#39;t running, the script had to start the process.&amp;nbsp; If the process is in a &#39;suspended&#39; state, the script had to stop and restart the process.&amp;nbsp; If the process was running, the script display a message.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Detecting the status of the process is relatively simple to do.&amp;nbsp; The first thing you want to do is store the&amp;nbsp;process information&amp;nbsp;in a variable.&amp;nbsp; We will call the variable $process:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: orange;&quot;&gt;$process&lt;/span&gt; = get-process myprocess -ErrorAction SilentlyContinue&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It is necessary to add the -ErrorAction SilentlyContinue in order to get an empty variable if the process is not running.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once we have the status of the process, you will have to check if the process is running.&amp;nbsp; To do that we will using an IF statement:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if (&lt;span style=&quot;color: orange;&quot;&gt;$process&lt;/span&gt;)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; invoke-expression &quot;c:\processes\myprocess.exe&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If there is something in the $process variable, then we will check the status of the running process.&amp;nbsp; If the variable is empty, then we will start the process using invoke-expression (I will explain this later in the article.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So, if &lt;span style=&quot;color: orange;&quot;&gt;$process &lt;span style=&quot;color: black;&quot;&gt;is not empty, the next step is to determine if the process is responding.&amp;nbsp; One of the attributes of &lt;span style=&quot;color: orange;&quot;&gt;$process &lt;span style=&quot;color: black;&quot;&gt;is .Responding.&amp;nbsp; Within the brackets under the IF statement, use the following commands:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($process.Responding)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host &quot;Process is running&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Stop-Process -name myprocess -Force&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;invoke-expression &quot;c:\processes\myprocess.exe&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This code checks the status of $process.Responding.&amp;nbsp; It will either&amp;nbsp;be True or False.&amp;nbsp; If the process is responding, then a message is returned.&amp;nbsp; If the process is not responding, the process is stopped&amp;nbsp;by force, and the process is restarted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The reason for using invoke-expression is because my process has a user interface that must&amp;nbsp;be visible when it is running.&amp;nbsp; I couldn&#39;t use start-process because the interface would not appear.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The entire script will like as follows:&lt;br /&gt;
&lt;span style=&quot;color: orange;&quot;&gt;$process&lt;/span&gt; = get-process myprocess -ErrorAction SilentlyContinue&lt;br /&gt;
if (&lt;span style=&quot;color: orange;&quot;&gt;$process&lt;/span&gt;)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($process.Responding)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host &quot;Process is running&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Stop-Process -name myprocess -Force&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; invoke-expression &quot;c:\processes\myprocess.exe&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; invoke-expression &quot;c:\processes\myprocess.exe&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I hope you find this script helpful.&amp;nbsp; Be sure to add a comment if you have any questions, comments, or corrections.&lt;div class=&quot;blogger-post-footer&quot;&gt;Mikey&#39;s PowerShell Blog RSS Feed&lt;/div&gt;</description><link>http://mikeyspowershellblog.blogspot.com/2018/04/my-process-stopped-processing.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9212075168000095632.post-2024252933785017819</guid><pubDate>Mon, 26 Mar 2018 14:40:00 +0000</pubDate><atom:updated>2018-03-26T09:40:31.379-05:00</atom:updated><title>What are these Execution Policies?  And, how can they help me? </title><description>Greetings!&lt;br /&gt;
&lt;br /&gt;
I have been writing scripts for a while but I haven&#39;t been too concerned about the scripts do since I&#39;m only gathering information and not changing anything.&amp;nbsp; Then, I started creating scripts that create and update Active Directory accounts.&amp;nbsp; I want to make sure that the scripts don&#39;t create havoc within AD or any other part of the server.&amp;nbsp; To do this I looked to Execution Policies.&lt;br /&gt;
&lt;br /&gt;
Execution policies are used to set the rules for Powershell scripts on a server.&amp;nbsp; These policies will help scripts from violating the rules.&amp;nbsp; There are&amp;nbsp;six different policies:&lt;br /&gt;
&lt;br /&gt;
Restricted&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; This policy is the default policy set when Powershell is activated..&amp;nbsp; With Restricted, you cannot run an entire script but can run individual commands.&amp;nbsp; This policy also blocks the execution of module files (.psm1), configuration files (.ps1xml), and profile scripts (.ps1)&lt;br /&gt;
&lt;br /&gt;
AllSigned&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; This policy allows scripts to run on a server.&amp;nbsp; However, all scripts and configuration files need to be signed by a trusted publisher, like Verisign.&amp;nbsp; If you run a script that hasn&#39;t been classified as trusted or untrusted, you will be prompted for credentials.&amp;nbsp; This is more secure but there can be bad scripts written that have been signed.&lt;br /&gt;
&lt;br /&gt;
RemoteSigned&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; This is the default policy in Windows Server 2012 R2.&amp;nbsp; If you download a script from the Internet, you will need a digital signature from a trusted source.&amp;nbsp; The benefit of RemoteSigned is that scripts created on local computers do not need a digital signature.&amp;nbsp; Similar to AllSigned, dangerous scripts can still be signed.&lt;br /&gt;
&lt;br /&gt;
Unrestricted&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Unsigned scripts can run (this can be dangerous).&amp;nbsp; You will be warned when you start an unsigned script from the Internet.&lt;br /&gt;
&lt;br /&gt;
Bypass&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; This policy lets any script run and there are no warnings or prompts.&amp;nbsp; Bypass is helpful if you are calling a script from a command line or from out of Task Scheduler.&amp;nbsp; Do not use bypass when you are running an unverified script.&amp;nbsp; Bad things can happen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Personally, I try to never use Unrestructed, Unrestructed, or Bypass.&amp;nbsp; However, you may find a need to use one of these settings.&amp;nbsp; Just make sure you know risks of each one.&lt;div class=&quot;blogger-post-footer&quot;&gt;Mikey&#39;s PowerShell Blog RSS Feed&lt;/div&gt;</description><link>http://mikeyspowershellblog.blogspot.com/2018/03/what-are-these-execution-policies-and.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9212075168000095632.post-6885229478960175222</guid><pubDate>Mon, 19 Mar 2018 15:32:00 +0000</pubDate><atom:updated>2018-03-19T10:32:05.471-05:00</atom:updated><title>&quot;Can you see if my account is locked out?&quot;</title><description>Greetings!&lt;br /&gt;
&lt;br /&gt;
Have you ever gotten a call or email or trouble ticket asking for help with a user whose AD account keeps getting locked out?&amp;nbsp; At my current company, we had a rash of this happening.&amp;nbsp; We found this occurred when people changed their Active Directory password.&amp;nbsp; In these days of people being able to access work email or work Instant Messaging, it is important to make sure these folks are changing the passwords on their personal devices.&lt;br /&gt;
&lt;br /&gt;
In some cases, we can look to the domain controllers to find out where the lock is occurring.&amp;nbsp; I found this handy script from Mike F Robbins blog site (&lt;a href=&quot;http://mikefrobbins.com/&quot;&gt;http://mikefrobbins.com/&lt;/a&gt;):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: darkgreen; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgreen; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgreen; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;#Requires -Version 3.0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: darkgreen; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;color: darkgreen; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;color: darkgreen; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;
&lt;br /&gt;
&amp;lt;#&lt;br /&gt;

&lt;br /&gt;
.SYNOPSIS&lt;br /&gt;

&lt;br /&gt;
    Get-LockedOutUser.ps1 returns a list of users who were locked out in Active Directory.&lt;br /&gt;

&lt;br /&gt;
.DESCRIPTION&lt;br /&gt;

&lt;br /&gt;
    Get-LockedOutUser.ps1 is an advanced script that returns a list of users who were locked out in Active Directory&lt;br /&gt;

&lt;br /&gt;
by querying the event logs on the PDC emulator in the domain.&lt;br /&gt;

&lt;br /&gt;
.PARAMETER UserName&lt;br /&gt;

&lt;br /&gt;
    The userid of the specific user you are looking for lockouts for. The default is all locked out users.&lt;br /&gt;

&lt;br /&gt;
.PARAMETER StartTime&lt;br /&gt;

&lt;br /&gt;
    The datetime to start searching from. The default is all datetimes that exist in the event logs.&lt;br /&gt;

&lt;br /&gt;
.EXAMPLE&lt;br /&gt;

&lt;br /&gt;
    Get-LockedOutUser.ps1&lt;br /&gt;

&lt;br /&gt;
.EXAMPLE&lt;br /&gt;

&lt;br /&gt;
    Get-LockedOutUser.ps1 -UserName &#39;mikefrobbins&#39;&lt;br /&gt;

&lt;br /&gt;
.EXAMPLE&lt;br /&gt;

&lt;br /&gt;
    Get-LockedOutUser.ps1 -StartTime (Get-Date).AddDays(-1)&lt;br /&gt;

&lt;br /&gt;
.EXAMPLE&lt;br /&gt;

&lt;br /&gt;
    Get-LockedOutUser.ps1 -UserName &#39;mikefrobbins&#39; -StartTime (Get-Date).AddDays(-1)&lt;br /&gt;

&lt;br /&gt;
#&amp;gt;&lt;br /&gt;

&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: deepskyblue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: deepskyblue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: deepskyblue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;CmdletBinding&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkblue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: darkblue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;param&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; (&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: deepskyblue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: deepskyblue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: deepskyblue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;ValidateNotNullOrEmpty&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;$DomainName&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;$env:USERDOMAIN&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: deepskyblue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: deepskyblue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: deepskyblue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;ValidateNotNullOrEmpty&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;$UserName&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&quot;*&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: deepskyblue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: deepskyblue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: deepskyblue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;ValidateNotNullOrEmpty&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;datetime&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;$StartTime&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; (&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;Get-Date&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;AddDays(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: purple; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: purple; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: purple; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;-3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;
&lt;br /&gt;
)&lt;br /&gt;

&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;Invoke-Command&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;-ComputerName&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; (&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;System.DirectoryServices.ActiveDirectory.Domain&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;]::&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;GetDomain((&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;New-Object&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;System.DirectoryServices.ActiveDirectory.DirectoryContext&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&#39;Domain&#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;$DomainName&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;    )&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;PdcRoleOwner&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;name&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;
&lt;br /&gt;
) {&lt;br /&gt;

&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;Get-WinEvent&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;-FilterHashtable&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; @{LogName&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&#39;Security&#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;;Id&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: purple; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: purple; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: purple; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;4740&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;;StartTime&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;$Using:StartTime&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;} &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;|&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;Where-Object&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;$_&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;Properties&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: purple; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: purple; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: purple; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;].&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;Value &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;-like&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;$Using:UserName&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;} &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;|&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;Select-Object&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;-Property&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;TimeCreated&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;        @{Label&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&#39;UserName&#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;;Expression&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;$_&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;Properties&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: purple; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: purple; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: purple; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;].&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;Value}}&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;        @{Label&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&#39;ClientName&#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;;Expression&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;$_&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;Properties&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: purple; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: purple; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: purple; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;].&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;Value}}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;} &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;-Credential&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; (&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;Get-Credential&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;) &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;|&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;Select-Object&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;-Property&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;TimeCreated&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;UserName&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;ClientName &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: inherit;&quot;&gt;When you run this script, you will be prompted for a user name and password.&amp;nbsp; This user name must have access to the domain controllers.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt; &lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;.\Get-LockedOutUser.ps1 -UserName &#39;mike1&#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: inherit;&quot;&gt;Not only does this script look for individual accounts using the -UserName attribute but you can leave off all the parameters and you will get a list of all the accounts, on the domain, that are currently locked out.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;.\Get-LockedOutUser.ps1&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
I want to thank Mike F Robbins for writing a terrific script that has helped me many time.&amp;nbsp; I hope it can help you all, as well.&lt;br /&gt;
&lt;br /&gt;
Mike&lt;br /&gt;
&lt;br /&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Mikey&#39;s PowerShell Blog RSS Feed&lt;/div&gt;</description><link>http://mikeyspowershellblog.blogspot.com/2018/03/can-you-see-if-my-account-is-locked-out.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9212075168000095632.post-6157155284364846034</guid><pubDate>Mon, 12 Mar 2018 10:58:00 +0000</pubDate><atom:updated>2018-03-12T05:58:55.477-05:00</atom:updated><title>What Version of Windows Server Am I Using?</title><description>Greetings!&lt;br /&gt;
&lt;br /&gt;
I have had occasions where I wanted to inventory all my servers and what version of Windows Server is running on those servers.&amp;nbsp; Larger companies can use System Center Operations Manager (SCOM) to get that information.&amp;nbsp; However System Center can be expensive and overkill for small to medium businesses.&lt;br /&gt;
&lt;br /&gt;
In order to get the list I wanted, I used the following PowerShell script:&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;Import-Module&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;ActiveDirectory &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;Get-ADComputer&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;-Filter&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;*&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;-Properties&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;OperatingSystem&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;OperatingSystemServicePack&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;OperatingSystemVersion&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;|&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;Where-Object&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;$_&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;OperatingSystem &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;-like&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&#39;*server*&#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;} &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;|&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;Select-Object&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;-Property&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;Name&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;OperatingSystem&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;OperatingSystemServicePack&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;OperatingSystemVersion&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;br /&gt;
 &lt;/span&gt;&lt;/span&gt;It is important to include the Import-Module command.&amp;nbsp; If&amp;nbsp;the command is missing the Get-ADComputer command will not work and you will get an error.&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
The output from the script will look like the following:&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt; &lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            OperatingSystem&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                   OperatingSystemServicePack&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OperatingSystemVersion&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;-----&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ---------------&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                   --------------------------&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;Server1&amp;nbsp;&amp;nbsp; Windows Server 2008 R2 Enterprise&amp;nbsp;&amp;nbsp; Service Pack 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;             6.1 (7601)            &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;Server2&amp;nbsp;&amp;nbsp; Windows Server 2008 R2 Enterprise&amp;nbsp;&amp;nbsp; Service Pack 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;             6.1 (7601)            &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;Server3&amp;nbsp;&amp;nbsp; Windows Server 2008 R2 Enterprise&amp;nbsp;&amp;nbsp; Service Pack 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;             6.1 (7601)&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;lucida console&amp;quot;; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
This script displays the ease of using Powershell.&amp;nbsp; By using just a couple commands, you can pull the information you want.&lt;br /&gt;
&lt;br /&gt;
I hope you find this script helpful.&amp;nbsp; Good luck and happy scripting.&lt;br /&gt;
&lt;br /&gt;
Mike&lt;div class=&quot;blogger-post-footer&quot;&gt;Mikey&#39;s PowerShell Blog RSS Feed&lt;/div&gt;</description><link>http://mikeyspowershellblog.blogspot.com/2018/03/what-version-of-windows-server-am-i.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9212075168000095632.post-7783399330908394195</guid><pubDate>Mon, 05 Mar 2018 12:28:00 +0000</pubDate><atom:updated>2018-03-05T06:28:22.751-06:00</atom:updated><title>Powershell Notes For Professionals</title><description>Greetings!&lt;br /&gt;
&lt;br /&gt;
As a person who really enjoys scripting in Powershell, I am always looking for resources that focus on Powershell.&amp;nbsp; The other day I got an email from &lt;a href=&quot;http://goalkicker.com/&quot;&gt;GoalKicker.com&lt;/a&gt;&amp;nbsp;offering a free document called &quot;PowerShell Notes for Professionals.&quot;&amp;nbsp; This is a great reference that contains explanation and examples on everything from getting started with Powershell to how to use hashtables to signing scripts...and much more.&lt;br /&gt;
&lt;br /&gt;
Also, GoalKicker has many such documents on different programming languages.&amp;nbsp; Like I said this is a tremendous resources for the scripter/programmer.&amp;nbsp; I highly recommend them.&lt;br /&gt;
&lt;br /&gt;
That&#39;s what I have for this week.&amp;nbsp; Have fun!&lt;br /&gt;
&lt;br /&gt;
Mike&lt;div class=&quot;blogger-post-footer&quot;&gt;Mikey&#39;s PowerShell Blog RSS Feed&lt;/div&gt;</description><link>http://mikeyspowershellblog.blogspot.com/2018/03/powershell-notes-for-professionals.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9212075168000095632.post-2282427027002548804</guid><pubDate>Mon, 19 Feb 2018 13:01:00 +0000</pubDate><atom:updated>2018-02-19T07:01:38.300-06:00</atom:updated><title>Why Isn&#39;t This Cmdlet Working?</title><description>Last week I was working on a script that creates a list of scheduled tasks on all of our remote servers.&amp;nbsp; I wanted the script to create the list using Export-CSV.&amp;nbsp; However, everything I ran the script I would get the error:&lt;br /&gt;
The term &#39;Export-CSV&#39; is not recognized&amp;nbsp;as the&amp;nbsp;name of a cmdlet&lt;br /&gt;
&lt;br /&gt;
Export-CSV is not recognized!?&amp;nbsp; I have been using this for years!&lt;br /&gt;
&lt;br /&gt;
I did some research and found out that some minor versions of Powershell Version 2 did not include Export-CSV.&amp;nbsp; In order to correct this it was necessary to update the version of Powershell.&lt;br /&gt;
&lt;br /&gt;
How can you check the version of Powershell?&amp;nbsp; Use the following script to get the Powershell versions on all your servers:&lt;br /&gt;
 &lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$adServers&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; $()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;

&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$adServers&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;+=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;get-adcomputer&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-Filter&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;*&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-Properties&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;*&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-SearchBase&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&quot;OU=Servers,DC=abc,DC=com&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;|&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;Select-Object&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;Name&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;foreach&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; (&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$server&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;in&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$adServers&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;Invoke-Command&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-ComputerName&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$server&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;Name &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-ScriptBlock&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; { &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$PSVersionTable&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;PSVersion } &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;|&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;export-csv&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-append&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;C:\PSVersionsbyServer.csv&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;} &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;/span&gt;&lt;/span&gt;Updating Powershell is very simple but will require a reboot.&amp;nbsp; Go &lt;a href=&quot;https://docs.microsoft.com/en-us/powershell/wmf/5.1/install-configure&quot;&gt;here&lt;/a&gt; to get the Powershell update.&amp;nbsp; This is version 5 and called WMF 5.&amp;nbsp; Be sure to following the prerequisites.&lt;br /&gt;
&lt;br /&gt;
Again, the update will require a reboot.&lt;br /&gt;
&lt;br /&gt;
Having to update the one server, so Export-CSV will work, brought up the need for my company to make sure all of our servers are running a consistent version of Powershell.&amp;nbsp; If you have a lot of servers to update, make sure you have a solid plan and communicate the changes to your user base.&lt;br /&gt;
&lt;br /&gt;
I hope this information was helpful.&amp;nbsp; Good luck.&lt;div class=&quot;blogger-post-footer&quot;&gt;Mikey&#39;s PowerShell Blog RSS Feed&lt;/div&gt;</description><link>http://mikeyspowershellblog.blogspot.com/2018/02/why-isnt-this-cmdlet-working.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9212075168000095632.post-8725670925623675212</guid><pubDate>Wed, 14 Feb 2018 19:22:00 +0000</pubDate><atom:updated>2018-02-14T13:22:35.442-06:00</atom:updated><title>Script To Get Version of Powershell</title><description>Hello again!&lt;br /&gt;
&lt;br /&gt;
I have time today to add another post on this blog.&amp;nbsp; This script is what I use to get a list of all servers and what version of Powershell is installed on the server.&lt;br /&gt;
&lt;br /&gt;
We are using this script to determine which servers will need to be updated to version 5:&lt;br /&gt;
&lt;br /&gt;
 &lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$adServers&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; $()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;

&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$adServers&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;+=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;get-adcomputer&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-Filter&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;*&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-Properties&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;*&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-SearchBase&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&quot;OU=ou1,DC=abc,DC=com&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;|&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;Select-Object&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;Name&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$adServers&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;+=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;get-adcomputer&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-Filter&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;*&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-Properties&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;*&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-SearchBase&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&quot;OU=ou2,DC=abc,DC=com&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;|&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;Select-Object&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;Name&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;foreach&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; (&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$server&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;in&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$adServers&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;Invoke-Command&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-ComputerName&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$server&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;Name &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-ScriptBlock&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; { &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$PSVersionTable&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;PSVersion } &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;|&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;export-csv&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-append&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;C:\PSVersionsbyServer.csv&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;As in other posts, I defined a variable called $adServers to hold the names of servers.&amp;nbsp; There are two OUs that contain server information.&amp;nbsp; That is why I have two get-adcomputer statements.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;In the FOREACH loop, I used&amp;nbsp;Invoke-Command to query each server for the Powershell version.&amp;nbsp; I like using Invoke-Command because is saves from having to do a lot of extra coding such as creating and entering PSSessions.&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Mikey&#39;s PowerShell Blog RSS Feed&lt;/div&gt;</description><link>http://mikeyspowershellblog.blogspot.com/2018/02/script-to-get-version-of-powershell.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9212075168000095632.post-301623160492172091</guid><pubDate>Wed, 14 Feb 2018 13:37:00 +0000</pubDate><atom:updated>2018-02-14T07:37:43.712-06:00</atom:updated><title>Exporting variables to Export-CSV</title><description>Greetings!&lt;br /&gt;
&lt;br /&gt;
I was asked to create a data feed (a text file) that contained the following information from Active Directory:&lt;br /&gt;
Employee Number&lt;br /&gt;
Employee Email Address&lt;br /&gt;
The last part of the employee&#39;s ObjectSID&lt;br /&gt;
Employee Login&lt;br /&gt;
&lt;br /&gt;
Getting the information was relatively simple.&amp;nbsp; Since the information was in three different Organizational Units (OUs), I had to run 3 separate Get-ADUser statements, as follows:&lt;br /&gt;
&lt;br /&gt;
 &lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$ouUsers&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; $()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;

&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$ouUsers&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;+=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;get-aduser&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-Filter&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; { &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;objectClass&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-eq&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&quot;user&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;} &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-Properties&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;*&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-SearchBase&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&#39;ou=ou1,dc=abc,dc=com&#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;|&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;Where-object&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$_&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;Enabled &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-eq&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&quot;True&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-AND&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$_&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;employeeid &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-ne&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; } &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;|&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;Select-Object&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;employeeid&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;samAccountName&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;objectSID&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;EmailAddress&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgreen; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgreen; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgreen; font-family: Lucida Console; font-size: xx-small;&quot;&gt;#| export-csv -NoTypeInformation rwsc_info.csv&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: darkgreen; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgreen; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgreen; font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$ouUsers&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;+=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;get-aduser&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-Filter&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; { &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;objectClass&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-eq&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&quot;user&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;} &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-Properties&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;*&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-SearchBase&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&#39;ou=ou2,dc=abc,dc=com&#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;|&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;Where-object&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$_&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;Enabled &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-eq&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&quot;True&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-AND&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$_&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;employeeid &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-ne&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; } &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;|&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;Select-Object&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;employeeid&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;samAccountName&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;objectSID&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;EmailAddress&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgreen; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgreen; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgreen; font-family: Lucida Console; font-size: xx-small;&quot;&gt;#| export-csv -NoTypeInformation rwsc_info.csv&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: darkgreen; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgreen; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgreen; font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$ouUsers&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;+=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;get-aduser&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-Filter&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; { &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;objectClass&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-eq&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&quot;user&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;} &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-Properties&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;*&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-SearchBase&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&#39;ou=ou3,dc=abc,dc=com&#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;|&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;Where-object&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$_&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;Enabled &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-eq&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&quot;True&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-AND&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$_&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;employeeid &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-ne&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; } &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;|&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;Select-Object&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;employeeid,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;samAccountName&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;objectSID&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;EmailAddress&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgreen; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgreen; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgreen; font-family: Lucida Console; font-size: xx-small;&quot;&gt;#| export-csv -NoTypeInformation rwsc_info.csv&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: darkgreen; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgreen; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgreen; font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;Note: be sure to have the $ouUsers = $() statement or the variable will continue to grow since the&amp;nbsp; script uses += for each get-aduser statement.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;Once I had all the information in the $ouUsers variable I create a FOREACH loop:&lt;/span&gt;&lt;br /&gt;
 &lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;foreach&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$ouUser&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;in&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$ouUsers&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;) &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;It is within this loop I did two things:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;1. Collect the last section of the ObjectSID&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Since the ObjectSID is separated into 8 parts (separated by a &#39;-&#39;) I used the following code:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $sid = $ouUser.objectSID # This puts the information into a separate variable&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $empSID = $sid.Value.Split(&#39;-&#39;,8)[7] # the &#39;-&#39; is the separator.&amp;nbsp; &#39;8&#39; tells how many array items.&amp;nbsp;&amp;nbsp;# &#39;[7]&#39; is the last item in the array (array items start at [0])&lt;/span&gt;&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;2. Export the information to the CSV file&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; This was the section that took me the longest to figure out.&amp;nbsp; I though all I had to do was gather all &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; the information into another variable and then export the data to a file (i.e., $data | Export-CSV&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; c:\documents\datafile.csv).&amp;nbsp; This did not work.&amp;nbsp; All I got was the length of each variable.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp; I did some research and found the following solution:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Lucida Console; font-size: xx-small;&quot;&gt;pscustomobject&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;@{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;       &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EMPLOYEEID &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$ouUser&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;employeeid&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;       &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EMAILADDRESS &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$ouUser&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;EmailAddress&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;       &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SINGLESIGNON &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$empSID&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;       &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NETWORKLOGON &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$ouUser&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;samAccountName&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;|&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;export-csv&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-append&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-NoTypeInformation&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;datafile.csv &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: inherit;&quot;&gt;The full FOREACH loop is as follows:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$ouUser&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkblue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;in&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$ouUsers&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;

&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $sid&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$ouUser&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;objectSID&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $empSID&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$sid&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;Value&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;split(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkred; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&#39;-&#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: purple; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: purple; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: purple; font-family: Lucida Console; font-size: xx-small;&quot;&gt;8&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: purple; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: purple; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: purple; font-family: Lucida Console; font-size: xx-small;&quot;&gt;7&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: Lucida Console; font-size: xx-small;&quot;&gt;pscustomobject&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;@{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;       &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EMPLOYEEID &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$ouUser&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;employeeid&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;       &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EMAILADDRESS &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$ouUser&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;EmailAddress&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;       &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SINGLESIGNON &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$empSID&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;       &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NETWORKLOGON &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: orangered; font-family: Lucida Console; font-size: xx-small;&quot;&gt;$ouUser&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;samAccountName&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: darkgrey; font-family: Lucida Console; font-size: xx-small;&quot;&gt;|&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Lucida Console; font-size: xx-small;&quot;&gt;export-csv&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-append&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Lucida Console; font-size: xx-small;&quot;&gt;-NoTypeInformation&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt; datafile&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: blueviolet; font-family: Lucida Console; font-size: xx-small;&quot;&gt;.csv&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Lucida Console; font-size: xx-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
As I said, getting the data to a CSV file took me a few hours to figure out.&amp;nbsp; I was able to find the solution on the StackOverflow web site (&lt;a href=&quot;http://stackoverflow.com/&quot;&gt;http://stackoverflow.com&lt;/a&gt;).&lt;br /&gt;
&lt;br /&gt;
Let me know if you have any questions regarding this script.&lt;br /&gt;
&lt;br /&gt;
See you soon,&lt;br /&gt;
Mike&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Mikey&#39;s PowerShell Blog RSS Feed&lt;/div&gt;</description><link>http://mikeyspowershellblog.blogspot.com/2018/02/exporting-variables-to-export-csv.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9212075168000095632.post-2727321596884123472</guid><pubDate>Fri, 20 Oct 2017 12:02:00 +0000</pubDate><atom:updated>2017-10-20T07:02:30.037-05:00</atom:updated><title>Powershell Scripting Environments, Part I</title><description>

&lt;br /&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
Earlier this year, I
said I would give some information regarding some of the many scripting tools
you can use for creating Powershell scripts.&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;
&lt;/span&gt;Here are just a couple of those tools that I currently use or have used
in order to create my scripts:&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;br /&gt;
&lt;ol style=&quot;direction: ltr; font-family: Calibri; font-size: 11pt; font-style: normal; font-weight: normal; margin-bottom: 0in; margin-left: 0.375in; margin-top: 0in; unicode-bidi: embed;&quot; type=&quot;1&quot;&gt;
 &lt;/ol&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-top: 0px; vertical-align: middle;&quot;&gt;
&lt;span style=&quot;font-family: Calibri; font-size: 11pt; font-style: normal; font-weight: normal;&quot;&gt;1. PS Shell&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;This
is equivalent to the Command Prompt.&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;
&lt;/span&gt;When the shell is started, you will see PS C:\&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in 0in 0in 0.75in;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in 0in 0in 0.75in;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipK5YAhtjyK6NQaXPM6Uaf0NODaoFEb4IL5AF7ugsPXxClMl-6F-M9LYNl0tu93-_pgjORUYhRvshoqxB7YpkLndX6Qb5JjpwdWKBcjF6wFioQ54IIcPV8KlAMZbs0r4NIPYoP-kC7g44U/s1600/1st_shell_pic.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;236&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipK5YAhtjyK6NQaXPM6Uaf0NODaoFEb4IL5AF7ugsPXxClMl-6F-M9LYNl0tu93-_pgjORUYhRvshoqxB7YpkLndX6Qb5JjpwdWKBcjF6wFioQ54IIcPV8KlAMZbs0r4NIPYoP-kC7g44U/s320/1st_shell_pic.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
﻿&lt;/div&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 

&lt;br /&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
&amp;nbsp;&amp;nbsp;You can initialize
variables within the shell.&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;Let&#39;s set
the variable $messsage to &#39;This is a test&#39;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div align=&quot;center&quot; style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
﻿&lt;/div&gt;
&lt;div align=&quot;center&quot; style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
﻿&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRgTuUv14ldaUmfhOy3X8h8HxL0z7tkTQuvZfL2dG-eFSLmeb-H3jXqonEjp3XM1XcHuHqV3HjTqI0b0VRavQPglQq5SAD_CxpQGB2AKEb75h0dyLGK1FcXNGU7UDH08MbORocJvrzoHra/s1600/shell_with_script.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;236&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRgTuUv14ldaUmfhOy3X8h8HxL0z7tkTQuvZfL2dG-eFSLmeb-H3jXqonEjp3XM1XcHuHqV3HjTqI0b0VRavQPglQq5SAD_CxpQGB2AKEb75h0dyLGK1FcXNGU7UDH08MbORocJvrzoHra/s320/shell_with_script.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
We can see what is
in the variable by running $message&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
﻿&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmCfHtHldc5APaflf3i41xsQveZhCsK1v4uwQpC4xsFLRbgm6JXeSL89CTiXwJ8szDSt12Vu8cF_6VqQkr-oNGeu9ws52-gREF9ZkMUEfHW1q08aLDDUjAtBSHYJ1X-2D8lU8SjQcVpwlf/s1600/shell_with_script_output.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;236&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmCfHtHldc5APaflf3i41xsQveZhCsK1v4uwQpC4xsFLRbgm6JXeSL89CTiXwJ8szDSt12Vu8cF_6VqQkr-oNGeu9ws52-gREF9ZkMUEfHW1q08aLDDUjAtBSHYJ1X-2D8lU8SjQcVpwlf/s320/shell_with_script_output.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;The
variable and contents are keep in memory and can be used with further cmdlets.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; margin: 0in 0in 0in 0.75in; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;

The
drawback, for me, is that making changes involves either typing in a command
again, or using the arrow keys to bring back a command you ran.&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;It may not be a problem if there are only a
couple of lines to the script.&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;But, if
you want to create a script with a lot of code, you going to want to use an
integrated scripting tool.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: x-small;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: x-small;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;span style=&quot;font-family: Arial; font-size: x-small;&quot;&gt;&lt;div style=&quot;clear: both; text-align: left;&quot;&gt;
2. I&lt;span style=&quot;font-family: Calibri; font-size: 11pt; font-style: normal; font-weight: normal;&quot;&gt;ntegrated Scripting
     Environment (ISE)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
The ISE is provided
by the Windows OS.&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;You can start the ISE
by typing ISE in the Powershell shell&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO6AQADEIvtcZBZXJ0CXGf3ijppwpanI-FOD9nktk7o9bRwH2nyFQyB-lE5-TmMTaDkralwLNnAxNrY7sn8LgrWNrp7OZK-8NZDVe3zQl4RY7Z-bb2zWCJd1tpWjjI4Gabd7xH_treRAUx/s1600/2017-10-16_6-34-17.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;236&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO6AQADEIvtcZBZXJ0CXGf3ijppwpanI-FOD9nktk7o9bRwH2nyFQyB-lE5-TmMTaDkralwLNnAxNrY7sn8LgrWNrp7OZK-8NZDVe3zQl4RY7Z-bb2zWCJd1tpWjjI4Gabd7xH_treRAUx/s320/2017-10-16_6-34-17.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;

&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
The ISE will appear&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;

&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzMG0DkboTppOwsRIaH3ttDbIlKhFQovbDSjKRxKNDMujjAk8sIXob5NFtj8JfEv-NMVhtOPUw1__th5OVDJ2jNSjmrBfJEwAORgI4WwD5ZtrDshhC4baS1-wXAr23NNAvBPSgM4KB4Yeo/s1600/2017-10-16_6-35-22.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;173&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzMG0DkboTppOwsRIaH3ttDbIlKhFQovbDSjKRxKNDMujjAk8sIXob5NFtj8JfEv-NMVhtOPUw1__th5OVDJ2jNSjmrBfJEwAORgI4WwD5ZtrDshhC4baS1-wXAr23NNAvBPSgM4KB4Yeo/s320/2017-10-16_6-35-22.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;

&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
This environment
allows you to create and run a script in the right panel.&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;When you run the script the output will
appear in the left panel.&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;

&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVPRHrtfDCae19S0QXeSncCDYBZsLdnNnusf0pzpV6ARLEErk-saaUY_DFpmKo7MY5uVZqvD6RDK-8CEJyJeSzQDL2GrikvMqvMBs6JN7hDvxCaxOmPS1F4j32kev1VtuREFldfA_oGFvT/s1600/2017-10-16_6-57-46.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;188&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVPRHrtfDCae19S0QXeSncCDYBZsLdnNnusf0pzpV6ARLEErk-saaUY_DFpmKo7MY5uVZqvD6RDK-8CEJyJeSzQDL2GrikvMqvMBs6JN7hDvxCaxOmPS1F4j32kev1VtuREFldfA_oGFvT/s320/2017-10-16_6-57-46.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;

&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
Here are a couple of
tool bar items you should know how to use:&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;

&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmMf47dqi6gk3kUG3LkfYr73pGdZeiRgO68ivTxb80dGi5zxh7TdIgZ54VnL1rgeD1G_IdQ0Iw2GQvXt3lBb6BOt9SC64tsGGe_YAEMzSsBSx3a2db0_ztLXJ-j6Kd4ubnVxDpas6rJXcQ/s1600/2017-10-16_6-42-56.jpg&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmMf47dqi6gk3kUG3LkfYr73pGdZeiRgO68ivTxb80dGi5zxh7TdIgZ54VnL1rgeD1G_IdQ0Iw2GQvXt3lBb6BOt9SC64tsGGe_YAEMzSsBSx3a2db0_ztLXJ-j6Kd4ubnVxDpas6rJXcQ/s400/2017-10-16_6-42-56.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;Click this if you want to run the entire
script.&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;The keyboard equivolent is F5&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;

&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-WyEjTnhFTG5cqmNrWG9d3WcfmR3qw9M1IpqGcxKiN9d4vgwDwF-d6R5DUHmQvv1vsPq5_bv-X-zXzgym9I42DmcTvejZkFFx-38QRfs8WFav7reyV09vleN-BuvwjtvUREc1N8oxtEUf/s1600/2017-10-16_6-44-24.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-WyEjTnhFTG5cqmNrWG9d3WcfmR3qw9M1IpqGcxKiN9d4vgwDwF-d6R5DUHmQvv1vsPq5_bv-X-zXzgym9I42DmcTvejZkFFx-38QRfs8WFav7reyV09vleN-BuvwjtvUREc1N8oxtEUf/s400/2017-10-16_6-44-24.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;

&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
This allows you to
run a specific line or group of lines in the script.&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;For example&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSy19kDF4s6A61IkSLm5Hp9Ppoqu8JhEZaGk3Mo4jL4L3V_lqhZ2ot-rgKmfHLpaLdzGIjSTRAmi3ccBa3vjPHE826EWHzYyEntk9pb46_xVMDxAEmGFG9G3Mk7ZkxOwc87njxOm50kdxQ/s1600/ISE_with_Script.jpg&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;187&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSy19kDF4s6A61IkSLm5Hp9Ppoqu8JhEZaGk3Mo4jL4L3V_lqhZ2ot-rgKmfHLpaLdzGIjSTRAmi3ccBa3vjPHE826EWHzYyEntk9pb46_xVMDxAEmGFG9G3Mk7ZkxOwc87njxOm50kdxQ/s320/ISE_with_Script.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;

&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
By clicking on the &lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEkn8IBPqEXjyyTE6wYzrQ8VeeupXrzv0CITYi3xwJj30vn3wYhmYwZJXEowShXoPzyYhCTyanXwDyB1G2E5tJ_tbChrNDo0sbunK3UioH-PFG6ncendk1hCvzTjIYNH5Re0Bnnt3WY9cg/s1600/2017-10-16_6-44-24.jpg&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEkn8IBPqEXjyyTE6wYzrQ8VeeupXrzv0CITYi3xwJj30vn3wYhmYwZJXEowShXoPzyYhCTyanXwDyB1G2E5tJ_tbChrNDo0sbunK3UioH-PFG6ncendk1hCvzTjIYNH5Re0Bnnt3WY9cg/s400/2017-10-16_6-44-24.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
You will only run
the $users line of the code.&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;You can
then check what is in the $users variable by typing $users in the left panel.&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRURplbmsWBIjhileqHDvALXc42UH5R0EwtbVe2NSbR4lXTusotlc7mq99v10zEjBrkUGLbK9E9A62juMgTyjT8W4lN6Owpq4LBNmy_jRNIgn-WOysd4Lj9FKwSNmzwOXccHR0KG1WQgKI/s1600/2017-10-16_6-58-40.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRURplbmsWBIjhileqHDvALXc42UH5R0EwtbVe2NSbR4lXTusotlc7mq99v10zEjBrkUGLbK9E9A62juMgTyjT8W4lN6Owpq4LBNmy_jRNIgn-WOysd4Lj9FKwSNmzwOXccHR0KG1WQgKI/s400/2017-10-16_6-58-40.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
This is equivolent
to CLS, it clears the output panel.&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;

&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;

&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
I like using the ISE
because a) it comes with Windows, and b) it allows you to create, update, and
run individual lines of a script.&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;

&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;

&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
I hope you find this
information helpful.&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;Next week, I will
show you some popular free or pay tools that add some additional functionality
to the scripting environment.&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;

&lt;/div&gt;
&lt;/span&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;

﻿&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
﻿&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;Mikey&#39;s PowerShell Blog RSS Feed&lt;/div&gt;</description><link>http://mikeyspowershellblog.blogspot.com/2017/10/powershell-scripting-environments-part-i.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipK5YAhtjyK6NQaXPM6Uaf0NODaoFEb4IL5AF7ugsPXxClMl-6F-M9LYNl0tu93-_pgjORUYhRvshoqxB7YpkLndX6Qb5JjpwdWKBcjF6wFioQ54IIcPV8KlAMZbs0r4NIPYoP-kC7g44U/s72-c/1st_shell_pic.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-9212075168000095632.post-2664558114752577152</guid><pubDate>Mon, 09 Oct 2017 11:18:00 +0000</pubDate><atom:updated>2017-10-09T06:18:31.981-05:00</atom:updated><title>Adding Security to Invoke-Command Script</title><description>

&lt;br /&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
Last week, I posted
a script to gather user information from a different domain.&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;In that script the -Credential parameter was
set to a specific account name.&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;When
running the script, a prompt would ask for the password.&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;Although it worked it isn&#39;t the most secure
way of getting the information.&amp;nbsp;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
This week, let&#39;s add
some additional security and eliminate the need for any additional information.&amp;nbsp;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
First, you need a
way to store an encrypted password.&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;The
following script will do just that:&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
$credfilepath =
&quot;c:\scripts\password_file.txt&quot;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
$cred = read-host
-AsSecureString &quot;`nPlease enter the new password &quot;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
$cred |
ConvertFrom-SecureString | Set-Content $credfilepath&amp;nbsp;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
The first line sets
the $credfilepath variable to where you want the credential file to reside.&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
The second line is
what will prompt you for the password of the account you will be using to run
the Get-ADUser statement in the main script.&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
The third line reads
the $cred variable, converts the $cred information from a secured string to an
encrypted string, and stores the information in the file assigned to the
$credfilepath variable.&amp;nbsp;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
Once you have the
password in an encrypted format, we can make the following changes to the
original script:&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
$pwd = get-content
C:\scripts\password_file.txt | ConvertTo-SecureString&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
$EXTUser =
&#39;&amp;lt;domain&amp;gt;\&amp;lt;user name.&#39;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
$cred = New-Object
System.Management.Automation.PSCredential $EXTUser, $pwd&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
invoke-command
-ComputerName server1.mydomain.net -Credential $cred -ScriptBlock { get-aduser
-filter * -Properties * -SearchBase &#39;OU=Titles,DC=MyDomain,DC=Net&#39; |
Select-Object DisplayName,sAMAccountName,ObjectSid | FL }&amp;nbsp;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
The first line
variable converts the encrypted information in password_file.txt to a secured
string.&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
The second line
variable holds the account that has permissions to run the script.&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
The third line
variable gets the credential information using the
System.Management.Automation.PSCredential class.&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
Change the
-Credential value, in the Invoke-Command line, to -Credential $Cred.&amp;nbsp;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
Now, when you run
the script, you will not be prompted for a password.&amp;nbsp;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
I use this type of
security method a lot at my real job.&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;In
my opinion, it is a easy way to add a level of security to scripts.&amp;nbsp;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin: 0in;&quot;&gt;
Please let me know
if you have any questions about this script.&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;Mikey&#39;s PowerShell Blog RSS Feed&lt;/div&gt;</description><link>http://mikeyspowershellblog.blogspot.com/2017/10/adding-security-to-invoke-command-script.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item></channel></rss>