<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>CommandBreak_ - Powershell</title>
    <link>http://www.commandbreak.com/</link>
    <description>sometimes Next isn't enough</description>
    <language>en-us</language>
    <copyright>Ben Parker</copyright>
    <lastBuildDate>Sat, 19 Jun 2010 08:24:23 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.0.7226.0</generator>
    <managingEditor>bparker@commandbreak.com</managingEditor>
    <webMaster>bparker@commandbreak.com</webMaster>
    <item>
      <trackback:ping>http://www.commandbreak.com/Trackback.aspx?guid=39f0c6dc-81d4-41d3-aa2f-02d42311ef44</trackback:ping>
      <pingback:server>http://www.commandbreak.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.commandbreak.com/PermaLink,guid,39f0c6dc-81d4-41d3-aa2f-02d42311ef44.aspx</pingback:target>
      <dc:creator>Ben Parker</dc:creator>
      <wfw:commentRss>http://www.commandbreak.com/SyndicationService.asmx/GetEntryCommentsRss?guid=39f0c6dc-81d4-41d3-aa2f-02d42311ef44</wfw:commentRss>
      <title>Convert Office XML formats to Office 97-2003 with PowerShell</title>
      <guid isPermaLink="false">http://www.commandbreak.com/PermaLink,guid,39f0c6dc-81d4-41d3-aa2f-02d42311ef44.aspx</guid>
      <link>http://www.commandbreak.com/2010/06/19/ConvertOfficeXMLFormatsToOffice972003WithPowerShell.aspx</link>
      <pubDate>Sat, 19 Jun 2010 08:24:23 GMT</pubDate>
      <description>&lt;link rel="File-List" href="file:///C:%5CUsers%5CBenP%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;o:OfficeDocumentSettings&gt;
  &lt;o:AllowPNG/&gt;
 &lt;/o:OfficeDocumentSettings&gt;
&lt;/xml&gt;&lt;![endif]--&gt;
&lt;link rel="themeData" href="file:///C:%5CUsers%5CBenP%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"&gt;
&lt;link rel="colorSchemeMapping" href="file:///C:%5CUsers%5CBenP%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:TrackMoves/&gt;
  &lt;w:TrackFormatting/&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:DoNotPromoteQF/&gt;
  &lt;w:LidThemeOther&gt;EN-AU&lt;/w:LidThemeOther&gt;
  &lt;w:LidThemeAsian&gt;X-NONE&lt;/w:LidThemeAsian&gt;
  &lt;w:LidThemeComplexScript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
   &lt;w:SplitPgBreakAndParaMark/&gt;
   &lt;w:EnableOpenTypeKerning/&gt;
   &lt;w:DontFlipMirrorIndents/&gt;
   &lt;w:OverrideTableStyleHps/&gt;
  &lt;/w:Compatibility&gt;
  &lt;m:mathPr&gt;
   &lt;m:mathFont m:val="Cambria Math"/&gt;
   &lt;m:brkBin m:val="before"/&gt;
   &lt;m:brkBinSub m:val="&amp;#45;-"/&gt;
   &lt;m:smallFrac m:val="off"/&gt;
   &lt;m:dispDef/&gt;
   &lt;m:lMargin m:val="0"/&gt;
   &lt;m:rMargin m:val="0"/&gt;
   &lt;m:defJc m:val="centerGroup"/&gt;
   &lt;m:wrapIndent m:val="1440"/&gt;
   &lt;m:intLim m:val="subSup"/&gt;
   &lt;m:naryLim m:val="undOvr"/&gt;
  &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
  DefSemiHidden="true" DefQFormat="false" DefPriority="99"
  LatentStyleCount="267"&gt;
  &lt;w:LsdException Locked="false" Priority="0" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Normal"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="heading 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 7"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 8"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 9"/&gt;
  &lt;w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/&gt;
  &lt;w:LsdException Locked="false" Priority="10" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Title"/&gt;
  &lt;w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/&gt;
  &lt;w:LsdException Locked="false" Priority="11" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/&gt;
  &lt;w:LsdException Locked="false" Priority="22" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Strong"/&gt;
  &lt;w:LsdException Locked="false" Priority="20" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/&gt;
  &lt;w:LsdException Locked="false" Priority="59" SemiHidden="false"
   UnhideWhenUsed="false" Name="Table Grid"/&gt;
  &lt;w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/&gt;
  &lt;w:LsdException Locked="false" Priority="1" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/&gt;
  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading"/&gt;
  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List"/&gt;
  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid"/&gt;
  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List"/&gt;
  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading"/&gt;
  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List"/&gt;
  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid"/&gt;
  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/&gt;
  &lt;w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/&gt;
  &lt;w:LsdException Locked="false" Priority="34" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/&gt;
  &lt;w:LsdException Locked="false" Priority="29" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Quote"/&gt;
  &lt;w:LsdException Locked="false" Priority="30" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/&gt;
  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="19" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/&gt;
  &lt;w:LsdException Locked="false" Priority="21" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/&gt;
  &lt;w:LsdException Locked="false" Priority="31" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/&gt;
  &lt;w:LsdException Locked="false" Priority="32" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/&gt;
  &lt;w:LsdException Locked="false" Priority="33" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Book Title"/&gt;
  &lt;w:LsdException Locked="false" Priority="37" Name="Bibliography"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/&gt;
 &lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt;
&lt;!--
 /* Font Definitions */
 @font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:-520092929 1073786111 9 0 415 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-parent:"";
	margin-top:0cm;
	margin-right:0cm;
	margin-bottom:10.0pt;
	margin-left:0cm;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;
	mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	mso-themecolor:hyperlink;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-noshow:yes;
	mso-style-priority:99;
	color:purple;
	mso-themecolor:followedhyperlink;
	text-decoration:underline;
	text-underline:single;}
.MsoChpDefault
	{mso-style-type:export-only;
	mso-default-props:yes;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;
	mso-fareast-language:EN-US;}
.MsoPapDefault
	{mso-style-type:export-only;
	margin-bottom:10.0pt;
	line-height:115%;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;
	mso-header-margin:36.0pt;
	mso-footer-margin:36.0pt;
	mso-paper-source:0;}
div.WordSection1
	{page:WordSection1;}
--&gt;
&lt;/style&gt;
&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-priority:99;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin-top:0cm;
	mso-para-margin-right:0cm;
	mso-para-margin-bottom:10.0pt;
	mso-para-margin-left:0cm;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:"Times New Roman";
	mso-bidi-theme-font:minor-bidi;
	mso-fareast-language:EN-US;}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;p class="MsoNormal"&gt;
In the past I have spent some time with the Office Automation APIs and with the recent
release of Office 2010, it seems as good as any time to open up Pandora’s Box and
try again.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
I have bundled up some basic functions for converting Word, Excel and PowerPoint documents
to the previous version; you can find them here at &lt;a href="content/binary/convert_Officefiles.zip"&gt;http://www.commandbreak.com/content/binary/convert_Officefiles.zip&lt;/a&gt;.
Not much has changed and these functions all utilise the Application.Open and Application.SaveAs
methods.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
Enjoy&lt;o:p&gt;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.commandbreak.com/aggbug.ashx?id=39f0c6dc-81d4-41d3-aa2f-02d42311ef44" /&gt;</description>
      <comments>http://www.commandbreak.com/CommentView,guid,39f0c6dc-81d4-41d3-aa2f-02d42311ef44.aspx</comments>
      <category>Powershell</category>
      <category>Office</category>
    </item>
    <item>
      <trackback:ping>http://www.commandbreak.com/Trackback.aspx?guid=f7282716-1176-4cfa-aeaf-03675467f54b</trackback:ping>
      <pingback:server>http://www.commandbreak.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.commandbreak.com/PermaLink,guid,f7282716-1176-4cfa-aeaf-03675467f54b.aspx</pingback:target>
      <dc:creator>Ben Parker</dc:creator>
      <wfw:commentRss>http://www.commandbreak.com/SyndicationService.asmx/GetEntryCommentsRss?guid=f7282716-1176-4cfa-aeaf-03675467f54b</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
