<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8670123831612315746</id><updated>2012-03-17T00:49:24.350-04:00</updated><category term='send-mailmessage'/><category term='Profile'/><category term='ISE'/><category term='Here-String'/><category term='CLI'/><category term='Quest'/><category term='WMI'/><category term='PowerGUI'/><category term='Powershell'/><category term='Quest AD cmdlets'/><category term='Editor'/><title type='text'>John J's Ramblings</title><subtitle type='html'>Primarily stuff I encounter while using Powershell, sometimes just general geek information with some personal stuff thrown in.  I have been doing more personal, actually predominantly Windows Phone 7 blogging at http://jkavanagh58.wordpress.com</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jkavanagh58.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://jkavanagh58.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>John J. Kavanagh</name><uri>http://www.blogger.com/profile/09799549032576050681</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://1.bp.blogspot.com/_p9k2TTT5uD4/S6pEA4nJmbI/AAAAAAAAAHk/NfBGAs6fsyY/S220/Summer2009.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>17</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8670123831612315746.post-4796555643446537319</id><published>2011-07-30T23:43:00.001-04:00</published><updated>2011-07-30T23:43:20.440-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Powershell'/><title type='text'>Going going gone…</title><content type='html'>&lt;p&gt;Well not really going, just in the process of moving this blog to wordpress.&amp;nbsp; While I miss Windows Live Spaces, I tried this google product and as with the others I just find it underwhelming.&lt;/p&gt; &lt;p&gt;http://jkavpowershell.wordpress.com/&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8670123831612315746-4796555643446537319?l=jkavanagh58.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jkavanagh58.blogspot.com/feeds/4796555643446537319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jkavanagh58.blogspot.com/2011/07/going-going-gone.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/4796555643446537319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/4796555643446537319'/><link rel='alternate' type='text/html' href='http://jkavanagh58.blogspot.com/2011/07/going-going-gone.html' title='Going going gone…'/><author><name>John J. Kavanagh</name><uri>http://www.blogger.com/profile/09799549032576050681</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://1.bp.blogspot.com/_p9k2TTT5uD4/S6pEA4nJmbI/AAAAAAAAAHk/NfBGAs6fsyY/S220/Summer2009.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8670123831612315746.post-8029750325614000229</id><published>2011-06-25T09:46:00.001-04:00</published><updated>2011-06-25T09:46:58.329-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='CLI'/><title type='text'>Been Awhile</title><content type='html'>&lt;p&gt;Wow, I have not posted here in some time.&amp;nbsp; With contracting and then starting a new job I have to admit my Powershell focus has been sporadic.&amp;nbsp; It is interesting that an employer can hire you in part for powershell but then don’t want you to focus on writing or perfecting scripts.&lt;/p&gt; &lt;p&gt;I am posting today based on the Scripting Guy’s recent &lt;a title="Microsoft Scripting Guy Ed Wilson talks about when to not write a Windows PowerShell script." href="http://blogs.technet.com/b/heyscriptingguy/archive/2011/06/25/don-t-write-powershell-scripts.aspx" target="_blank"&gt;post&lt;/a&gt;.&amp;nbsp; One of the things I have found interesting is to see Windows Admins who aren’t interested in scripting.&amp;nbsp; Then I show them how to run a simple wmi query from the Powershell prompt.&lt;/p&gt; &lt;p&gt;Then the next step is show them how to create a profile (colorful text still seems to get attention &lt;img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://lh5.ggpht.com/-qLcsO3sUpy8/TgXm0XWm6BI/AAAAAAAAAos/-9MdUvp2gKM/wlEmoticon-smile%25255B2%25255D.png?imgmax=800"&gt;) and then provide normal daily activities that can be accomplished via a function within their profile.&lt;/p&gt; &lt;p&gt;Of course there is still the work of converting vbscript coders to Powershell.&amp;nbsp; Admittedly there still seem to be things vbscript is better at but showing vbscript diehards some of the advantages Powershell provides is fun.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8670123831612315746-8029750325614000229?l=jkavanagh58.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jkavanagh58.blogspot.com/feeds/8029750325614000229/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jkavanagh58.blogspot.com/2011/06/been-awhile.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/8029750325614000229'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/8029750325614000229'/><link rel='alternate' type='text/html' href='http://jkavanagh58.blogspot.com/2011/06/been-awhile.html' title='Been Awhile'/><author><name>John J. Kavanagh</name><uri>http://www.blogger.com/profile/09799549032576050681</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://1.bp.blogspot.com/_p9k2TTT5uD4/S6pEA4nJmbI/AAAAAAAAAHk/NfBGAs6fsyY/S220/Summer2009.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/-qLcsO3sUpy8/TgXm0XWm6BI/AAAAAAAAAos/-9MdUvp2gKM/s72-c/wlEmoticon-smile%25255B2%25255D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8670123831612315746.post-563058472161484662</id><published>2011-01-19T09:23:00.001-05:00</published><updated>2011-01-19T15:18:14.220-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Editor'/><category scheme='http://www.blogger.com/atom/ns#' term='PowerGUI'/><category scheme='http://www.blogger.com/atom/ns#' term='Quest AD cmdlets'/><category scheme='http://www.blogger.com/atom/ns#' term='Powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='CLI'/><title type='text'>Passing on the power of Powershell</title><content type='html'>&lt;p&gt;I was recently asked to help a fellow systems administrator in one of our divisions with a request.&amp;nbsp; The request was simple enough with Powershell and when I provided the information the recipient shared the attempts they had made.&amp;nbsp; When I saw the example it was the familiar blue background of a powershell console and the syntax showed they were familiar with the Quest AD cmdlets…..&amp;nbsp; &lt;/p&gt; &lt;p&gt;I noticed they tried to run the same command several times just changing the SearchRoot.&amp;nbsp; So, working on the request I offered a one-liner they could use to replace it, simplifying it to list through the OU’s instead of specifying each one in another command line and formatting the output to make it easier to use.&lt;/p&gt; &lt;p&gt;So I offered the following syntax as a possible solution for their request (&lt;em&gt;Report the count of objects in a set of sub-OUs&lt;/em&gt;).&lt;/p&gt;&lt;pre&gt;&lt;span style="color: #5f9ea0; font-weight: bold"&gt;get-qadobject&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="font-style: italic; color: #5f9ea0"&gt;-Type&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #800000"&gt;OrganizationalUnit&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="font-style: italic; color: #5f9ea0"&gt;-Searchroot&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #800000"&gt;'&lt;/span&gt;&lt;span style="color: #800000"&gt;some.domain.com/OURoot/SubOU&lt;/span&gt;&lt;span style="color: #800000"&gt;'&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="font-style: italic; color: #5f9ea0"&gt;-SearchScope&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #800000"&gt;OneLevel&lt;/span&gt;&lt;span style="color: #000000"&gt; | &lt;/span&gt;&lt;span style="color: #5f9ea0; font-weight: bold"&gt;`&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #5f9ea0; font-weight: bold"&gt;%&lt;/span&gt;&lt;span style="color: #000000"&gt; {&lt;/span&gt;&lt;span style="color: #800080"&gt;$_&lt;/span&gt;&lt;span style="color: #000000"&gt;.CanonicalName &lt;/span&gt;&lt;span style="color: #ff0000"&gt;+&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #800000"&gt;: &lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;+&lt;/span&gt;&lt;span style="color: #000000"&gt; (&lt;/span&gt;&lt;span style="color: #5f9ea0; font-weight: bold"&gt;get-qadobject&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="font-style: italic; color: #5f9ea0"&gt;-SearchRoot&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #800080"&gt;$_&lt;/span&gt;&lt;span style="color: #000000"&gt;.CanonicalName &lt;/span&gt;&lt;span style="font-style: italic; color: #5f9ea0"&gt;-SizeLimit&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;0&lt;/span&gt;&lt;span style="color: #000000"&gt;).count }&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;The one-liner&amp;nbsp; produced the results they looked for and I was able to explain the line continuation with the backtick (`) and the alias for ForEach (%).&amp;nbsp; The obvious next question was how do I save this to a script.&amp;nbsp; So I have an admin hungry for some information on Powershell so I had to create an easy to read script. I had to include something I &lt;a href="http://jkavanagh58.blogspot.com/2011/01/making-lines-of-code-easier-to-read.html"&gt;recently mentioned&lt;/a&gt; (thanks to &lt;a href="http://unlockpowershell.wordpress.com/"&gt;Karl Mitschke&lt;/a&gt;) to add a new twist and make the code a little easier to read.&lt;/p&gt;&lt;pre&gt;&lt;span style="color: #800080"&gt;$QADObject&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt; @{&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #5f9ea0; font-weight: bold"&gt;Type&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #800000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #800000"&gt;OrganizationalUnit&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;SearchRoot &lt;/span&gt;&lt;span style="color: #ff0000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #800000"&gt;'&lt;/span&gt;&lt;span style="color: #800000"&gt;some.domain.com/OURoot/SubOU&lt;/span&gt;&lt;span style="color: #800000"&gt;'&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;SearchScope &lt;/span&gt;&lt;span style="color: #ff0000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #800000"&gt;OneLevel&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008000"&gt;#&lt;/span&gt;&lt;span style="color: #008000"&gt; Create array of OU's to measure&lt;/span&gt;&lt;span style="color: #008000"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #800080"&gt;$checkous&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #5f9ea0; font-weight: bold"&gt;Get-QADObject&lt;/span&gt;&lt;span style="color: #000000"&gt; @QADObject&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008000"&gt;#&lt;/span&gt;&lt;span style="color: #008000"&gt; Process a count for each returned OU&lt;/span&gt;&lt;span style="color: #008000"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;ForEach&lt;/span&gt;&lt;span style="color: #000000"&gt; (&lt;/span&gt;&lt;span style="color: #800080"&gt;$ou&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;in&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #800080"&gt;$checkous&lt;/span&gt;&lt;span style="color: #000000"&gt;){&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #008000"&gt;#&lt;/span&gt;&lt;span style="color: #008000"&gt; Generate output in report format&lt;/span&gt;&lt;span style="color: #008000"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000"&gt;    &lt;/span&gt;&lt;span style="color: #800080"&gt;$ou&lt;/span&gt;&lt;span style="color: #000000"&gt;.CanonicalName &lt;/span&gt;&lt;span style="color: #ff0000"&gt;+&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #800000"&gt;: &lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;+&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #5f9ea0; font-weight: bold"&gt;get-qadobject&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="font-style: italic; color: #5f9ea0"&gt;-SearchRoot&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #800080"&gt;$ou&lt;/span&gt;&lt;span style="color: #000000"&gt;.CanonicalName &lt;/span&gt;&lt;span style="font-style: italic; color: #5f9ea0"&gt;-SizeLimit&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #000000"&gt;0&lt;/span&gt;&lt;span style="color: #000000"&gt;).count&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Of course I also had to ask what they were using for an editor and suggested that, since they were obviously familiar with the Quest AD cmdlets, they try &lt;a href="http://powergui.org"&gt;PowerGUI&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_p9k2TTT5uD4/TTb7F95i6TI/AAAAAAAAAZk/qMc5E3sPpgo/s1600-h/PowerGUI-Badge-GetToThePrompt-Pro%5B2%5D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="PowerGUI-Badge-GetToThePrompt-Pro" border="0" alt="PowerGUI-Badge-GetToThePrompt-Pro" src="http://lh6.ggpht.com/_p9k2TTT5uD4/TTb7GQICzYI/AAAAAAAAAZo/LrU4Zg7cOPs/PowerGUI-Badge-GetToThePrompt-Pro_thumb.png?imgmax=800" width="204" height="79"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8670123831612315746-563058472161484662?l=jkavanagh58.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jkavanagh58.blogspot.com/feeds/563058472161484662/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jkavanagh58.blogspot.com/2011/01/passing-on-power-of-powershell.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/563058472161484662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/563058472161484662'/><link rel='alternate' type='text/html' href='http://jkavanagh58.blogspot.com/2011/01/passing-on-power-of-powershell.html' title='Passing on the power of Powershell'/><author><name>John J. Kavanagh</name><uri>http://www.blogger.com/profile/09799549032576050681</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://1.bp.blogspot.com/_p9k2TTT5uD4/S6pEA4nJmbI/AAAAAAAAAHk/NfBGAs6fsyY/S220/Summer2009.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_p9k2TTT5uD4/TTb7GQICzYI/AAAAAAAAAZo/LrU4Zg7cOPs/s72-c/PowerGUI-Badge-GetToThePrompt-Pro_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8670123831612315746.post-7537063426880554823</id><published>2011-01-14T10:30:00.001-05:00</published><updated>2011-01-14T10:30:35.388-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PowerGUI'/><category scheme='http://www.blogger.com/atom/ns#' term='Powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='Quest'/><title type='text'>Evaluating–PowerGUI MobileShell</title><content type='html'>&lt;p&gt;I bit the bullet and bought Quest’s PowerGUI Pro.&amp;nbsp; While I have made the full transition from PowershellPlus Pro, I really didn’t see value in upgrading from the already strong PowerGUI product.&amp;nbsp; I really only use the editor and the “pay for” version doesn’t really seem to offer more than you can get from the download.&amp;nbsp; &lt;/p&gt; &lt;p&gt;I couldn’t just leave it at that.&amp;nbsp; One of the components that comes with the Pro package is mobile shell.&amp;nbsp; I installed the MobileShell component on a laptop and answered a few questions or responded to the warnings, and in 25 minutes I was able to test it and have to say I was impressed.&amp;nbsp; The first warning is logical as it warns you that this product was really intended for a server running IIS and it mentions verbiage about installing on Windows 7 for evaluation.&amp;nbsp; It provides three options for SSL and again this is just a test so unsecured http was selected.&amp;nbsp; The option to provide other users access to the mobile shell was pretty straight forward as well.&amp;nbsp; Installation complete, time to test.&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_p9k2TTT5uD4/TTBsDssBEoI/AAAAAAAAAZI/r4WYImrhDeY/s1600-h/mobileshell-eval%5B4%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top: 0px; border-right: 0px; padding-top: 0px" title="mobileshell-eval" border="0" alt="mobileshell-eval" align="right" src="http://lh5.ggpht.com/_p9k2TTT5uD4/TTBsEefX8dI/AAAAAAAAAZM/dqvGM4VE_p4/mobileshell-eval_thumb%5B2%5D.png?imgmax=800" width="327" height="228"&gt;&lt;/a&gt;I was able to get to the shell interface from my desktop computer.&amp;nbsp; Performance was as I would expect in such a test case.&amp;nbsp; I was impressed with the interface and then kicked the tires and I can see how this would be very useful.&amp;nbsp; Keep in mind this is from a computer, not necessarily the “mobile” but I can still think of some use cases.&amp;nbsp; As the image shows, it loads the default profile on the hosting machine and any commands I run were in fact being run on the host.&lt;/p&gt; &lt;p&gt;I was reluctant to test a mobile device due to the ability to connect to the wireless network in the current environment where I work.&amp;nbsp; Since my phone is a personal device I would have to connect to the wireless network designated for guest and I have experienced connectivity issues in the past when using a personal laptop onsite.&amp;nbsp; Not to mention, accessing my personal email would then be interrupted.&amp;nbsp; Oh well this will be just a quick test.&amp;nbsp; I connected to the guest wireless network, opened the web browser on my WP7 device and connected to the url.&amp;nbsp; Connected… very nice.&lt;/p&gt; &lt;p&gt;The interface is broken into three tabbed windows for Favorites, Run Script and Results.&amp;nbsp; Again I can not verify this should even work, so when I received errors when running scripts or executing one of the “Favorites” never seemed to complete and show results could be a factor of several things (WP7 browser issue, guest access rules, etc).&amp;nbsp; Just having that connectivity and knowing the shell does work, just being able to see the interface was a win.&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_p9k2TTT5uD4/TTBsExYonTI/AAAAAAAAAZQ/4NjjYhqzifE/s1600-h/mobileshell-wp7-connected%5B3%5D.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="mobileshell-wp7-connected" border="0" alt="mobileshell-wp7-connected" src="http://lh6.ggpht.com/_p9k2TTT5uD4/TTBsFcN0IlI/AAAAAAAAAZY/ntbbR5cKU7w/mobileshell-wp7-connected_thumb.jpg?imgmax=800" width="244" height="149"&gt;&lt;/a&gt;&lt;a href="http://lh6.ggpht.com/_p9k2TTT5uD4/TTBsF6R-G_I/AAAAAAAAAZc/MjUik_lB7Dw/s1600-h/mobileshell-wp7-runscript%5B3%5D.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="mobileshell-wp7-runscript" border="0" alt="mobileshell-wp7-runscript" src="http://lh5.ggpht.com/_p9k2TTT5uD4/TTBsGQivnsI/AAAAAAAAAZg/KtDXIUIj9dA/mobileshell-wp7-runscript_thumb.jpg?imgmax=800" width="244" height="147"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;With the success I saw in a short testing period here, I will now try a similar test on my home network with a few mobile devices.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8670123831612315746-7537063426880554823?l=jkavanagh58.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jkavanagh58.blogspot.com/feeds/7537063426880554823/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jkavanagh58.blogspot.com/2011/01/evaluatingpowergui-mobileshell.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/7537063426880554823'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/7537063426880554823'/><link rel='alternate' type='text/html' href='http://jkavanagh58.blogspot.com/2011/01/evaluatingpowergui-mobileshell.html' title='Evaluating–PowerGUI MobileShell'/><author><name>John J. Kavanagh</name><uri>http://www.blogger.com/profile/09799549032576050681</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://1.bp.blogspot.com/_p9k2TTT5uD4/S6pEA4nJmbI/AAAAAAAAAHk/NfBGAs6fsyY/S220/Summer2009.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_p9k2TTT5uD4/TTBsEefX8dI/AAAAAAAAAZM/dqvGM4VE_p4/s72-c/mobileshell-eval_thumb%5B2%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8670123831612315746.post-1309882842267217627</id><published>2011-01-13T13:28:00.001-05:00</published><updated>2011-01-13T13:28:27.532-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Powershell'/><title type='text'>It’s for automation</title><content type='html'>&lt;p&gt;Okay, a recent interview I was asked a question and upon further thought I should have 1) answered differently 2) rant about it.&amp;nbsp; The question was basically “with all of this powershell related answers you see things and figure out how to automate it?”&lt;/p&gt; &lt;p&gt;The simple answer is yes.&amp;nbsp; However, with Powershell the answer is not that simple.&amp;nbsp; Just referring at the Windows platform here.&amp;nbsp; &lt;/p&gt; &lt;p&gt;Yes, Powershell has provided a much more powerful environment for scripting, tasks that would be considered automation.&amp;nbsp; “If you repeat it, script it” is a great slogan I have seen and it’s very true.&amp;nbsp; I have used bat files, kixtart, and then vbscript to assemble commands that I will use on a scheduled basis or just a tool to have for recurring tasks to address administration or resolve problems.&amp;nbsp; Porting many of these routines to Powershell most certainly falls into the automation category.&lt;/p&gt; &lt;p&gt;What I believe is lost is just the power of the command line interface Powershell offers.&amp;nbsp; Using a current situation, I can query a remote machine for specific values.&amp;nbsp; I can call upon LDAP and WMI and can tweak my attempts.&amp;nbsp; Yes, I could open compmgmt.msc to check what I am looking for but I find a shell environment is easier to work in personally.&amp;nbsp; Using the data retrieved I can now perform steps necessary to resolve the issue, again all in the powershell command line interface.&amp;nbsp; I test my changes and find that the steps taken do in fact resolve the issue.&amp;nbsp; Now Automation does come in, with the steps now verified I can save them to a script for later use.&lt;/p&gt; &lt;p&gt;Another example is when I have been asked to make broad changes.&amp;nbsp; Yes I could open my script editor of choice and write some code, but this is an impromptu request and I probably won’t be repeating the action.&amp;nbsp; Being very generic; someone wants all accounts that end in X (in this case the naming convention would indicate that they are contractors) added to a group, using Powershell and the Quest AD cmdlets this can be down in a one-liner querying for all users matching criteria and piping that to the cmdlet to add group members.&amp;nbsp; Yes there are other ways to perform the same operation, whether it be GUI or another console, but we are talking about Powershell and the assumption its for automation only.&lt;/p&gt; &lt;p&gt;Just my two cents.&lt;/p&gt; &lt;p&gt;Just my two cents.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8670123831612315746-1309882842267217627?l=jkavanagh58.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jkavanagh58.blogspot.com/feeds/1309882842267217627/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jkavanagh58.blogspot.com/2011/01/its-for-automation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/1309882842267217627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/1309882842267217627'/><link rel='alternate' type='text/html' href='http://jkavanagh58.blogspot.com/2011/01/its-for-automation.html' title='It’s for automation'/><author><name>John J. Kavanagh</name><uri>http://www.blogger.com/profile/09799549032576050681</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://1.bp.blogspot.com/_p9k2TTT5uD4/S6pEA4nJmbI/AAAAAAAAAHk/NfBGAs6fsyY/S220/Summer2009.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8670123831612315746.post-3453221942135997393</id><published>2011-01-04T08:23:00.001-05:00</published><updated>2011-01-04T08:23:53.838-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Editor'/><category scheme='http://www.blogger.com/atom/ns#' term='PowerGUI'/><category scheme='http://www.blogger.com/atom/ns#' term='Powershell'/><title type='text'>Making lines of code easier to read</title><content type='html'>&lt;p&gt;When helping to spread the Powershell bug, one of the questions I get often is “how can I keep the line length manageable?”.&amp;nbsp; The easiest answer is to break the line into smaller segments and span multiple lines with the back tick (`).&amp;nbsp; Using Powershell Snapins like Quest Active Roles ADManagement or vmware PowerCLI the cmdlets come with a multitude of parameters.&amp;nbsp; The parameter set makes interacting much more flexible and using a quick example you can perform commands with a simple purpose of returning information and because of the parameters you can&amp;nbsp; avoid lengthy where-object clauses.&amp;nbsp; For example;&lt;/p&gt;&lt;font size="2" face="Courier New"&gt;&lt;font size="2" face="Courier New"&gt; &lt;p&gt;get-qaduser | &lt;/font&gt;&lt;/font&gt;&lt;b&gt;&lt;font color="#5f9ea0" size="2" face="Courier New"&gt;&lt;font color="#5f9ea0" size="2" face="Courier New"&gt;&lt;font color="#5f9ea0" size="2" face="Courier New"&gt;where&lt;/b&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font size="2" face="Courier New"&gt; {&lt;/font&gt;&lt;/font&gt;&lt;font color="#800080" size="2" face="Courier New"&gt;&lt;font color="#800080" size="2" face="Courier New"&gt;&lt;font color="#800080" size="2" face="Courier New"&gt;$_&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font size="2" face="Courier New"&gt;.FirstName &lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2" face="Courier New"&gt;&lt;font color="#ff0000" size="2" face="Courier New"&gt;&lt;font color="#ff0000" size="2" face="Courier New"&gt;-eq&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font size="2" face="Courier New"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;'John'&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font size="2" face="Courier New"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2" face="Courier New"&gt;&lt;font color="#ff0000" size="2" face="Courier New"&gt;&lt;font color="#ff0000" size="2" face="Courier New"&gt;-and&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font size="2" face="Courier New"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#800080" size="2" face="Courier New"&gt;&lt;font color="#800080" size="2" face="Courier New"&gt;&lt;font color="#800080" size="2" face="Courier New"&gt;$_&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font size="2" face="Courier New"&gt;.LastName &lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2" face="Courier New"&gt;&lt;font color="#ff0000" size="2" face="Courier New"&gt;&lt;font color="#ff0000" size="2" face="Courier New"&gt;-contains&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font size="2" face="Courier New"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;'Kava*'&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font size="2" face="Courier New"&gt;}&lt;br&gt;can be simplified to:&lt;br&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font size="2" face="Courier New"&gt;&lt;font size="2" face="Courier New"&gt;&lt;font size="2" face="Courier New"&gt;get-qaduser -FirstName &lt;/font&gt;&lt;/font&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;'John'&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font size="2" face="Courier New"&gt; -LastName &lt;/font&gt;&lt;/font&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;'Kava*'&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2" face="Courier New"&gt;&lt;font size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;Pretty simple, but when you start adding even more parameters (e.g SizeLimit, SearchRoot, etc…) for a more targeted request the command line can get very lengthy.&amp;nbsp; So how do we clean that up?&amp;nbsp; I came across the answer by accident.&amp;nbsp; When looking at &lt;a href="http://powergui.org/"&gt;PowerGUI&lt;/a&gt; editor enhancements I came across one that revealed the answer.&amp;nbsp; The answer is to create Splatted Hash Tables to formulate the parameter set.&amp;nbsp; Using the example above and adding two parameters the new method would look like:&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;font color="#800080" size="2" face="Courier New"&gt;&lt;font color="#800080" size="2" face="Courier New"&gt;&lt;font color="#800080" size="2" face="Courier New"&gt; &lt;p&gt;$qaduser&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font color="#000000" size="2" face="Courier New"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2" face="Courier New"&gt;&lt;font color="#ff0000" size="2" face="Courier New"&gt;&lt;font color="#ff0000" size="2" face="Courier New"&gt;=&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font size="2" face="Courier New"&gt;&lt;font color="#000000"&gt; @{&lt;br&gt;&lt;/font&gt;SizeLimit &lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2" face="Courier New"&gt;&lt;font color="#ff0000" size="2" face="Courier New"&gt;&lt;font color="#ff0000" size="2" face="Courier New"&gt;=&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font size="2" face="Courier New"&gt; 0&lt;br&gt;SearchRoot &lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2" face="Courier New"&gt;&lt;font color="#ff0000" size="2" face="Courier New"&gt;&lt;font color="#ff0000" size="2" face="Courier New"&gt;=&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font size="2" face="Courier New"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;"dc=somedomain,dc=corp"&lt;br&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font size="2" face="Courier New"&gt;LastName &lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2" face="Courier New"&gt;&lt;font color="#ff0000" size="2" face="Courier New"&gt;&lt;font color="#ff0000" size="2" face="Courier New"&gt;=&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font size="2" face="Courier New"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;'Kava*'&lt;br&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font size="2" face="Courier New"&gt;FirstName &lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2" face="Courier New"&gt;&lt;font color="#ff0000" size="2" face="Courier New"&gt;&lt;font color="#ff0000" size="2" face="Courier New"&gt;=&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font size="2" face="Courier New"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;'John'&lt;br&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font size="2" face="Courier New"&gt;}&lt;/p&gt; &lt;p&gt;get-qaduser @qaduser&lt;/p&gt;&lt;/font&gt;&lt;/font&gt; &lt;p&gt;&lt;font size="2" face="Courier New"&gt;&lt;font size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;As you can see all of the parameters are stored in a hast table and then passed to the cmdlet.&amp;nbsp; As long as the keys match up to the parameters we have boiled down a lengthy string to a concise and easy to read piece of code.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2" face="Courier New"&gt;&lt;font size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;The PowerGUI Script Editor add-on can be found &lt;a href="http://powergui.org/entry.jspa?externalID=3036&amp;amp;categoryID=387"&gt;here&lt;/a&gt;.&amp;nbsp; This allows you to take a long piece of code (cmdlet with multiple parameters for example) and press Ctrl+L and it will assemble the splatted hash table and change the command line.&amp;nbsp; I have found a parameter like “-SizeLimit 0” does not work so well, but easy enough to correct after the add-on does the bulk of the work.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2" face="Courier New"&gt;&lt;font size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;font size="2" face="Courier New"&gt;&lt;font size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;a href="http://lh5.ggpht.com/_p9k2TTT5uD4/TSMfZwzWvBI/AAAAAAAAAVI/XrsxMB4zCuA/s1600-h/PowerGUI-Badge-GetToThePrompt-Pro%5B2%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="PowerGUI-Badge-GetToThePrompt-Pro" border="0" alt="PowerGUI-Badge-GetToThePrompt-Pro" src="http://lh5.ggpht.com/_p9k2TTT5uD4/TSMfaYYokYI/AAAAAAAAAVM/nOoym2a5OfI/PowerGUI-Badge-GetToThePrompt-Pro_thumb.png?imgmax=800" width="204" height="79"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8670123831612315746-3453221942135997393?l=jkavanagh58.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jkavanagh58.blogspot.com/feeds/3453221942135997393/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jkavanagh58.blogspot.com/2011/01/making-lines-of-code-easier-to-read.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/3453221942135997393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/3453221942135997393'/><link rel='alternate' type='text/html' href='http://jkavanagh58.blogspot.com/2011/01/making-lines-of-code-easier-to-read.html' title='Making lines of code easier to read'/><author><name>John J. Kavanagh</name><uri>http://www.blogger.com/profile/09799549032576050681</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://1.bp.blogspot.com/_p9k2TTT5uD4/S6pEA4nJmbI/AAAAAAAAAHk/NfBGAs6fsyY/S220/Summer2009.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_p9k2TTT5uD4/TSMfaYYokYI/AAAAAAAAAVM/nOoym2a5OfI/s72-c/PowerGUI-Badge-GetToThePrompt-Pro_thumb.png?imgmax=800' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8670123831612315746.post-422847943897521422</id><published>2010-11-18T07:11:00.001-05:00</published><updated>2010-11-18T07:11:15.611-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Quest AD cmdlets'/><category scheme='http://www.blogger.com/atom/ns#' term='Powershell'/><title type='text'>Be More Specific</title><content type='html'>&lt;p&gt;&lt;font size="3"&gt;Nothing revolutionary here and I probably should have planned accordingly but… I was provided with a list of computers to delete, as long as they are not online.&amp;nbsp; It’s a pretty simple script and since its been a sporadic request I have not really formalized it.&amp;nbsp; I use the start-transcipt and stop-transcript to record the output, and was going through the anomalies (computer objects with sub-objects, etc..).&amp;nbsp; Hmmmm why didn’t this computer get deleted???&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="3"&gt;Well based on the name, a get-qadobject returns several objects.&amp;nbsp; The computer name met the naming convention but was not complete.&amp;nbsp; An example would be if your computers are named in a fashion similar to computerXXX and a computer is named &lt;em&gt;computer,&lt;/em&gt; when you perform:&lt;/font&gt;&lt;/p&gt;&lt;b&gt;&lt;font color="#5f9ea0" size="2" face="Courier New"&gt;&lt;font color="#5f9ea0" size="2" face="Courier New"&gt; &lt;p&gt;get-qadcomputer&lt;/b&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font color="#000000" size="2" face="Courier New"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;computer&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt; &lt;p&gt;&lt;font color="#000000" size="3"&gt;This will return the object you were looking for but will also return all of the computerXXX named objects.&amp;nbsp; The fix is simple, and this is not a bug in my opinion, just a caveat that is easily accounted for.&amp;nbsp; When performing the get-qadcomputer use the Name parameter to return the specific object…&lt;/font&gt;&lt;/p&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#5f9ea0" size="2" face="Courier New"&gt;&lt;font color="#5f9ea0" size="2" face="Courier New"&gt;&lt;font color="#5f9ea0" size="2" face="Courier New"&gt; &lt;p&gt;&lt;strong&gt;get-qadcomputer&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font color="#000000" size="2" face="Courier New"&gt; &lt;/font&gt;&lt;/font&gt;&lt;i&gt;&lt;font color="#5f9ea0" size="2" face="Courier New"&gt;&lt;font color="#5f9ea0" size="2" face="Courier New"&gt;&lt;font color="#5f9ea0" size="2" face="Courier New"&gt;-Name&lt;/i&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font color="#000000" size="2" face="Courier New"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;computer&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt; &lt;p&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8670123831612315746-422847943897521422?l=jkavanagh58.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jkavanagh58.blogspot.com/feeds/422847943897521422/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jkavanagh58.blogspot.com/2010/11/be-more-specific.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/422847943897521422'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/422847943897521422'/><link rel='alternate' type='text/html' href='http://jkavanagh58.blogspot.com/2010/11/be-more-specific.html' title='Be More Specific'/><author><name>John J. Kavanagh</name><uri>http://www.blogger.com/profile/09799549032576050681</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://1.bp.blogspot.com/_p9k2TTT5uD4/S6pEA4nJmbI/AAAAAAAAAHk/NfBGAs6fsyY/S220/Summer2009.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8670123831612315746.post-772811711497290942</id><published>2010-09-14T10:20:00.001-04:00</published><updated>2010-09-14T10:39:46.113-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Editor'/><category scheme='http://www.blogger.com/atom/ns#' term='Quest AD cmdlets'/><category scheme='http://www.blogger.com/atom/ns#' term='Powershell'/><title type='text'>Powershell Plus and other editors</title><content type='html'>&lt;p&gt;I have been a big fan of PowershellPlus, the enhanced shell and scripting tool from &lt;a href="http://www.idera.com"&gt;Idera&lt;/a&gt;.&amp;nbsp; I had started experiencing issues with the application going into a “Not Responding”&amp;nbsp; state.&amp;nbsp; So the new version (3.5) was announced and I thought I would give it a try.&amp;nbsp; Same interface that drew me to the product with the clear command history, variable displays and the command completion were there.&amp;nbsp; I started using it and again it was regaining my interest.&amp;nbsp; Testing done, now lets use it…. Uhoh! I can only suspect this is an issue with PowershellPlus and Quest AD Management tools not working well together but… I was doing a pretty simple query of computers using the Quest get-qadcomputer cmdlet.&amp;nbsp; Simple output of:&lt;/p&gt;&lt;font color="#5f9ea0" size="2" face="Courier New"&gt;&lt;font color="#5f9ea0" size="2" face="Courier New"&gt;&lt;font color="#5f9ea0" size="2" face="Courier New"&gt; &lt;p&gt;Get-QADComputer&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font color="#000000" size="2" face="Courier New"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#5f9ea0" size="2" face="Courier New"&gt;&lt;font color="#5f9ea0" size="2" face="Courier New"&gt;&lt;font color="#5f9ea0" size="2" face="Courier New"&gt;-SearchRoot&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font color="#000000" size="2" face="Courier New"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;'somedomain.com/Some OU'&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font color="#000000" size="2" face="Courier New"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#5f9ea0" size="2" face="Courier New"&gt;&lt;font color="#5f9ea0" size="2" face="Courier New"&gt;&lt;font color="#5f9ea0" size="2" face="Courier New"&gt;-SearchScope&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font color="#000000" size="2" face="Courier New"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;'Subtree'&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font color="#000000" size="2" face="Courier New"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Courier New"&gt;&lt;font color="#0000ff" size="2" face="Courier New"&gt;&lt;font color="#0000ff" size="2" face="Courier New"&gt;|&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font color="#000000" size="2" face="Courier New"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Courier New"&gt;&lt;font color="#0000ff" size="2" face="Courier New"&gt;&lt;font color="#0000ff" size="2" face="Courier New"&gt;select&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font color="#000000" size="2" face="Courier New"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Courier New"&gt;&lt;font color="#0000ff" size="2" face="Courier New"&gt;&lt;font color="#0000ff" size="2" face="Courier New"&gt;Name&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font color="#000000" size="2" face="Courier New"&gt;, &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Courier New"&gt;&lt;font color="#0000ff" size="2" face="Courier New"&gt;&lt;font color="#0000ff" size="2" face="Courier New"&gt;ParentContainer&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt; &lt;p&gt;looks as expected.&amp;nbsp; I prepended to a variable with:&lt;/p&gt;&lt;font color="#800080" size="2" face="Courier New"&gt;&lt;font color="#800080" size="2" face="Courier New"&gt;&lt;font color="#800080" size="2" face="Courier New"&gt; &lt;p&gt;$test&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font color="#000000" size="2" face="Courier New"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2" face="Courier New"&gt;&lt;font color="#ff0000" size="2" face="Courier New"&gt;&lt;font color="#ff0000" size="2" face="Courier New"&gt;=&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font color="#000000" size="2" face="Courier New"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#5f9ea0" size="2" face="Courier New"&gt;&lt;font color="#5f9ea0" size="2" face="Courier New"&gt;&lt;font color="#5f9ea0" size="2" face="Courier New"&gt;Get-QADComputer&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font color="#000000" size="2" face="Courier New"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#5f9ea0" size="2" face="Courier New"&gt;&lt;font color="#5f9ea0" size="2" face="Courier New"&gt;&lt;font color="#5f9ea0" size="2" face="Courier New"&gt;-SearchRoot&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font color="#000000" size="2" face="Courier New"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;'somedomain.com/Some OU'&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font color="#000000" size="2" face="Courier New"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#5f9ea0" size="2" face="Courier New"&gt;&lt;font color="#5f9ea0" size="2" face="Courier New"&gt;&lt;font color="#5f9ea0" size="2" face="Courier New"&gt;-SearchScope&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font color="#000000" size="2" face="Courier New"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;&lt;font color="#800000" size="2" face="Courier New"&gt;'Subtree'&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font color="#000000" size="2" face="Courier New"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Courier New"&gt;&lt;font color="#0000ff" size="2" face="Courier New"&gt;&lt;font color="#0000ff" size="2" face="Courier New"&gt;|&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font color="#000000" size="2" face="Courier New"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Courier New"&gt;&lt;font color="#0000ff" size="2" face="Courier New"&gt;&lt;font color="#0000ff" size="2" face="Courier New"&gt;select&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font color="#000000" size="2" face="Courier New"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Courier New"&gt;&lt;font color="#0000ff" size="2" face="Courier New"&gt;&lt;font color="#0000ff" size="2" face="Courier New"&gt;Name&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&lt;font color="#000000" size="2" face="Courier New"&gt;, &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Courier New"&gt;&lt;font color="#0000ff" size="2" face="Courier New"&gt;&lt;font color="#0000ff" size="2" face="Courier New"&gt;ParentContainer&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt; &lt;p&gt;$test.count returns a number in the range I was expecting as it shows 113, so lets look at the output of $test … WTH! it shows 11 items which equated to a specific ParentContainer and the “Not Responding” state surfaced again but not as severe.&amp;nbsp; Odd, so I test in a standard Powershell CLI and $test.count returns 113 again, and when I check the contents of $test, the screen shows lines of what would be expected of 113 records.&amp;nbsp; &lt;/p&gt; &lt;p&gt;I will look at this but I have to say my loyalty to this product is done.&amp;nbsp; On the upside, since I have taken a new position, I have been evangelizing Powershell amongst the Windows SystemAdmins so I have been suggesting PowerGUI and even more the Powershell ISE.&amp;nbsp; Some of the main features (automatic code-signing, V2 comment based help template, etc…) that I used to favor PowerShellPlus have been showing up in these products.&amp;nbsp; If you can’t work with the Quest AD cmdlets that’s a deal breaker for me.&lt;/p&gt; &lt;p&gt;I am thinking my blog entries with be adorned with this from here on out….&lt;/p&gt; &lt;p&gt;&lt;a title="My PowerShell IDE is PowerGUI" href="http://powergui.org"&gt;&lt;img alt="My PowerShell IDE is PowerGUI" src="http://powergui.org/servlet/JiveServlet/download/118-9270-29383-3689/bn2-powergui-200x100.gif" width="200" height="100"&gt; &lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8670123831612315746-772811711497290942?l=jkavanagh58.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jkavanagh58.blogspot.com/feeds/772811711497290942/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jkavanagh58.blogspot.com/2010/09/powershell-plus-and-other-editors.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/772811711497290942'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/772811711497290942'/><link rel='alternate' type='text/html' href='http://jkavanagh58.blogspot.com/2010/09/powershell-plus-and-other-editors.html' title='Powershell Plus and other editors'/><author><name>John J. Kavanagh</name><uri>http://www.blogger.com/profile/09799549032576050681</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://1.bp.blogspot.com/_p9k2TTT5uD4/S6pEA4nJmbI/AAAAAAAAAHk/NfBGAs6fsyY/S220/Summer2009.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8670123831612315746.post-5324885188295013455</id><published>2010-06-04T09:41:00.000-04:00</published><updated>2010-06-04T09:41:07.437-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Editor'/><category scheme='http://www.blogger.com/atom/ns#' term='Powershell'/><title type='text'>Toolbox</title><content type='html'>I was reading some articles from &lt;a href="http://www.windowsitpro.com/categories/category/Scripting.aspx"&gt;windowsitpro.com&lt;/a&gt; specifically on Powershell editors.&amp;nbsp; I had been a Sapien PrimalCode/PrimalScript user before Powershell.&amp;nbsp; Then I started using PowershellPlus.&amp;nbsp; The editor was great but the icing on the cake was the interactive console.&amp;nbsp; &lt;br /&gt;Lately however I have gone back to PowerGUI Script editor (I don't use the PowerGUI part, just the editor) and now I am using the Powershell ISE.&amp;nbsp; The primary reason for going back was not monetary as I have already paid for&amp;nbsp; PowershellPro Plus and PrimalScript 2009.&amp;nbsp; Since upgrading to version 3.1 x64 of PowershellPro Plus it has just been too unstable (best word I could think of) to continue with.&amp;nbsp; After executing a script or while in the console and it tries to perform word completion both the console and script editor go into "Not Responding" state and sometimes that can last until I finally kill the application.&amp;nbsp; The Idera folks have been responsive so I am not swearing off PowershellPro Plus, but I have also learned that the ISE that comes with Powershell is actually a pretty good and customizable editor.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8670123831612315746-5324885188295013455?l=jkavanagh58.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jkavanagh58.blogspot.com/feeds/5324885188295013455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jkavanagh58.blogspot.com/2010/06/toolbox.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/5324885188295013455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/5324885188295013455'/><link rel='alternate' type='text/html' href='http://jkavanagh58.blogspot.com/2010/06/toolbox.html' title='Toolbox'/><author><name>John J. Kavanagh</name><uri>http://www.blogger.com/profile/09799549032576050681</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://1.bp.blogspot.com/_p9k2TTT5uD4/S6pEA4nJmbI/AAAAAAAAAHk/NfBGAs6fsyY/S220/Summer2009.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8670123831612315746.post-859486652353283453</id><published>2010-06-04T08:48:00.000-04:00</published><updated>2010-06-04T08:48:37.754-04:00</updated><title type='text'>New Gig</title><content type='html'>So I have been working at this new gig for over two weeks now.&amp;nbsp;&amp;nbsp; Personal note, my hesitation about being a contractor were valid for sure.&amp;nbsp; So&amp;nbsp; a&amp;nbsp; few odd things as I started this new spot, Windows 7 on the desktop which in previous shops making the move to Windows 7 is probably a year away at least.&amp;nbsp; In terms of Powershell, it&amp;nbsp; would seem no one is using it and the one person I have&amp;nbsp; encountered&amp;nbsp; that does scripting, he shuns powershell and instead uses ASP and vbscript.&amp;nbsp; I have started applying and showing how not just for scripting, Powershell could make some of their processes much easier.&amp;nbsp; I will post more when I have some free time...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8670123831612315746-859486652353283453?l=jkavanagh58.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jkavanagh58.blogspot.com/feeds/859486652353283453/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jkavanagh58.blogspot.com/2010/06/new-gig.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/859486652353283453'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/859486652353283453'/><link rel='alternate' type='text/html' href='http://jkavanagh58.blogspot.com/2010/06/new-gig.html' title='New Gig'/><author><name>John J. Kavanagh</name><uri>http://www.blogger.com/profile/09799549032576050681</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://1.bp.blogspot.com/_p9k2TTT5uD4/S6pEA4nJmbI/AAAAAAAAAHk/NfBGAs6fsyY/S220/Summer2009.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8670123831612315746.post-3471981409574808135</id><published>2010-04-09T21:37:00.002-04:00</published><updated>2010-04-09T21:45:16.670-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Here-String'/><category scheme='http://www.blogger.com/atom/ns#' term='send-mailmessage'/><category scheme='http://www.blogger.com/atom/ns#' term='Powershell'/><title type='text'>Always Learning</title><content type='html'>&lt;p&gt;Okay, this one is more about the great community of powershell users.  I took a task upon myself after realizing user’s admin accounts were not part of the password synchronization process.  The task was a good way to show the group how Powershell could be used.  Being a huge fan of one-liners I sent some informative emails showing how easy it was to list user accounts and vital information such as whether it is disabled or the password expired.  Its really not about that though.  Based on the results it seemed logical to create a script to perform an audit, to include notification to users that their password would expire. &lt;/p&gt;  &lt;p&gt;So, onto the point of this posting.  I started working on the script, tested the logic for identifying password expiration now it was time to work on formatting the email message(s).  I could have made it a simple one line email but considering the recipients I wanted it to be a little more informational. &lt;/p&gt;  &lt;p&gt;II have experimented with Here-Strings but never really used them so here was a chance to put it to use…. Doh! its not working, research the problem a little and the problem was, in following proper indentation the string completion meant the whitespace, aka blank spaces, aka tabs, aka indentation was considered the first characters on the line.  Wondering if maybe I was missing something I posted to the &lt;a href="http://powershellcommunity.org/" target="_blank"&gt;powershellcommunity.org&lt;/a&gt;.  I have always been impressed with how quick and in-depth people work to help others on this site.  Almost instantly it was confirmed that there was no workaround with here-strings but also a ton of recommendations for alternatives.  Then some feedback in terms of sure indentation is great but for the sake of performance and compliance its no crime to break the format to use a true Powershell function versus going through more complicated methods… I hesitated and as you see in the full code listing below I tried two methods and stuck with breaking the “pretty” formatting of the code to use the Here-String. So as the following code shows $usrmsg breaks the indentation, it provides a concise way to build a body of text.  I would also like to point out, using a Here-String also made it easier to pass to the function that actually sends the email.  A here-string starts with @” and ends with “@, so below you can see it begin with $usrmg=@” so the string will be stored in a variable named $usrmg.  Very simple combination of text lines with dynamic data (i.e. $msgdate will actually be the date when the script is executed) assembled and stored to be passed on, the result will be used as the body of the email message.&lt;/p&gt;  &lt;p&gt;Done…. not so fast.  With Powershell Version 2 sending an email is easy since they included a cmdlet for just that.  Code was done, test worked but the actual send-mail message structure was just one very long line.  I was using Bing to search for more help with a send-mail message parameter and came across a &lt;a href="http://blogs.msdn.com/powershell/archive/2009/10/30/sending-automated-emails-with-send-mailmessage-convertto-html-and-the-powershellpack-s-taskscheduler-module.aspx" target="_blank"&gt;great blog posting&lt;/a&gt; by the group who developed Powershell.  Again, very impressed that they not only wrote the language but do a great job of encouraging its use with some great examples and explanations.  In reading they address the specific topic of send-mailmessage getting unwieldy and I just had to use it.  Basically it stores all of the parameters in a hash table.  The resulting code looks cleaner, easier to debug and an added benefit was I could code it out with two values for the email address the email would go to, so one it was ready to go all I need to do is remove the line that had To = my email address and then remove the comment (#) for the entry that used the dynamic value of the user’s email address for notification. &lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;div    style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:'Courier New', courier, monospace;font-size:8pt;color:black;" id="codeSnippet"&gt;     &lt;pre    style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:'Courier New', courier, monospace;font-size:8pt;color:black;"&gt;&lt;span style="color:#0000ff;"&gt;function&lt;/span&gt; usrnotification {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:'Courier New', courier, monospace;font-size:8pt;color:black;"&gt;    &lt;span style="color:#0000ff;"&gt;param&lt;/span&gt;(&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:'Courier New', courier, monospace;font-size:8pt;color:black;"&gt;    [string]$varname ,&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:'Courier New', courier, monospace;font-size:8pt;color:black;"&gt;    [string]$usremail ,&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:'Courier New', courier, monospace;font-size:8pt;color:black;"&gt;    [string]$vartil &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:'Courier New', courier, monospace;font-size:8pt;color:black;"&gt;    )&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;br /&gt;   &lt;pre    style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:'Courier New', courier, monospace;font-size:8pt;color:black;"&gt;    Process {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre face="'Courier New', courier, monospace" size="8pt" color="black" style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0px"&gt;    $msgdate=(get-date).tostring()&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre    style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:'Courier New', courier, monospace;font-size:8pt;color:black;"&gt;&lt;span style="color:#008000;"&gt;#    $msgbody=[System.String]::Format("{0}`r{1}`r{2}",&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre face="'Courier New', courier, monospace" size="8pt" color="black" style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color:#008000;"&gt;#    "Message generated: $msgdate from $env:COMPUTERNAME on $msgdate ",&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre face="'Courier New', courier, monospace" size="8pt" color="black" style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color:#008000;"&gt;#    "The password for your Windows Admin account $usersam is set to expire in $vartil days  ",&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre face="'Courier New', courier, monospace" size="8pt" color="black" style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color:#008000;"&gt;#    "Please verify and change your password."&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre face="'Courier New', courier, monospace" size="8pt" color="black" style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color:#008000;"&gt;#    )&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;br /&gt;   &lt;pre    style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0pxfont-family:'Courier New', courier, monospace;font-size:8pt;color:black;"&gt;&lt;span style="color:#008000;"&gt;# NOTE: Indentation ceased for message text creation&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre face="'Courier New', courier, monospace" size="8pt" color="black" style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0px"&gt;$usrmsgtxt=&lt;span style="color:#006080;"&gt;@"&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre face="'Courier New', courier, monospace" size="8pt" color="black" style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px;  direction: ltr; border-top-style: none;   border-left-style: none; overflow: visible; padding-top: 0px"&gt;Message generated: $msgdate from $env:COMPUTERNAME on $msgdate .&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;The password for your Windows Admin account $usersam is set to expire in $vartil days.  &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;Please verify and change your password.&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;"@ &lt;span style="color:#008000;"&gt;# End of message text assembly&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    $bodytxt =  $usrmsg | out-string&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;$usrmsg = @{&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        Subject = &lt;span style="color:#006080;"&gt;"Windows Admin Account Password Expiration"&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        From = &lt;span style="color:#006080;"&gt;"sender@sendingdomain.com"&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color:#008000;"&gt;# To = $usremail&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        To = &lt;span style="color:#006080;"&gt;"recipient@todomain.com"&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        smtpserver = &lt;span style="color:#006080;"&gt;"servername.yourdomain.com"&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        Body = $bodytxt&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    } &lt;span style="color:#008000;"&gt;# End of mailmessage parameters&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    send-mailmessage @usrmsg&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;No revolutionary code, just a great experience with a great tool and even greater collection of people energized and collaborating for the good of the community.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8670123831612315746-3471981409574808135?l=jkavanagh58.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jkavanagh58.blogspot.com/feeds/3471981409574808135/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jkavanagh58.blogspot.com/2010/04/always-learning.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/3471981409574808135'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/3471981409574808135'/><link rel='alternate' type='text/html' href='http://jkavanagh58.blogspot.com/2010/04/always-learning.html' title='Always Learning'/><author><name>John J. Kavanagh</name><uri>http://www.blogger.com/profile/09799549032576050681</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://1.bp.blogspot.com/_p9k2TTT5uD4/S6pEA4nJmbI/AAAAAAAAAHk/NfBGAs6fsyY/S220/Summer2009.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8670123831612315746.post-5332569168419522415</id><published>2010-04-02T11:03:00.001-04:00</published><updated>2010-04-02T11:21:07.206-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Quest AD cmdlets'/><category scheme='http://www.blogger.com/atom/ns#' term='Profile'/><category scheme='http://www.blogger.com/atom/ns#' term='Powershell'/><title type='text'>Home Drive Mapping</title><content type='html'>&lt;p&gt;So, this one is quick and was primarily meant to be a quick example when presenting on the &lt;a href="http://www.quest.com/powershell/activeroles-server.aspx"&gt;Quest AD&lt;/a&gt; cmdlets.&amp;nbsp; The practical piece is to deal with something we experience when working remotely.&amp;nbsp; Typical scenario, user logs in locally to their laptop and then connect to the corporate network via VPN.&amp;nbsp; The home drive is not mapped because when the desktop state is loaded the VPN connection has not yet been made.&amp;nbsp; So the script showed how to add a little function to their powershell profile so they could simply run the function to make their connection.&lt;/p&gt;&lt;span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: medium 'Times New Roman'; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(0,0,0); word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"&gt;&lt;span style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px" class="Apple-style-span"&gt; &lt;div id="codeSnippetWrapper"&gt; &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; map-homedrive {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;# simple function to map the drive based on your user info&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;$nw = New-Object -ComObject Wscript.Network&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;$nw.MapNetworkDrive((Get-QADUser $env:USERNAME).HomeDrive, (Get-QADUser$env:USERNAME).HomeDirectory)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;p&gt;The script simply&amp;nbsp; determines the current user name ($env:USERNAME), then reads the configured values for the corresponding Active directory object for the drive letter &lt;font size="2"&gt;&lt;font face="Courier New"&gt;(&lt;span style="font-family: 'Courier New'; color: cadetblue; font-size: 10pt"&gt;Get-QADUser&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="font-family: 'Courier New'; color: black; font-size: 10pt"&gt; &lt;/span&gt;&lt;span style="font-family: 'Courier New'; color: purple; font-size: 10pt"&gt;$env:USERNAME&lt;/span&gt;&lt;span style="font-family: 'Courier New'; color: black; font-size: 10pt"&gt;).&lt;/span&gt;&lt;span style="font-family: 'Courier New'; color: saddlebrown; font-size: 10pt"&gt;HomeDrive&lt;/span&gt; and then the path &lt;font size="2"&gt;&lt;font face="Courier New"&gt;(&lt;span style="font-family: 'Courier New'; color: cadetblue; font-size: 10pt"&gt;Get-QADUser&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="font-family: 'Courier New'; color: black; font-size: 10pt"&gt; &lt;/span&gt;&lt;span style="font-family: 'Courier New'; color: purple; font-size: 10pt"&gt;$env:USERNAME&lt;/span&gt;&lt;span style="font-family: 'Courier New'; color: black; font-size: 10pt"&gt;).&lt;/span&gt;&lt;span style="font-family: 'Courier New'; color: saddlebrown; font-size: 10pt"&gt;HomeDirectory&lt;/span&gt; , combining those two values to perform the drive mapping.&amp;nbsp;&amp;nbsp; &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8670123831612315746-5332569168419522415?l=jkavanagh58.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jkavanagh58.blogspot.com/feeds/5332569168419522415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jkavanagh58.blogspot.com/2010/04/home-drive-mapping.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/5332569168419522415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/5332569168419522415'/><link rel='alternate' type='text/html' href='http://jkavanagh58.blogspot.com/2010/04/home-drive-mapping.html' title='Home Drive Mapping'/><author><name>John J. Kavanagh</name><uri>http://www.blogger.com/profile/09799549032576050681</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://1.bp.blogspot.com/_p9k2TTT5uD4/S6pEA4nJmbI/AAAAAAAAAHk/NfBGAs6fsyY/S220/Summer2009.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8670123831612315746.post-9013770298200895839</id><published>2010-03-24T09:00:00.001-04:00</published><updated>2010-03-24T09:20:01.510-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Editor'/><category scheme='http://www.blogger.com/atom/ns#' term='Powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='CLI'/><category scheme='http://www.blogger.com/atom/ns#' term='ISE'/><title type='text'>Editing</title><content type='html'>&lt;p&gt;Just thought I would post a quick note on my experience with the Powershell ISE.&amp;#160; In the past I have stated my preference for Powershell Plus as my Powershell script editor.&amp;#160; I am still a huge fan (well other than the new version seems to have an issue) of the product and in truth it is much more than a script editor.&amp;#160; &lt;/p&gt;  &lt;p&gt;I also enjoy the PowerGUI editor but in general I do not use the PowerGUI suite, but when working on a script on a machine that isn’t my workstation, it was easy to install PowerGUI and have access to a decent editor.&lt;/p&gt;  &lt;p&gt;With Powershell V2, the ISE was introduced.&amp;#160; I had used it briefly when giving an internal demonstration of Powershell to my colleagues.&amp;#160; I also must admit that I tried to customize it using the ISE specific profile but failed miserably and had given up on it.&lt;/p&gt;  &lt;p&gt;A recent project had me developing a script on a server and considering latency it was just easier to RDP into the server and interact with the console.&amp;#160; With the ISE, I had access to an editor and a powershell command line interface without installing PowerGUI or any other software.&amp;#160; I am very impressed with the ISE for developing and debugging scripts.&lt;/p&gt;  &lt;p&gt;That said, I still think Powershell Plus is a great tool set.&amp;#160; Any script editor that includes syntax highlighting is helpful and there are some other niceties such as automatically certificate signing scripts, snippets and code completion.&amp;#160; Where I still use Powershell Plus the most is the actual shell.&amp;#160; Whether working on a script or just simple day to day sell usage, I have found Iuse get-help much less since within the shell I can type a cmdlet or function and it knows about most if not all the parameters and includes links to help documents or searches.&lt;/p&gt;  &lt;p&gt;Okay I have to get back to completing this script.&lt;img alt="" src="http://www.zu14.cn/coolemotion/emotions/zz_2.gif" /&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:8570073d-514f-4a8d-abcc-c17a23bf7bb4" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Software" rel="tag"&gt;Software&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Editor" rel="tag"&gt;Editor&lt;/a&gt;,&lt;a href="http://technorati.com/tags/CLI" rel="tag"&gt;CLI&lt;/a&gt;,&lt;a href="http://technorati.com/tags/ISE" rel="tag"&gt;ISE&lt;/a&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8670123831612315746-9013770298200895839?l=jkavanagh58.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jkavanagh58.blogspot.com/feeds/9013770298200895839/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jkavanagh58.blogspot.com/2010/03/editing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/9013770298200895839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/9013770298200895839'/><link rel='alternate' type='text/html' href='http://jkavanagh58.blogspot.com/2010/03/editing.html' title='Editing'/><author><name>John J. Kavanagh</name><uri>http://www.blogger.com/profile/09799549032576050681</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://1.bp.blogspot.com/_p9k2TTT5uD4/S6pEA4nJmbI/AAAAAAAAAHk/NfBGAs6fsyY/S220/Summer2009.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8670123831612315746.post-3198909115165183991</id><published>2010-03-15T09:27:00.001-04:00</published><updated>2010-03-15T09:27:25.242-04:00</updated><title type='text'>Exploring</title><content type='html'>&lt;p&gt;Yes, there are some duplicates from my other blog.&amp;#160; Sorry about that but I am experimenting with moving my blog.&amp;#160; The Go Daddy admin tools are just too tedious and with the constant wordpress updates, it just seems like time to explore an alternative.&lt;/p&gt;  &lt;p&gt;First annoyance here is displaying code.&amp;#160; Since this is primarily powershell code oriented, that is a big gotcha so I will be experimenting to see if I can work around it.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8670123831612315746-3198909115165183991?l=jkavanagh58.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jkavanagh58.blogspot.com/feeds/3198909115165183991/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jkavanagh58.blogspot.com/2010/03/exploring.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/3198909115165183991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/3198909115165183991'/><link rel='alternate' type='text/html' href='http://jkavanagh58.blogspot.com/2010/03/exploring.html' title='Exploring'/><author><name>John J. Kavanagh</name><uri>http://www.blogger.com/profile/09799549032576050681</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://1.bp.blogspot.com/_p9k2TTT5uD4/S6pEA4nJmbI/AAAAAAAAAHk/NfBGAs6fsyY/S220/Summer2009.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8670123831612315746.post-5578858875705701865</id><published>2010-03-15T08:07:00.001-04:00</published><updated>2010-04-02T11:34:06.518-04:00</updated><title type='text'>Version 2 vs CTP3 – Test-connection</title><content type='html'>&lt;p&gt;Interesting little discovery.&amp;nbsp; Working an a new Windows2008 R2 Server I started working with the test-connection cmdlet.&amp;nbsp; After testing some code I was ready to reduce some lines of code in some production scripts.&amp;nbsp; I quickly found out that &lt;em&gt;&lt;font color="#008000"&gt;test-connection &amp;lt;machine name&amp;gt; –quiet&lt;/font&gt;&lt;/em&gt; doesn’t work.&amp;nbsp; This would have helped because in current scripts there is an elaborate use of ping and reading the results which with Powershell V2 can be replaced with:&lt;/p&gt; &lt;div id="codeSnippetWrapper"&gt; &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (test-connection &amp;lt;machine name or ip&amp;gt; -quiet){ &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #008000"&gt;# Some code here } &lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;Else {&lt;span style="color: #006080"&gt;"Can not contact target machine"&lt;/span&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Well I will have to put this in the snippet library and put it into action when the full version 2 is available for XP.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8670123831612315746-5578858875705701865?l=jkavanagh58.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jkavanagh58.blogspot.com/feeds/5578858875705701865/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jkavanagh58.blogspot.com/2010/03/version-2-vs-ctp3-test-connection.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/5578858875705701865'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/5578858875705701865'/><link rel='alternate' type='text/html' href='http://jkavanagh58.blogspot.com/2010/03/version-2-vs-ctp3-test-connection.html' title='Version 2 vs CTP3 – Test-connection'/><author><name>John J. Kavanagh</name><uri>http://www.blogger.com/profile/09799549032576050681</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://1.bp.blogspot.com/_p9k2TTT5uD4/S6pEA4nJmbI/AAAAAAAAAHk/NfBGAs6fsyY/S220/Summer2009.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8670123831612315746.post-5440423739445401327</id><published>2010-03-09T22:14:00.001-05:00</published><updated>2010-04-02T11:30:30.675-04:00</updated><title type='text'>Scripting On the Fly</title><content type='html'>&lt;p&gt;Okay so this code is not the elegant sort of code you see on other sites, it is truly a SysAdmin writing functional code while performing Admin functions (hence why the output is handle on the command line and not inside of the script).&amp;nbsp; &lt;/p&gt; &lt;p&gt;The patch released this past week to address the critical security vulnerability in Internet Explorer prompted action.&amp;nbsp; On a Friday evening the call went out to get all servers patched this weekend.&amp;nbsp; Having gone through this before I also knew someone will be asking for a report of what servers have been patched.&amp;nbsp; In the past I would have written something in vbscript.&amp;nbsp; &lt;/p&gt; &lt;p&gt;First step was to verify the WMI portion, to include the segment that would indicate the patch had been installed.&amp;nbsp; Going back one step, there had been a similar critical patch and was never able to get the Powershell code (V1) to work and ended up going with vbscript.&amp;nbsp; After verifying the WMI with some test cases, I passed on how to use Powershell to check a server to include offering my colleagues a WMIC alternative.&lt;/p&gt; &lt;p&gt;This code was tweaked several times, as the weekend progressed.&amp;nbsp; The final step was to provide more feedback.&amp;nbsp; At first it would just report, could not connect, installed and not installed.&amp;nbsp; I knew people would raise the eyebrows with that information.&amp;nbsp; I knew that things such as test-connection failing could be for several reasons and leaving it at “could not connect” would make the report suspect.&amp;nbsp; Also, the WMI query returning no data could mean the patch wasn’t installed but it could be because of other reasons such as Access Denied or RPC issues.&lt;/p&gt; &lt;p&gt;So the process was, patch a server while the code was running, keep checking the output looking for anomalies.&amp;nbsp; Then with some extra time I started looking at how I could include the current error data to the output instead of the generalized result I was presenting at first.&lt;/p&gt; &lt;p&gt;Below is the code, caution any of you Powershell purists because it might not be pretty but seems to work. :-)&lt;/p&gt; &lt;div id="codeSnippetWrapper"&gt; &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;#requires -Version 2&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;lt;&lt;span style="color: #008000"&gt;#&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;.SYNOPSIS&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      Checks &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; install status of KB978207.&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;.DESCRIPTION&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      Uses a source file of server names, makes sure the server can be connected to,&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      then uses WMI to query the QFE information.  Looks &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; the instance &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; the QFE&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      where HotFixID matches 978207.  &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;.EXAMPLE&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      c:\temp\run.ps1 | out-file c:\temp\audwstats.txt&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;.LINK&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      http://www.microsoft.com/technet/security/bulletin/ms10-002.mspx&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;#&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; chk-updt {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;$curError=$Error.count    &lt;span style="color: #008000"&gt;# establish current index of the error variable&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;$qfedat = gwmi win32_quickfixengineering -computer $server  |  where {$_.hotfixid &lt;span style="color: #cc6633"&gt;-like&lt;/span&gt; &lt;span style="color: #006080"&gt;"*978207*"&lt;/span&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      &lt;span style="color: #008000"&gt;#if no data is returned the qfedat variable will be null&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; ($qfedat &lt;span style="color: #cc6633"&gt;-eq&lt;/span&gt; $Null){&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      &lt;span style="color: #008000"&gt;# Since no data was returned check to see if that was because of an error, if so report the &lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      &lt;span style="color: #008000"&gt;# returned error message&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;          &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; ($Error.count &lt;span style="color: #cc6633"&gt;-gt&lt;/span&gt; $curError){$server + &lt;span style="color: #006080"&gt;": "&lt;/span&gt; + $Error[0].Exception.Message}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;          &lt;span style="color: #008000"&gt;# No error generated by WMI query so consider the patch not installed&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;          &lt;span style="color: #0000ff"&gt;else&lt;/span&gt; {&lt;span style="color: #006080"&gt;"Patch not installed on "&lt;/span&gt; + $server}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;       } &lt;span style="color: #008000"&gt;# Finished processing Null $qfedat&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      &lt;span style="color: #008000"&gt;# An instance was returned therefore the patch has been installed &lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      &lt;span style="color: #0000ff"&gt;else&lt;/span&gt; {$qfedat.HotFixID + &lt;span style="color: #006080"&gt;" Installed on "&lt;/span&gt; + $server}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}  &lt;span style="color: #008000"&gt;# end chk-updt&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;# Format report header&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;get-date&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #006080"&gt;"-----------------------------------------------------------------------"&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;$ErrorActionPreference=&lt;span style="color: #006080"&gt;"SilentlyContinue"&lt;/span&gt;       &lt;span style="color: #008000"&gt;# Keep the screen chatter done and continue after error&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;$noconnect=0&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;$servers = gc c:\temp\full.txt                              &lt;span style="color: #008000"&gt;# Define array of server names from text file&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt; ($server &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; $servers) {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      &lt;span style="color: #008000"&gt;# verify the server can be connected, if it can call the chk-updt function&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (Test-Connection $server -Count 1){chk-updt}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      &lt;span style="color: #008000"&gt;# if the server can not be connected, report the specific reason for failure&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      &lt;span style="color: #0000ff"&gt;else&lt;/span&gt; { $server + &lt;span style="color: #006080"&gt;": "&lt;/span&gt; + $error[0].Exception.Message&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;          $noconnect=$noconnect +1 }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #006080"&gt;"-----------------------------------------------------------------------"&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #006080"&gt;"Servers Checked:  "&lt;/span&gt; + $servers.count &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #006080"&gt;"Servers not reachable: "&lt;/span&gt; + $noconnect&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;get-date&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;br /&gt;&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&amp;nbsp;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;&lt;pre class="alt"&gt;&amp;nbsp;&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8670123831612315746-5440423739445401327?l=jkavanagh58.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jkavanagh58.blogspot.com/feeds/5440423739445401327/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jkavanagh58.blogspot.com/2010/03/scripting-on-fly.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/5440423739445401327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/5440423739445401327'/><link rel='alternate' type='text/html' href='http://jkavanagh58.blogspot.com/2010/03/scripting-on-fly.html' title='Scripting On the Fly'/><author><name>John J. Kavanagh</name><uri>http://www.blogger.com/profile/09799549032576050681</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://1.bp.blogspot.com/_p9k2TTT5uD4/S6pEA4nJmbI/AAAAAAAAAHk/NfBGAs6fsyY/S220/Summer2009.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8670123831612315746.post-6305397444814346022</id><published>2009-08-18T00:29:00.000-04:00</published><updated>2010-04-10T00:32:42.471-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WMI'/><category scheme='http://www.blogger.com/atom/ns#' term='Powershell'/><title type='text'>One-Liners</title><content type='html'>&lt;p&gt;As I mentioned in the previous post I have not written any formal scripts in some time.&amp;nbsp; I have focused on one-liners recently.&amp;nbsp; What is a one-liner you ask?&amp;nbsp; Powershell offers a great deal of tools that can be called up and used right from the Powershell command line.&amp;nbsp; &lt;/p&gt; &lt;p&gt;I think this is were Windows SysAdmins need to catch on to Powershell.&amp;nbsp; Scripts are great, especially for repetitive or large tasks but sometimes that is too cumbersome when you need to tackle a quick task or return information quickly.&amp;nbsp; &lt;/p&gt; &lt;p&gt;How does this apply?&amp;nbsp; We were recently asked to verify the specific version of Windows installed on a list of machines.&amp;nbsp; Yes, I had written a vbscript a few years ago to do that but wanted to approach it with Powershell.&amp;nbsp; Being lazy, I knew WMI would return the information so looking at my existing script I started with a simple wmi query: &lt;em&gt;&lt;font color="#008000"&gt;gwmi win32_operatingsystem&lt;/font&gt;&lt;/em&gt;, which returns several useful fields of data such as Build Number and Version.&amp;nbsp; For our use they wanted the publicly known name which I knew from previous of WMI was the Caption field so I was able to expand the one-liner to &lt;em&gt;&lt;font color="#008000"&gt;gwmi win32_operatingsystem | select caption&lt;/font&gt;&lt;/em&gt; so now I am accessing the same collection of information but now I am selecting just a specific field which is the Publicly known name of the operating system.&lt;/p&gt; &lt;p&gt;&lt;font color="#595959" size="2" face="Tahoma"&gt;caption &lt;br&gt;------- &lt;br&gt;Microsoft Windows 7 Ultimate&lt;/font&gt;&lt;/p&gt; &lt;p&gt;So, you are sitting there and saying “I can just right click on the computer object and check properties”, but what if you wanted to check a remote computer, now you have to access that computer, with the one-liner I simply add the –computername parameter, as long as I have the necessary credentials I can return the same information from that computer.&lt;/p&gt; &lt;p&gt;Pretty easy right?&amp;nbsp; Pretty low key example though.&amp;nbsp; Now consider the ability to do the same type of operations with things like Active Directory and Exchange.&amp;nbsp; I have found it interesting that while on a conference call in the past, a request for information would be requested and the standard answer was a script, now in many cases a quick one-liner produces the basic information ASAP.&amp;nbsp; This is so much fun when someone estimates data and you can counter with the actual data, makes planning much more precise.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8670123831612315746-6305397444814346022?l=jkavanagh58.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jkavanagh58.blogspot.com/feeds/6305397444814346022/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jkavanagh58.blogspot.com/2009/08/one-liners.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/6305397444814346022'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8670123831612315746/posts/default/6305397444814346022'/><link rel='alternate' type='text/html' href='http://jkavanagh58.blogspot.com/2009/08/one-liners.html' title='One-Liners'/><author><name>John J. Kavanagh</name><uri>http://www.blogger.com/profile/09799549032576050681</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='http://1.bp.blogspot.com/_p9k2TTT5uD4/S6pEA4nJmbI/AAAAAAAAAHk/NfBGAs6fsyY/S220/Summer2009.JPG'/></author><thr:total>0</thr:total></entry></feed>