Attached are all the 'bits' from my presentation to the PowerShell Usergroup, I will
follow up with a post on signing your scripts in the next day or so.<br /><br />
Thank you to all those who attended.<br /><br /><a href="http://www.commandbreak.com/content/binary/PSUGAU.zip">PSUGAU.zip (894.05
KB)</a><img width="0" height="0" src="http://www.commandbreak.com/aggbug.ashx?id=f7282716-1176-4cfa-aeaf-03675467f54b" /></body>
      <title>PSUGAU - Getting your scripts production ready</title>
      <guid isPermaLink="false">http://www.commandbreak.com/PermaLink,guid,f7282716-1176-4cfa-aeaf-03675467f54b.aspx</guid>
      <link>http://www.commandbreak.com/2010/05/06/PSUGAUGettingYourScriptsProductionReady.aspx</link>
      <pubDate>Thu, 06 May 2010 23:14:58 GMT</pubDate>
      <description>&lt;p&gt;
&lt;/p&gt;
Attached are all the 'bits' from my presentation to the PowerShell Usergroup, I will
follow up with a post on signing your scripts in the next day or so.&lt;br&gt;
&lt;br&gt;
Thank you to all those who attended.&lt;br&gt;
&lt;br&gt;
&lt;a href="http://www.commandbreak.com/content/binary/PSUGAU.zip"&gt;PSUGAU.zip (894.05
KB)&lt;/a&gt;&lt;img width="0" height="0" src="http://www.commandbreak.com/aggbug.ashx?id=f7282716-1176-4cfa-aeaf-03675467f54b" /&gt;</description>
      <comments>http://www.commandbreak.com/CommentView,guid,f7282716-1176-4cfa-aeaf-03675467f54b.aspx</comments>
      <category>Powershell</category>
      <category>User Group</category>
    </item>
    <item>
      <trackback:ping>http://www.commandbreak.com/Trackback.aspx?guid=b3a74f3d-4ddc-4397-b445-1ecc00d6b0a5</trackback:ping>
      <pingback:server>http://www.commandbreak.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.commandbreak.com/PermaLink,guid,b3a74f3d-4ddc-4397-b445-1ecc00d6b0a5.aspx</pingback:target>
      <dc:creator>Ben Parker</dc:creator>
      <wfw:commentRss>http://www.commandbreak.com/SyndicationService.asmx/GetEntryCommentsRss?guid=b3a74f3d-4ddc-4397-b445-1ecc00d6b0a5</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
Attached is the slide deck from my presentation at this mornings Brisbane PowerShell
User Group.<br /><br />
You will find all references and silde comments for my presentation.<br /><br /><a href="http://www.commandbreak.com/content/binary/PSUGAU%20-%20PSProviders%20in%2010%20minutes.pptx">PSUGAU
- PSProviders in 10 minutes.pptx (764.12 KB)</a><img width="0" height="0" src="http://www.commandbreak.com/aggbug.ashx?id=b3a74f3d-4ddc-4397-b445-1ecc00d6b0a5" /></body>
      <title>PSUGAU - PSProviders in 10 minutes</title>
      <guid isPermaLink="false">http://www.commandbreak.com/PermaLink,guid,b3a74f3d-4ddc-4397-b445-1ecc00d6b0a5.aspx</guid>
      <link>http://www.commandbreak.com/2010/04/08/PSUGAUPSProvidersIn10Minutes.aspx</link>
      <pubDate>Thu, 08 Apr 2010 01:51:10 GMT</pubDate>
      <description>&lt;p&gt;
&lt;/p&gt;
Attached is the slide deck from my presentation at this mornings Brisbane PowerShell
User Group.&lt;br&gt;
&lt;br&gt;
You will find all references and silde comments for my presentation.&lt;br&gt;
&lt;br&gt;
&lt;a href="http://www.commandbreak.com/content/binary/PSUGAU%20-%20PSProviders%20in%2010%20minutes.pptx"&gt;PSUGAU
- PSProviders in 10 minutes.pptx (764.12 KB)&lt;/a&gt;&lt;img width="0" height="0" src="http://www.commandbreak.com/aggbug.ashx?id=b3a74f3d-4ddc-4397-b445-1ecc00d6b0a5" /&gt;</description>
      <comments>http://www.commandbreak.com/CommentView,guid,b3a74f3d-4ddc-4397-b445-1ecc00d6b0a5.aspx</comments>
      <category>Powershell</category>
      <category>User Group</category>
    </item>
    <item>
      <trackback:ping>http://www.commandbreak.com/Trackback.aspx?guid=74330801-e604-4f5e-a364-89fe084a41cf</trackback:ping>
      <pingback:server>http://www.commandbreak.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.commandbreak.com/PermaLink,guid,74330801-e604-4f5e-a364-89fe084a41cf.aspx</pingback:target>
      <dc:creator>Ben Parker</dc:creator>
      <wfw:comment>http://www.commandbreak.com/CommentView,guid,74330801-e604-4f5e-a364-89fe084a41cf.aspx</wfw:comment>
      <wfw:commentRss>http://www.commandbreak.com/SyndicationService.asmx/GetEntryCommentsRss?guid=74330801-e604-4f5e-a364-89fe084a41cf</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
It would appear that most of the corporate world is still running Office 2003, which
is fine - I am sure you have your reasons! But why the F*(K haven't you deployed
the compatibility pack to view Office 2007 documents?
</p>
        <p>
The hassle more than likely comes back to the sender (you!!) with a request to
change the format of their documents, and although it isn't really my problem I have
to oblige (otherwise, they may not pay my invoice).
</p>
        <p>
==========<br />
RANT OVER<br />
==========
</p>
        <p>
The script below will convert any Office 2007 (DOCX) files in a folder to a Office
97-2003 (DOC) format using the Office automation API.
</p>
        <b>
          <font color="#5f9ea0" size="2" face="Courier New">
            <font color="#5f9ea0" size="2" face="Courier New">
              <font color="#5f9ea0" size="2" face="Courier New">
                <p>
get-childItem
</p>
              </font>
            </font>
          </font>
        </b>
        <font size="2" face="Courier New">
          <font color="#000000" size="2" face="Courier New">
          </font>
        </font>
        <i>
          <font color="#5f9ea0" size="2" face="Courier New">
            <font color="#5f9ea0" size="2" face="Courier New">
              <font color="#5f9ea0" size="2" face="Courier New">-filter
</font>
            </font>
          </font>
        </i>
        <font size="2" face="Courier New">
          <font color="#000000" size="2" face="Courier New"> *.docx
| </font>
        </font>
        <b>
          <font color="#5f9ea0" size="2" face="Courier New">
            <font color="#5f9ea0" size="2" face="Courier New">
              <font color="#5f9ea0" size="2" face="Courier New">foreach
</font>
            </font>
          </font>
        </b>
        <font size="2" face="Courier New">
          <font size="2" face="Courier New">
            <font color="#000000"> {<br />
   </font>
          </font>
        </font>
        <font color="#800080" size="2" face="Courier New">
          <font color="#800080" size="2" face="Courier New">
            <font color="#800080" size="2" face="Courier New">$doc</font>
          </font>
        </font>
        <font size="2" face="Courier New">
          <font size="2" face="Courier New">
          </font>
        </font>
        <font color="#ff0000" size="2" face="Courier New">
          <font color="#ff0000" size="2" face="Courier New">
            <font color="#ff0000" size="2" face="Courier New">=</font>
          </font>
        </font>
        <font size="2" face="Courier New">
          <font size="2" face="Courier New">
          </font>
        </font>
        <font color="#800000" size="2" face="Courier New">
          <font color="#800000" size="2" face="Courier New">
            <font color="#800000" size="2" face="Courier New">"$($_.fullname)"<br />
   </font>
          </font>
        </font>
        <font color="#800080" size="2" face="Courier New">
          <font color="#800080" size="2" face="Courier New">
            <font color="#800080" size="2" face="Courier New">$2000doc</font>
          </font>
        </font>
        <font size="2" face="Courier New">
          <font size="2" face="Courier New">
          </font>
        </font>
        <font color="#ff0000" size="2" face="Courier New">
          <font color="#ff0000" size="2" face="Courier New">
            <font color="#ff0000" size="2" face="Courier New">=</font>
          </font>
        </font>
        <font size="2" face="Courier New">
          <font size="2" face="Courier New"> $(</font>
        </font>
        <font color="#800080" size="2" face="Courier New">
          <font color="#800080" size="2" face="Courier New">
            <font color="#800080" size="2" face="Courier New">$doc</font>
          </font>
        </font>
        <font size="2" face="Courier New">
          <font size="2" face="Courier New">.substring(0,$(</font>
        </font>
        <font color="#800080" size="2" face="Courier New">
          <font color="#800080" size="2" face="Courier New">
            <font color="#800080" size="2" face="Courier New">$doc</font>
          </font>
        </font>
        <font size="2" face="Courier New">
          <font size="2" face="Courier New">.length </font>
        </font>
        <font color="#ff0000" size="2" face="Courier New">
          <font color="#ff0000" size="2" face="Courier New">
            <font color="#ff0000" size="2" face="Courier New">-</font>
          </font>
        </font>
        <font size="2" face="Courier New">
          <font size="2" face="Courier New"> 1)))<br />
   </font>
        </font>
        <font color="#800080" size="2" face="Courier New">
          <font color="#800080" size="2" face="Courier New">
            <font color="#800080" size="2" face="Courier New">$office</font>
          </font>
        </font>
        <font size="2" face="Courier New">
          <font size="2" face="Courier New">
          </font>
        </font>
        <font color="#ff0000" size="2" face="Courier New">
          <font color="#ff0000" size="2" face="Courier New">
            <font color="#ff0000" size="2" face="Courier New">=</font>
          </font>
        </font>
        <font size="2" face="Courier New">
          <font size="2" face="Courier New">
          </font>
        </font>
        <b>
          <font color="#5f9ea0" size="2" face="Courier New">
            <font color="#5f9ea0" size="2" face="Courier New">
              <font color="#5f9ea0" size="2" face="Courier New">New-Object
</font>
            </font>
          </font>
        </b>
        <font size="2" face="Courier New">
          <font size="2" face="Courier New">
          </font>
        </font>
        <i>
          <font color="#5f9ea0" size="2" face="Courier New">
            <font color="#5f9ea0" size="2" face="Courier New">
              <font color="#5f9ea0" size="2" face="Courier New">-ComObject
</font>
            </font>
          </font>
        </i>
        <font size="2" face="Courier New">
          <font size="2" face="Courier New">
          </font>
        </font>
        <font color="#800000" size="2" face="Courier New">
          <font color="#800000" size="2" face="Courier New">
            <font color="#800000" size="2" face="Courier New">word.application<br /><br />
   </font>
          </font>
        </font>
        <b>
          <font color="#5f9ea0" size="2" face="Courier New">
            <font color="#5f9ea0" size="2" face="Courier New">
              <font color="#5f9ea0" size="2" face="Courier New">write-host
</font>
            </font>
          </font>
        </b>
        <font size="2" face="Courier New">
          <font size="2" face="Courier New">
          </font>
        </font>
        <font color="#800000" size="2" face="Courier New">
          <font color="#800000" size="2" face="Courier New">
            <font color="#800000" size="2" face="Courier New">"Opening
- $doc"<br />
   </font>
          </font>
        </font>
        <font color="#800080" size="2" face="Courier New">
          <font color="#800080" size="2" face="Courier New">
            <font color="#800080" size="2" face="Courier New">$word</font>
          </font>
        </font>
        <font size="2" face="Courier New">
          <font size="2" face="Courier New">
          </font>
        </font>
        <font color="#ff0000" size="2" face="Courier New">
          <font color="#ff0000" size="2" face="Courier New">
            <font color="#ff0000" size="2" face="Courier New">=</font>
          </font>
        </font>
        <font size="2" face="Courier New">
          <font size="2" face="Courier New">
          </font>
        </font>
        <font color="#800080" size="2" face="Courier New">
          <font color="#800080" size="2" face="Courier New">
            <font color="#800080" size="2" face="Courier New">$office</font>
          </font>
        </font>
        <font size="2" face="Courier New">
          <font size="2" face="Courier New">.Documents.Open(</font>
        </font>
        <font color="#800080" size="2" face="Courier New">
          <font color="#800080" size="2" face="Courier New">
            <font color="#800080" size="2" face="Courier New">$doc</font>
          </font>
        </font>
        <font size="2" face="Courier New">
          <font size="2" face="Courier New">)<br /><br />
   </font>
        </font>
        <b>
          <font color="#5f9ea0" size="2" face="Courier New">
            <font color="#5f9ea0" size="2" face="Courier New">
              <font color="#5f9ea0" size="2" face="Courier New">write-host
</font>
            </font>
          </font>
        </b>
        <font size="2" face="Courier New">
          <font size="2" face="Courier New">
          </font>
        </font>
        <font color="#800000" size="2" face="Courier New">
          <font color="#800000" size="2" face="Courier New">
            <font color="#800000" size="2" face="Courier New">"Saving
- $2000doc"<br />
   </font>
          </font>
        </font>
        <font color="#800080" size="2" face="Courier New">
          <font color="#800080" size="2" face="Courier New">
            <font color="#800080" size="2" face="Courier New">$word</font>
          </font>
        </font>
        <font size="2" face="Courier New">
          <font size="2" face="Courier New">.SaveAs2000(</font>
        </font>
        <font color="#800080" size="2" face="Courier New">
          <font color="#800080" size="2" face="Courier New">
            <font color="#800080" size="2" face="Courier New">$2000doc</font>
          </font>
        </font>
        <font size="2" face="Courier New">
          <font size="2" face="Courier New">)<br /><br />
   </font>
        </font>
        <font color="#800080" size="2" face="Courier New">
          <font color="#800080" size="2" face="Courier New">
            <font color="#800080" size="2" face="Courier New">$word</font>
          </font>
        </font>
        <font size="2" face="Courier New">
          <font size="2" face="Courier New">.close()<br />
   </font>
        </font>
        <font color="#800080" size="2" face="Courier New">
          <font color="#800080" size="2" face="Courier New">
            <font color="#800080" size="2" face="Courier New">$office</font>
          </font>
        </font>
        <font size="2" face="Courier New">
          <font size="2" face="Courier New">.quit()<br />
}
</font>
        </font>
        <img width="0" height="0" src="http://www.commandbreak.com/aggbug.ashx?id=74330801-e604-4f5e-a364-89fe084a41cf" />
      </body>
      <title>Convert DOCX to DOC with PowerShell</title>
      <guid isPermaLink="false">http://www.commandbreak.com/PermaLink,guid,74330801-e604-4f5e-a364-89fe084a41cf.aspx</guid>
      <link>http://www.commandbreak.com/2009/03/31/ConvertDOCXToDOCWithPowerShell.aspx</link>
      <pubDate>Tue, 31 Mar 2009 09:20:46 GMT</pubDate>
      <description>&lt;p&gt;
It would appear that most of the corporate world is still running Office 2003, which
is fine - I am sure you have your reasons! But why the&amp;nbsp;F*(K haven't you deployed
the compatibility pack to view Office 2007 documents?
&lt;/p&gt;
&lt;p&gt;
The hassle more than likely comes back to the sender (you!!)&amp;nbsp;with a request to
change the format of their documents, and although it isn't really my problem I have
to oblige (otherwise, they may not pay my invoice).
&lt;/p&gt;
&lt;p&gt;
==========&lt;br&gt;
RANT OVER&lt;br&gt;
==========
&lt;/p&gt;
&lt;p&gt;
The script below will convert any Office 2007 (DOCX) files in a folder to a Office
97-2003 (DOC) format&amp;nbsp;using the Office automation API.
&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;font color=#5f9ea0 size=2 face="Courier New"&gt; 
&lt;p&gt;
get-childItem
&lt;/b&gt;&gt;&gt;&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;-filter
&lt;/i&gt;&gt;&gt;&gt;&lt;font size=2 face="Courier New"&gt;&lt;font color=#000000 size=2 face="Courier New"&gt; *.docx
| &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;foreach
&lt;/b&gt;&gt;&gt;&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;
&amp;nbsp;&amp;nbsp; &lt;/font&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;$doc&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;=&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;"$($_.fullname)"&lt;br&gt;
&amp;nbsp;&amp;nbsp; &lt;/font&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;$2000doc&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;=&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;$doc&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;.substring(0,$(&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;$doc&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;.length &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; 1)))&lt;br&gt;
&amp;nbsp;&amp;nbsp; &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;$office&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;=&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;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;New-Object
&lt;/b&gt;&gt;&gt;&gt;&lt;font size=2 face="Courier New"&gt;&lt;font 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;-ComObject
&lt;/i&gt;&gt;&gt;&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;word.application&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp; &lt;/font&gt;&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;write-host
&lt;/b&gt;&gt;&gt;&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;"Opening
- $doc"&lt;br&gt;
&amp;nbsp;&amp;nbsp; &lt;/font&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;$word&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;=&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;$office&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;.Documents.Open(&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;$doc&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;
&lt;br&gt;
&amp;nbsp;&amp;nbsp; &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;write-host
&lt;/b&gt;&gt;&gt;&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;"Saving
- $2000doc"&lt;br&gt;
&amp;nbsp;&amp;nbsp; &lt;/font&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;$word&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;.SaveAs2000(&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;$2000doc&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;
&lt;br&gt;
&amp;nbsp;&amp;nbsp; &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;$word&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;.close()&lt;br&gt;
&amp;nbsp;&amp;nbsp; &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;$office&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;.quit()&lt;br&gt;
}&gt;
&lt;/font&gt;&lt;/font&gt;&lt;img width="0" height="0" src="http://www.commandbreak.com/aggbug.ashx?id=74330801-e604-4f5e-a364-89fe084a41cf" /&gt;</description>
      <comments>http://www.commandbreak.com/CommentView,guid,74330801-e604-4f5e-a364-89fe084a41cf.aspx</comments>
      <category>Powershell</category>
      <category>Rants</category>
      <category>Word</category>
    </item>
    <item>
      <trackback:ping>http://www.commandbreak.com/Trackback.aspx?guid=63b05e93-cffd-4c9c-9b9f-a622fc875a30</trackback:ping>
      <pingback:server>http://www.commandbreak.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.commandbreak.com/PermaLink,guid,63b05e93-cffd-4c9c-9b9f-a622fc875a30.aspx</pingback:target>
      <dc:creator>Ben Parker</dc:creator>
      <wfw:comment>http://www.commandbreak.com/CommentView,guid,63b05e93-cffd-4c9c-9b9f-a622fc875a30.aspx</wfw:comment>
      <wfw:commentRss>http://www.commandbreak.com/SyndicationService.asmx/GetEntryCommentsRss?guid=63b05e93-cffd-4c9c-9b9f-a622fc875a30</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I have been helping <a href="http://teckinfo.blogspot.com/">Alan Renouf</a>, co-host
of the Get-Scripting podcast, with a PowerShell script and he has been nice enough
to mention me and my blog on during their latest episode.
</p>
        <p>
If you haven't already checked out the Get-Scripting podcast you can listen and subscribe
to it at <a href="http://get-scripting.blogspot.com">http://get-scripting.blogspot.com</a>.<br /></p>
        <img width="0" height="0" src="http://www.commandbreak.com/aggbug.ashx?id=63b05e93-cffd-4c9c-9b9f-a622fc875a30" />
      </body>
      <title>Did someone say my name..</title>
      <guid isPermaLink="false">http://www.commandbreak.com/PermaLink,guid,63b05e93-cffd-4c9c-9b9f-a622fc875a30.aspx</guid>
      <link>http://www.commandbreak.com/2008/11/27/DidSomeoneSayMyName.aspx</link>
      <pubDate>Thu, 27 Nov 2008 03:43:35 GMT</pubDate>
      <description>&lt;p&gt;
I have been helping &lt;a href="http://teckinfo.blogspot.com/"&gt;Alan Renouf&lt;/a&gt;, co-host
of the Get-Scripting podcast, with a PowerShell script and he has been nice enough
to mention me and my blog on during their latest episode.
&lt;/p&gt;
&lt;p&gt;
If you haven't already checked out the Get-Scripting podcast you can listen and subscribe
to it&amp;nbsp;at &lt;a href="http://get-scripting.blogspot.com"&gt;http://get-scripting.blogspot.com&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.commandbreak.com/aggbug.ashx?id=63b05e93-cffd-4c9c-9b9f-a622fc875a30" /&gt;</description>
      <comments>http://www.commandbreak.com/CommentView,guid,63b05e93-cffd-4c9c-9b9f-a622fc875a30.aspx</comments>
      <category>General</category>
      <category>Powershell</category>
    </item>
    <item>
      <trackback:ping>http://www.commandbreak.com/Trackback.aspx?guid=53004814-7f71-4772-bba2-4b77988d9b73</trackback:ping>
      <pingback:server>http://www.commandbreak.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.commandbreak.com/PermaLink,guid,53004814-7f71-4772-bba2-4b77988d9b73.aspx</pingback:target>
      <dc:creator>Ben Parker</dc:creator>
      <wfw:comment>http://www.commandbreak.com/CommentView,guid,53004814-7f71-4772-bba2-4b77988d9b73.aspx</wfw:comment>
      <wfw:commentRss>http://www.commandbreak.com/SyndicationService.asmx/GetEntryCommentsRss?guid=53004814-7f71-4772-bba2-4b77988d9b73</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I came across this problem the other day, where I wanted to determine if a Virtual
Machine was running on Hyper-V or Virtual Server 2005 host system.
</p>
        <p>
WMI exposes the <a href="http://msdn.microsoft.com/en-us/library/aa394102.aspx">Win32_ComputerSystem</a> class
which contains information about the Manufacturer and Model of a particular system
(this is very hand if you want to check type of system before installing an application,
e.g. Virtual Machine Additions). The unfortunate news is that Win32_ComputerSystem
returns the following on both Hyper-V and Virtual Server hosts:
</p>
        <p align="center">
          <img src="http://www.commandbreak.com/content/binary/Wmi_Hyper-V_Detect_1.png" border="0" />
        </p>
        <p>
So how to determine what it is I am looking at? Well there is another WMI class, <a href="http://msdn.microsoft.com/en-us/library/aa394077(VS.85).aspx">Win32_BIOS</a>,
which can help. Here you can see a difference in the Version between products.
</p>
        <p>
          <strong>Hyper-V</strong>
        </p>
        <p align="center">
          <strong>
            <img src="http://www.commandbreak.com/content/binary/Wmi_Hyper-V_Detect_2.png" border="0" />
          </strong>
        </p>
        <p>
          <strong>Virtual Server 2005 SP1</strong>
        </p>
        <p align="center">
          <img src="http://www.commandbreak.com/content/binary/Wmi_Hyper-V_Detect_3.png" border="0" />
        </p>
        <p>
So far this seems to work for me; I am interested if anyone has alternate suggestions
on how to solve my little problem, especially if there are cases where this will break
(for example limiting the CPU functionality to run NT 4.0?)<br /></p>
        <img width="0" height="0" src="http://www.commandbreak.com/aggbug.ashx?id=53004814-7f71-4772-bba2-4b77988d9b73" />
      </body>
      <title>Is my VM running on Hyper-V?</title>
      <guid isPermaLink="false">http://www.commandbreak.com/PermaLink,guid,53004814-7f71-4772-bba2-4b77988d9b73.aspx</guid>
      <link>http://www.commandbreak.com/2008/05/15/IsMyVMRunningOnHyperV.aspx</link>
      <pubDate>Thu, 15 May 2008 05:40:55 GMT</pubDate>
      <description>&lt;p&gt;
I came across this problem the other day, where I wanted to determine if a Virtual
Machine was running on Hyper-V or Virtual Server 2005 host system.
&lt;/p&gt;
&lt;p&gt;
WMI exposes the &lt;a href="http://msdn.microsoft.com/en-us/library/aa394102.aspx"&gt;Win32_ComputerSystem&lt;/a&gt; class
which contains information about the Manufacturer and Model of a particular system
(this is very hand if you want to check type of system before installing an application,
e.g. Virtual Machine Additions). The unfortunate news is that Win32_ComputerSystem
returns the following on both Hyper-V and Virtual Server hosts:
&lt;/p&gt;
&lt;p align=center&gt;
&lt;img src="http://www.commandbreak.com/content/binary/Wmi_Hyper-V_Detect_1.png" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
So how to determine what it is I am looking at? Well there is another WMI class, &lt;a href="http://msdn.microsoft.com/en-us/library/aa394077(VS.85).aspx"&gt;Win32_BIOS&lt;/a&gt;,
which can help. Here you can see a difference in the Version between products.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Hyper-V&lt;/strong&gt;
&lt;/p&gt;
&lt;p align=center&gt;
&lt;strong&gt;&lt;img src="http://www.commandbreak.com/content/binary/Wmi_Hyper-V_Detect_2.png" border=0&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Virtual Server 2005 SP1&lt;/strong&gt;
&lt;/p&gt;
&lt;p align=center&gt;
&lt;img src="http://www.commandbreak.com/content/binary/Wmi_Hyper-V_Detect_3.png" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
So far this seems to work for me; I am interested if anyone has alternate suggestions
on how to solve my little problem, especially if there are cases where this will break
(for example limiting the CPU functionality to run NT 4.0?)&lt;br&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.commandbreak.com/aggbug.ashx?id=53004814-7f71-4772-bba2-4b77988d9b73" /&gt;</description>
      <comments>http://www.commandbreak.com/CommentView,guid,53004814-7f71-4772-bba2-4b77988d9b73.aspx</comments>
      <category>Hyper-V</category>
      <category>Powershell</category>
    </item>
    <item>
      <trackback:ping>http://www.commandbreak.com/Trackback.aspx?guid=ee015189-d549-4501-9c34-8d4d65abbd57</trackback:ping>
      <pingback:server>http://www.commandbreak.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.commandbreak.com/PermaLink,guid,ee015189-d549-4501-9c34-8d4d65abbd57.aspx</pingback:target>
      <dc:creator>Ben Parker</dc:creator>
      <wfw:comment>http://www.commandbreak.com/CommentView,guid,ee015189-d549-4501-9c34-8d4d65abbd57.aspx</wfw:comment>
      <wfw:commentRss>http://www.commandbreak.com/SyndicationService.asmx/GetEntryCommentsRss?guid=ee015189-d549-4501-9c34-8d4d65abbd57</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Jeffrey Snover has posted a fantastic <a href="http://www.microsoft.com/emea/spotlight/sessionh.aspx?videoid=725&amp;PUID=00060000920B8748">PowerShell
Scripting presentation</a> he did late last year on the <a href="http://blogs.msdn.com/PowerShell/">PowerShell
Team Blog</a>.
</p>
        <p>
The session is aimed at people who have had experience with PowerShell and
is pitched as a deep dive - includes lots of examples and chewy detail. Topics covered
include:
</p>
        <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
          <p>
Forms and styles of scripting<br />
Scriptblocks<br />
Switch<br />
V2 Script Cmdlets<br />
V2 PSJobs
</p>
        </blockquote>
        <p>
This is presentation definatly makes installing the Silverlight plugin worth while.
</p>
        <p>
Thanks Jeffrey :)
</p>
        <img width="0" height="0" src="http://www.commandbreak.com/aggbug.ashx?id=ee015189-d549-4501-9c34-8d4d65abbd57" />
      </body>
      <title>PowerShell Scripting Deep Dive</title>
      <guid isPermaLink="false">http://www.commandbreak.com/PermaLink,guid,ee015189-d549-4501-9c34-8d4d65abbd57.aspx</guid>
      <link>http://www.commandbreak.com/2008/02/01/PowerShellScriptingDeepDive.aspx</link>
      <pubDate>Fri, 01 Feb 2008 07:49:25 GMT</pubDate>
      <description>&lt;p&gt;
Jeffrey Snover has posted a fantastic &lt;a href="http://www.microsoft.com/emea/spotlight/sessionh.aspx?videoid=725&amp;amp;PUID=00060000920B8748"&gt;PowerShell
Scripting presentation&lt;/a&gt; he did late last year on the &lt;a href="http://blogs.msdn.com/PowerShell/"&gt;PowerShell
Team Blog&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
The session is aimed at people who have had experience&amp;nbsp;with&amp;nbsp;PowerShell and
is pitched as a&amp;nbsp;deep dive - includes lots of examples and&amp;nbsp;chewy detail.&amp;nbsp;Topics&amp;nbsp;covered
include:
&lt;/p&gt;
&lt;blockquote dir=ltr style="MARGIN-RIGHT: 0px"&gt; 
&lt;p&gt;
Forms and styles of scripting&lt;br&gt;
Scriptblocks&lt;br&gt;
Switch&lt;br&gt;
V2 Script Cmdlets&lt;br&gt;
V2 PSJobs
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
This is presentation definatly makes installing the Silverlight plugin worth while.
&lt;/p&gt;
&lt;p&gt;
Thanks Jeffrey :)
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.commandbreak.com/aggbug.ashx?id=ee015189-d549-4501-9c34-8d4d65abbd57" /&gt;</description>
      <comments>http://www.commandbreak.com/CommentView,guid,ee015189-d549-4501-9c34-8d4d65abbd57.aspx</comments>
      <category>Powershell</category>
    </item>
    <item>
      <trackback:ping>http://www.commandbreak.com/Trackback.aspx?guid=223ae58a-f4c2-429c-a2d0-4bb74bce2d58</trackback:ping>
      <pingback:server>http://www.commandbreak.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.commandbreak.com/PermaLink,guid,223ae58a-f4c2-429c-a2d0-4bb74bce2d58.aspx</pingback:target>
      <dc:creator>Ben Parker</dc:creator>
      <wfw:comment>http://www.commandbreak.com/CommentView,guid,223ae58a-f4c2-429c-a2d0-4bb74bce2d58.aspx</wfw:comment>
      <wfw:commentRss>http://www.commandbreak.com/SyndicationService.asmx/GetEntryCommentsRss?guid=223ae58a-f4c2-429c-a2d0-4bb74bce2d58</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I hate drawing Visio diagrams. I’m no Picasso and, for me, drawing a network diagram
is one of these necessary evils that I avoid doing as long as humanly possible.
</p>
        <p>
Not anymore, the good people at Microsoft have released the <a href="http://www.microsoft.com/downloads/details.aspx?familyid=cb42fc06-50c7-47ed-a65c-862661742764&amp;displaylang=en&amp;tm">Microsoft
Active Directory Topology Diagrammer</a> which dynamically creates Visio diagrams
for your Windows infrastructure. The topology tool reads your AD configuration, including
domains, sites, servers, administrative groups, routing groups and connectors (for
those with Exchange) and outputs a detailed library of diagram for you to manipulate
as required.
</p>
        <p>
Impressed with this release I spent some time google’ing other Visio automation tools,
chasing that illusive magic bullet to cure all my Visio pains, I found an abundance
of information and samples on <a href="http://msdn.microsoft.com/en-us/library/ms409183.aspx">MSDN</a>.
One such sample, <a href="http://support.microsoft.com/kb/309603">How to use OLE automation
in Visio</a>, is a VBA macro that did most of the grunt work, loading and created
a new Visio diagram, drawing a shape with a label, saving the changes and closing
Visio. Apart from being a macro it performed the key functionality that would be required
for any tool. To obtain the flexibility I was looking for I have transposed the macro
code to a Powershell script which we can expand on later.
</p>
        <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
          <p>
            <font face="Arial">
              <font color="#006400"># ' Create an instance of Visio and create
a document based on the<br />
# ' Basic Diagram template. It doesn't matter if an instance of<br />
# ' Visio is already running, CreateObject will run a new one.<br />
# Set AppVisio = CreateObject("visio.application")<br /></font>
              <font color="#800080">$AppVisio</font> = <font color="#0000ff">New-Object -ComObject</font> Visio.Application</font>
          </p>
          <p>
            <font face="Arial">
              <font color="#006400"># Set docsObj = AppVisio.Documents</font>
              <br />
              <font color="#800080">$docsObj</font> =<font color="#800080"> $AppVisio</font>.Documents</font>
          </p>
          <p>
            <font face="Arial">
              <font color="#006400"># ' Create a document based on the Basic
Diagram template that<br />
# ' automatically opens the Basic Shapes stencil.<br />
# Set DocObj = docsObj.Add("Basic Diagram.vst")<br /></font>
              <font color="#800080">$DocObj</font> =<font color="#800080"> $docsObj</font>.Add(<font color="#ff0000">"Basic
Diagram.vst"</font>)</font>
          </p>
          <p>
            <font face="Arial">
              <font color="#006400"># Set pagsObj = AppVisio.ActiveDocument.Pages</font>
              <br />
              <font color="#800080">$pagsObj</font> = <font color="#800080">$AppVisio</font>.ActiveDocument.Pages</font>
          </p>
          <p>
            <font face="Arial">
              <font color="#006400"># ' A new document always has at least one
page, whose index in the<br />
# ' Pages collection is 1.<br />
# Set pagObj = pagsObj.Item(1)<br /></font>
              <font color="#800080">$pagObj</font> = <font color="#800080">$pagsObj</font>.Item(1)</font>
          </p>
          <p>
            <font face="Arial">
              <font color="#006400"># Set stnObj = AppVisio.Documents("Basic
Shapes.vss")<br /></font>
              <font color="#800080">$stnObj</font> = <font color="#800080">$AppVisio</font>.Documents.Add(<font color="#ff0000">"Basic
Shapes.vss"</font>)</font>
          </p>
          <p>
            <font face="Arial">
              <font color="#006400"># Set mastObj = stnObj.Masters("Rectangle")</font>
              <br />
              <font color="#800080">$mastObj</font> = <font color="#800080">$stnObj</font>.Masters.Item(<font color="#ff0000">"Rectangle"</font>)</font>
          </p>
          <p>
            <font face="Arial">
              <font color="#006400"># ' Drop the rectangle in the approximate
middle of the page.<br />
# ' Coordinates passed with the Drop method are always inches.<br />
# Set shpObj = pagObj.Drop(mastObj, 4.25, 5.5)<br /></font>
              <font color="#800080">$shpObj</font> = <font color="#800080">$pagObj</font>.Drop(<font color="#800080">$mastObj</font>,
4.25, 5.5)</font>
          </p>
          <p>
            <font face="Arial">
              <font color="#006400"># ' Set the text of the rectangle.<br />
# shpObj.Text = "This is some text."<br /></font>
              <font color="#800080">$shpObj</font>.Text = <font color="#ff0000">"This is
some text."</font></font>
          </p>
          <p>
            <font face="Arial">
              <font color="#006400"># ' Save the drawing and quit Visio. The
message pauses the program<br />
# ' so you can see the Visio drawing before the instance closes.<br />
# DocObj.SaveAs "MyDrawing.vsd"<br /></font>
              <font color="#800080">$DocObj</font>.SaveAs(<font color="#ff0000">"C:\MyDrawing.vsd"</font>)<br /><font color="#006400"># MsgBox "Drawing finished!", , "AutoVisio (OLE) Example"</font></font>
          </p>
          <p>
            <font face="Arial">
              <font color="#006400"># ' Quit Visio.<br />
# AppVisio.Quit</font>
              <br />
              <font color="#800080">$AppVisio</font>.Quit()</font>
          </p>
          <p>
            <font face="Arial" color="#006400"># ' Clear the variable from memory.<br />
# Set AppVisio = Nothing</font>
          </p>
        </blockquote>
        <p>
In an effort to make it that little bit easier to understand I have commented all
the sample code and incorporated the Powershell equivalents. Remember that
Powershell, unlike VB 6, doesn’t support default properties. So when we are calling
a method (e.g. <font face="Arial"><font color="#800080">$stnObj</font>.Masters</font>)
we have to define the property we are setting (e.g. <font face="Arial">Item</font>).
</p>
        <p>
So great I have a rectangle with some text in the middle of a blank Visio, not very
useful, but after a few changes we have something that will dynamically generate stencils
for all computers in a domain.
</p>
        <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
          <p>
            <font face="Arial">
              <font color="#006400"># Zero initial drop coordinates</font>
              <br />
              <font color="#800080">$x</font> = 0<br /><font color="#800080">$y</font> = 1.20</font>
          </p>
          <p>
            <font face="Arial">
              <font color="#006400"># Create an instance of Visio and create
a document based on the Basic Diagram template.<br /></font>
              <font color="#800080">$AppVisio</font> = <font color="#0000ff">New-Object -ComObject</font> Visio.Application<br /><font color="#800080">$docsObj</font> = <font color="#800080">$AppVisio</font>.Documents<br /><font color="#800080">$DocObj</font> = <font color="#800080">$docsObj</font>.Add(<font color="#ff0000">"Basic
Diagram.vst"</font>)</font>
          </p>
          <p>
            <font face="Arial">
              <font color="#006400"># Set the active page of the document to
page 1<br /></font>
              <font color="#800080">$pagsObj</font> = <font color="#800080">$AppVisio</font>.ActiveDocument.Pages<br /><font color="#800080">$pagObj</font> = <font color="#800080">$pagsObj</font>.Item(1)</font>
          </p>
          <p>
            <font face="Arial">
              <font color="#006400"># Load a set of stencils and select one to
drop</font>
              <br />
              <font color="#800080">$stnObj</font> = <font color="#800080">$AppVisio</font>.Documents.Add(<font color="#ff0000">"SERVER_M.vss"</font>)<br /><font color="#800080">$mastObj</font> = <font color="#800080">$stnObj</font>.Masters.Item(<font color="#ff0000">"Server"</font>)</font>
          </p>
          <p>
            <font face="Arial" color="#006400"># Retrieve a list of computer accounts from Active
Directory 
<br />
# </font>
            <a href="http://www.microsoft.com/technet/scriptcenter/resources/qanda/nov06/hey1109.mspx">
              <font face="Arial" color="#006400">http://www.microsoft.com/technet/scriptcenter/resources/qanda/nov06/hey1109.mspx</font>
            </a>
          </p>
          <p>
            <font face="Arial">
              <font color="#800080">$strCategory</font> = "computer"</font>
          </p>
          <p>
            <font face="Arial">
              <font color="#800080">$objDomain</font> = <font color="#0000ff">New-Object</font> System.DirectoryServices.DirectoryEntry</font>
          </p>
          <p>
            <font face="Arial">
              <font color="#800080">$objSearcher</font> = <font color="#0000ff">New-Object</font> System.DirectoryServices.DirectorySearcher<br /><font color="#800080">$objSearcher</font>.SearchRoot = <font color="#800080">$objDomain</font><br /><font color="#800080">$objSearcher</font>.Filter = (<font color="#ff0000">"(objectCategory=</font><font color="#800080">$strCategory</font><font color="#ff0000">)"</font>)</font>
          </p>
          <p>
            <font face="Arial">
              <font color="#800080">$colProplist</font> = <font color="#ff0000">"name"<br /></font><font color="#0000ff">foreach</font> (<font color="#800080">$i</font><font color="#0000ff">in</font><font color="#800080">$colPropList</font>){<font color="#800080">$objSearcher</font>.PropertiesToLoad.Add(<font color="#800080">$i</font>)}</font>
          </p>
          <p>
            <font face="Arial">
              <font color="#800080">$colResults</font> = <font color="#800080">$objSearcher</font>.FindAll()</font>
          </p>
          <p>
            <font face="Arial">
              <font color="#0000ff">foreach</font> (<font color="#800080">$objResult</font><font color="#0000ff">in</font><font color="#800080">$colResults</font>)<br />
{<br />
  <font color="#800080">$objComputer</font> = <font color="#800080">$objResult</font>.Properties; <font color="#800080">$objComputer</font>.name<br />
  <br />
  <font color="#006400"># Set coordinates for drop</font><br />
  <font color="#800080">$x</font> = <font color="#800080">$x</font> + 1.30<br />
  <br />
 <font color="#006400"> # Loop to the next line</font><br />
  <font color="#0000ff">if</font>(<font color="#800080">$x</font><font color="#ffa500">-ge</font> 8)<br />
  {<br />
   <font color="#800080">$x</font> = 1.30<br />
   <font color="#800080">$y</font> = <font color="#800080">$y</font> +
1.20<br />
  }<br />
  <br />
 <font color="#006400"> # Drop the selected stencil on the active page,
with the coordinates x, y<br /></font>  <font color="#800080">$shpObj</font> = <font color="#800080">$pagObj</font>.Drop(<font color="#800080">$mastObj</font>, <font color="#800080">$x</font>, <font color="#800080">$y</font>)<br />
  <br />
 <font color="#006400"> # Enter text for the object<br /></font> <font color="#800080"> $shpObj</font>.Text = <font color="#800080">$objComputer.name</font><br />
 }</font>
          </p>
          <p>
            <font face="Arial">
              <font color="#006400"># Save the diagram<br /></font>
              <font color="#800080">$DocObj</font>.SaveAs(<font color="#ff0000">"C:\CMDBREAK_MyDrawing.vsd"</font>)</font>
          </p>
          <p>
            <font face="Arial">
              <font color="#006400"># Quit Visio<br /></font>
              <font color="#800080">$AppVisio</font>.Quit()</font>
          </p>
        </blockquote>
        <p>
Lost? 
</p>
        <p align="center">
          <img src="http://www.commandbreak.com/content/binary/Visio_Powershell=automagic.png" border="0" />
        </p>
        <p>
Highlighted above in each of the colours is the following:<br />
Yellow – What we started with, only modified to select and drop the Server stencil.<br />
Red – Controls where we drop each stencil, so as they are not on top of each other.<br />
Blue - Enumerates all computer accounts in the local domain. Detailed explanation
is available at <a href="http://www.microsoft.com/technet/scriptcenter/resources/qanda/nov06/hey1109.mspx">Hey,
Scripting Guy! How Can I Use Windows PowerShell to Get a List of All My Computers?</a></p>
        <p>
Now we have a script that will retrieve all the computer accounts in an AD domain
and draw shapes for each, one of the monotonous tasks required for any network diagram.
</p>
        <p>
To recap we have converted a VBA macro to a Powershell script and after a few additions
we can generate a set of Server stencils labelled with the hostnames of all computers
connected to an AD domain. This is just a start, with some more modifications it would
be easy to select a different stencil based on the services running or have the script
modify existing shapes in a drawing to create a dynamic network diagram.
</p>
        <p>
Happy Visio Automagic.
</p>
        <img width="0" height="0" src="http://www.commandbreak.com/aggbug.ashx?id=223ae58a-f4c2-429c-a2d0-4bb74bce2d58" />
      </body>
      <title>Visio + Powershell = Automagic</title>
      <guid isPermaLink="false">http://www.commandbreak.com/PermaLink,guid,223ae58a-f4c2-429c-a2d0-4bb74bce2d58.aspx</guid>
      <link>http://www.commandbreak.com/2007/10/14/VisioPowershellAutomagic.aspx</link>
      <pubDate>Sun, 14 Oct 2007 11:59:08 GMT</pubDate>
      <description>&lt;p&gt;
I hate drawing Visio diagrams. I’m no Picasso and, for me, drawing a network diagram
is one of these necessary evils that I avoid doing as long as humanly possible.
&lt;/p&gt;
&lt;p&gt;
Not anymore, the good people at Microsoft have released the &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=cb42fc06-50c7-47ed-a65c-862661742764&amp;amp;displaylang=en&amp;amp;tm"&gt;Microsoft
Active Directory Topology Diagrammer&lt;/a&gt; which dynamically creates Visio diagrams
for your Windows infrastructure. The topology tool reads your AD configuration, including
domains, sites, servers, administrative groups, routing groups and connectors (for
those with Exchange) and outputs a detailed library of diagram for you to manipulate
as required.
&lt;/p&gt;
&lt;p&gt;
Impressed with this release I spent some time google’ing other Visio automation tools,
chasing that illusive magic bullet&amp;nbsp;to cure all my Visio pains, I found an abundance
of information and samples on &lt;a href="http://msdn.microsoft.com/en-us/library/ms409183.aspx"&gt;MSDN&lt;/a&gt;.
One such sample, &lt;a href="http://support.microsoft.com/kb/309603"&gt;How to use OLE automation
in Visio&lt;/a&gt;, is a VBA macro that did most of the grunt work, loading and created
a new Visio diagram, drawing a shape with a label, saving the changes and closing
Visio. Apart from being a macro it performed the key functionality that would be required
for any tool. To obtain the flexibility I was looking for I have transposed the macro
code to a Powershell script which we can expand on later.
&lt;/p&gt;
&lt;blockquote dir=ltr style="MARGIN-RIGHT: 0px"&gt; 
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font color=#006400&gt;# ' Create an instance of Visio and create a
document based on the&lt;br&gt;
# ' Basic Diagram template. It doesn't matter if an instance of&lt;br&gt;
# ' Visio is already running, CreateObject will run a new one.&lt;br&gt;
# Set AppVisio = CreateObject("visio.application")&lt;br&gt;
&lt;/font&gt;&lt;font color=#800080&gt;$AppVisio&lt;/font&gt; = &lt;font color=#0000ff&gt;New-Object -ComObject&lt;/font&gt; Visio.Application&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font color=#006400&gt;# Set docsObj = AppVisio.Documents&lt;/font&gt;
&lt;br&gt;
&lt;font color=#800080&gt;$docsObj&lt;/font&gt; =&lt;font color=#800080&gt; $AppVisio&lt;/font&gt;.Documents&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font color=#006400&gt;# ' Create a document based on the Basic Diagram
template that&lt;br&gt;
# ' automatically opens the Basic Shapes stencil.&lt;br&gt;
# Set DocObj = docsObj.Add("Basic Diagram.vst")&lt;br&gt;
&lt;/font&gt;&lt;font color=#800080&gt;$DocObj&lt;/font&gt; =&lt;font color=#800080&gt; $docsObj&lt;/font&gt;.Add(&lt;font color=#ff0000&gt;"Basic
Diagram.vst"&lt;/font&gt;)&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font color=#006400&gt;# Set pagsObj = AppVisio.ActiveDocument.Pages&lt;/font&gt;
&lt;br&gt;
&lt;font color=#800080&gt;$pagsObj&lt;/font&gt; = &lt;font color=#800080&gt;$AppVisio&lt;/font&gt;.ActiveDocument.Pages&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font color=#006400&gt;# ' A new document always has at least one page,
whose index in the&lt;br&gt;
# ' Pages collection is 1.&lt;br&gt;
# Set pagObj = pagsObj.Item(1)&lt;br&gt;
&lt;/font&gt;&lt;font color=#800080&gt;$pagObj&lt;/font&gt; = &lt;font color=#800080&gt;$pagsObj&lt;/font&gt;.Item(1)&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font color=#006400&gt;# Set stnObj = AppVisio.Documents("Basic Shapes.vss")&lt;br&gt;
&lt;/font&gt;&lt;font color=#800080&gt;$stnObj&lt;/font&gt; = &lt;font color=#800080&gt;$AppVisio&lt;/font&gt;.Documents.Add(&lt;font color=#ff0000&gt;"Basic
Shapes.vss"&lt;/font&gt;)&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font color=#006400&gt;# Set mastObj = stnObj.Masters("Rectangle")&lt;/font&gt;
&lt;br&gt;
&lt;font color=#800080&gt;$mastObj&lt;/font&gt; = &lt;font color=#800080&gt;$stnObj&lt;/font&gt;.Masters.Item(&lt;font color=#ff0000&gt;"Rectangle"&lt;/font&gt;)&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font color=#006400&gt;# ' Drop the rectangle in the approximate middle
of the page.&lt;br&gt;
# ' Coordinates passed with the Drop method are always inches.&lt;br&gt;
# Set shpObj = pagObj.Drop(mastObj, 4.25, 5.5)&lt;br&gt;
&lt;/font&gt;&lt;font color=#800080&gt;$shpObj&lt;/font&gt; = &lt;font color=#800080&gt;$pagObj&lt;/font&gt;.Drop(&lt;font color=#800080&gt;$mastObj&lt;/font&gt;,
4.25, 5.5)&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font color=#006400&gt;# ' Set the text of the rectangle.&lt;br&gt;
# shpObj.Text = "This is some text."&lt;br&gt;
&lt;/font&gt;&lt;font color=#800080&gt;$shpObj&lt;/font&gt;.Text = &lt;font color=#ff0000&gt;"This is some
text."&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font color=#006400&gt;# ' Save the drawing and quit Visio. The message
pauses the program&lt;br&gt;
# ' so you can see the Visio drawing before the instance closes.&lt;br&gt;
# DocObj.SaveAs "MyDrawing.vsd"&lt;br&gt;
&lt;/font&gt;&lt;font color=#800080&gt;$DocObj&lt;/font&gt;.SaveAs(&lt;font color=#ff0000&gt;"C:\MyDrawing.vsd"&lt;/font&gt;)&lt;br&gt;
&lt;font color=#006400&gt;# MsgBox "Drawing finished!", , "AutoVisio (OLE) Example"&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font color=#006400&gt;# ' Quit Visio.&lt;br&gt;
# AppVisio.Quit&lt;/font&gt;
&lt;br&gt;
&lt;font color=#800080&gt;$AppVisio&lt;/font&gt;.Quit()&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial color=#006400&gt;# ' Clear the variable from memory.&lt;br&gt;
# Set AppVisio = Nothing&lt;/font&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
In an effort to make it that little bit easier to understand I have commented all
the sample code and incorporated the Powershell equivalents.&amp;nbsp;Remember&amp;nbsp;that
Powershell, unlike VB 6, doesn’t support default properties. So when we are calling
a method (e.g. &lt;font face=Arial&gt;&lt;font color=#800080&gt;$stnObj&lt;/font&gt;.Masters&lt;/font&gt;)
we have to define the property we are setting (e.g. &lt;font face=Arial&gt;Item&lt;/font&gt;).
&lt;/p&gt;
&lt;p&gt;
So great I have a rectangle with some text in the middle of a blank Visio, not very
useful, but after a few changes we have something that will dynamically generate stencils
for all computers in a domain.
&lt;/p&gt;
&lt;blockquote dir=ltr style="MARGIN-RIGHT: 0px"&gt; 
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font color=#006400&gt;# Zero initial drop coordinates&lt;/font&gt;
&lt;br&gt;
&lt;font color=#800080&gt;$x&lt;/font&gt; = 0&lt;br&gt;
&lt;font color=#800080&gt;$y&lt;/font&gt; = 1.20&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font color=#006400&gt;# Create an instance of Visio and create a document
based on the Basic Diagram template.&lt;br&gt;
&lt;/font&gt;&lt;font color=#800080&gt;$AppVisio&lt;/font&gt; = &lt;font color=#0000ff&gt;New-Object -ComObject&lt;/font&gt; Visio.Application&lt;br&gt;
&lt;font color=#800080&gt;$docsObj&lt;/font&gt; = &lt;font color=#800080&gt;$AppVisio&lt;/font&gt;.Documents&lt;br&gt;
&lt;font color=#800080&gt;$DocObj&lt;/font&gt; = &lt;font color=#800080&gt;$docsObj&lt;/font&gt;.Add(&lt;font color=#ff0000&gt;"Basic
Diagram.vst"&lt;/font&gt;)&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font color=#006400&gt;# Set the active page of the document to page
1&lt;br&gt;
&lt;/font&gt;&lt;font color=#800080&gt;$pagsObj&lt;/font&gt; = &lt;font color=#800080&gt;$AppVisio&lt;/font&gt;.ActiveDocument.Pages&lt;br&gt;
&lt;font color=#800080&gt;$pagObj&lt;/font&gt; = &lt;font color=#800080&gt;$pagsObj&lt;/font&gt;.Item(1)&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font color=#006400&gt;# Load a set of stencils and select one to drop&lt;/font&gt;
&lt;br&gt;
&lt;font color=#800080&gt;$stnObj&lt;/font&gt; = &lt;font color=#800080&gt;$AppVisio&lt;/font&gt;.Documents.Add(&lt;font color=#ff0000&gt;"SERVER_M.vss"&lt;/font&gt;)&lt;br&gt;
&lt;font color=#800080&gt;$mastObj&lt;/font&gt; = &lt;font color=#800080&gt;$stnObj&lt;/font&gt;.Masters.Item(&lt;font color=#ff0000&gt;"Server"&lt;/font&gt;)&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial color=#006400&gt;# Retrieve a list of computer accounts from Active
Directory 
&lt;br&gt;
# &lt;/font&gt;&lt;a href="http://www.microsoft.com/technet/scriptcenter/resources/qanda/nov06/hey1109.mspx"&gt;&lt;font face=Arial color=#006400&gt;http://www.microsoft.com/technet/scriptcenter/resources/qanda/nov06/hey1109.mspx&lt;/font&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font color=#800080&gt;$strCategory&lt;/font&gt; = "computer"&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font color=#800080&gt;$objDomain&lt;/font&gt; = &lt;font color=#0000ff&gt;New-Object&lt;/font&gt; System.DirectoryServices.DirectoryEntry&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font color=#800080&gt;$objSearcher&lt;/font&gt; = &lt;font color=#0000ff&gt;New-Object&lt;/font&gt; System.DirectoryServices.DirectorySearcher&lt;br&gt;
&lt;font color=#800080&gt;$objSearcher&lt;/font&gt;.SearchRoot = &lt;font color=#800080&gt;$objDomain&lt;/font&gt;
&lt;br&gt;
&lt;font color=#800080&gt;$objSearcher&lt;/font&gt;.Filter = (&lt;font color=#ff0000&gt;"(objectCategory=&lt;/font&gt;&lt;font color=#800080&gt;$strCategory&lt;/font&gt;&lt;font color=#ff0000&gt;)"&lt;/font&gt;)&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font color=#800080&gt;$colProplist&lt;/font&gt; = &lt;font color=#ff0000&gt;"name"&lt;br&gt;
&lt;/font&gt;&lt;font color=#0000ff&gt;foreach&lt;/font&gt; (&lt;font color=#800080&gt;$i&lt;/font&gt; &lt;font color=#0000ff&gt;in&lt;/font&gt; &lt;font color=#800080&gt;$colPropList&lt;/font&gt;){&lt;font color=#800080&gt;$objSearcher&lt;/font&gt;.PropertiesToLoad.Add(&lt;font color=#800080&gt;$i&lt;/font&gt;)}&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font color=#800080&gt;$colResults&lt;/font&gt; = &lt;font color=#800080&gt;$objSearcher&lt;/font&gt;.FindAll()&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font color=#0000ff&gt;foreach&lt;/font&gt; (&lt;font color=#800080&gt;$objResult&lt;/font&gt; &lt;font color=#0000ff&gt;in&lt;/font&gt; &lt;font color=#800080&gt;$colResults&lt;/font&gt;)&lt;br&gt;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&lt;font color=#800080&gt;$objComputer&lt;/font&gt; = &lt;font color=#800080&gt;$objResult&lt;/font&gt;.Properties; &lt;font color=#800080&gt;$objComputer&lt;/font&gt;.name&lt;br&gt;
&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&lt;font color=#006400&gt;# Set coordinates for drop&lt;/font&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&lt;font color=#800080&gt;$x&lt;/font&gt; = &lt;font color=#800080&gt;$x&lt;/font&gt; + 1.30&lt;br&gt;
&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&lt;font color=#006400&gt;&amp;nbsp;# Loop to the next line&lt;/font&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&lt;font color=#0000ff&gt;if&lt;/font&gt;(&lt;font color=#800080&gt;$x&lt;/font&gt; &lt;font color=#ffa500&gt;-ge&lt;/font&gt; 8)&lt;br&gt;
&amp;nbsp;&amp;nbsp;{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=#800080&gt;$x&lt;/font&gt; = 1.30&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=#800080&gt;$y&lt;/font&gt; = &lt;font color=#800080&gt;$y&lt;/font&gt; +
1.20&lt;br&gt;
&amp;nbsp;&amp;nbsp;}&lt;br&gt;
&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&lt;font color=#006400&gt;&amp;nbsp;# Drop the selected stencil on the active page, with
the coordinates x, y&lt;br&gt;
&lt;/font&gt;&amp;nbsp;&amp;nbsp;&lt;font color=#800080&gt;$shpObj&lt;/font&gt; = &lt;font color=#800080&gt;$pagObj&lt;/font&gt;.Drop(&lt;font color=#800080&gt;$mastObj&lt;/font&gt;, &lt;font color=#800080&gt;$x&lt;/font&gt;, &lt;font color=#800080&gt;$y&lt;/font&gt;)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&lt;font color=#006400&gt;&amp;nbsp;# Enter text for the object&lt;br&gt;
&lt;/font&gt;&amp;nbsp;&lt;font color=#800080&gt;&amp;nbsp;$shpObj&lt;/font&gt;.Text = &lt;font color=#800080&gt;$objComputer.name&lt;/font&gt;
&lt;br&gt;
&amp;nbsp;}&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font color=#006400&gt;# Save the diagram&lt;br&gt;
&lt;/font&gt;&lt;font color=#800080&gt;$DocObj&lt;/font&gt;.SaveAs(&lt;font color=#ff0000&gt;"C:\CMDBREAK_MyDrawing.vsd"&lt;/font&gt;)&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Arial&gt;&lt;font color=#006400&gt;# Quit Visio&lt;br&gt;
&lt;/font&gt;&lt;font color=#800080&gt;$AppVisio&lt;/font&gt;.Quit()&lt;/font&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
Lost? 
&lt;/p&gt;
&lt;p align=center&gt;
&lt;img src="http://www.commandbreak.com/content/binary/Visio_Powershell=automagic.png" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
Highlighted above in each of the colours is the following:&lt;br&gt;
Yellow – What we started with, only modified to select and drop the Server stencil.&lt;br&gt;
Red – Controls where we drop each stencil, so as they are not on top of each other.&lt;br&gt;
Blue - Enumerates all computer accounts in the local domain. Detailed explanation
is available at &lt;a href="http://www.microsoft.com/technet/scriptcenter/resources/qanda/nov06/hey1109.mspx"&gt;Hey,
Scripting Guy! How Can I Use Windows PowerShell to Get a List of All My Computers?&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Now we have a script that will retrieve all the computer accounts in an AD domain
and draw shapes for each, one of the monotonous tasks required for any network diagram.
&lt;/p&gt;
&lt;p&gt;
To recap we have converted a VBA macro to a Powershell script and after a few additions
we can generate a set of Server stencils labelled with the hostnames of all computers
connected to an AD domain. This is just a start, with some more modifications it would
be easy to select a different stencil based on the services running or have the script
modify existing shapes in a drawing to create a dynamic network diagram.
&lt;/p&gt;
&lt;p&gt;
Happy Visio Automagic.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.commandbreak.com/aggbug.ashx?id=223ae58a-f4c2-429c-a2d0-4bb74bce2d58" /&gt;</description>
      <comments>http://www.commandbreak.com/CommentView,guid,223ae58a-f4c2-429c-a2d0-4bb74bce2d58.aspx</comments>
      <category>Powershell</category>
      <category>Visio</category>
    </item>
  </channel>
</rss>