<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Daniel Kloyber - SharePoint &amp; More</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/spdaniel/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/spdaniel/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:50:39 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Creating a team diagram with PowerShell and Visio</title>
      <link>https://docs.microsoft.com/archive/blogs/spdaniel/creating-a-team-diagram-with-powershell-and-visio</link>
      <pubDate>Sat, 14 Jan 2012 08:59:00 GMT</pubDate>
      <dc:creator><![CDATA[DanielKloyber]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/spdaniel/2012/01/14/creating-a-team-diagram-with-powershell-and-visio/</guid>
      <description><![CDATA[&nbsp;
Some time ago we had this big EMEA wide team meeting. Every team manager had to present his...]]></description>
      <content:encoded><![CDATA[<p>&nbsp;</p>
<p>Some time ago we had this big EMEA wide team meeting. Every team manager had to present his team, so a few days in advance we all got this email saying that we should send some pictures over so we make a good impression. We all have some pictures setup in AD, and they nicely integrate with Outlook and maybe SharePoint. Trying to get those pictures for all 20 guys in your team on the other hand is not that easy.. lots of clicking... lots of searching... lots of saving. I immediately started wondering if we can do this programmatically... and of course what nicer way of doing this than using PowerShell. Challenge accepted!</p>
<h5>Step 1 - Download the pictures locally</h5>
<p>One easy way to access user data from the AD is to use the AD management plug-in for Windows Server / 7. The only problem with that: I cannot imagine many managers (except ours) doing this. Managers are mostly not that computer savy. We need something that is already there on every Windows 7 machine. Thus... I used LDAP queries</p>
<blockquote>
<p><em>$objDomain = New-Object System.DirectoryServices.DirectoryEntry</em></p>
<p><em>$objSearcher = New-Object System.DirectoryServices.DirectorySearcher</em></p>
<p><em>$objSearcher.SearchRoot = $objDomain</em></p>
<p><em>$objSearcher.PageSize = 1000</em></p>
</blockquote>
<p>Second step was to build an LDAP filter that would get all the data I need, in our case all the direct reports of any given manager:</p>
<blockquote>
<p><em>$filter = "(&amp;(objectClass=user)(objectCategory=person)(manager=CN=Razvan Opris,OU=UserAccounts,DC=europe,DC=corp,DC=microsoft,DC=com))"</em></p>
<p><em>$objSearcher.Filter = $filter</em></p>
</blockquote>
<p>And now we can actually run the query and save the needed results to jpg files:</p>
<blockquote>
<p><em>$colResults = $objSearcher.FindAll()</em></p>
<p><em>foreach($result in $colResults) <br />{ <br />$name = $result.Properties["cn"] <br />$filename = $name[0] + ".jpg" <br />$result.Properties["thumbnailphoto"] | Set-Content $filename -Encoding byte <br />}</em></p>
</blockquote>
<p>At this point we have a picture of all the team members saved on disk. For more advanced diagrams we can import them one by one into Visio and build our diagram, but lets consider that we want to automate also this part of the process.</p>
<h5>Step 2 &ndash; Create the diagram in Visio</h5>
<p>We can start Vision and create a new document by calling:</p>
<blockquote>
<p>$application = New-Object -ComObject Visio.Application <br />$documents = $application.Documents <br />$document = $documents.Add("Basic Diagram.vst") <br />$pages = $application.ActiveDocument.Pages <br />$page = $pages.Item(1)</p>
<p>$stencil = $application.Documents.OpenEx($application.GetBuiltInStencilFile(2,1),64)</p>
<p>$container = $stencil.Masters.ItemFromID(2)</p>
</blockquote>
<p>For the purpose of this exercise we will also a specific master / stencil. You can pick the one that best suites your needs freely.</p>
<p>I then used some trial&amp;error approach to get some start values for my positions:</p>
<blockquote>
<p>$x = 1.15 <br />$y = 10.5 <br />$rownumber = 0</p>
</blockquote>
<p>And the we can start populating the grid:</p>
<blockquote>
<p>foreach($user in $colResults) <br />{</p>
<p>$name = $user.Properties["cn"]</p>
<p>$box = $page.Drop($container, $x ,$y)</p>
<p>$image = $page.Import("C:\Users\siegklo\Desktop\diagram\" + $name[0] + ".jpg")</p>
<p>$application.ActiveWindow.Selection.Move($x - 4.2, $y - 6) <br />$application.ActiveWindow.Selection.AddToContainers()</p>
<p>$box.Text = $name</p>
<p><br />$x= $x + 3 <br />$rownumber++</p>
<p>if($rownumber -eq 4) <br />{ <br />$y = $y - 3 <br />$x = 1.15 <br />$rownumber = 0 <br />} <br />}</p>
</blockquote>
<p>A few notes on the code above:</p>
<p>1. I had to use the full path to the location where I first saved the files.</p>
<p>2. The positioning of the images was done more or less manually, the values are guessed and deducted by trial and error so that they match the containers. I tried using some programmatic tricks but I failed and got bored.</p>
<p>3. One of the pictures was imported in a really small size and I manually resized it.</p>
<p>The end result was looking like this:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/64/metablogapi/3731.image_3ABCD5A7.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-64-metablogapi/3731.image_5F00_3ABCD5A7.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/64/metablogapi/5466.image_thumb_19108709.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-64-metablogapi/5466.image_5F00_thumb_5F00_19108709.png" width="394" height="363" /></a></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/25/67/65/getpictures.ps1" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-25-67-65/getpictures.ps1">getpictures.ps1</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Office 365 - Creating a custom website</title>
      <link>https://docs.microsoft.com/archive/blogs/spdaniel/office-365-creating-a-custom-website</link>
      <pubDate>Tue, 09 Aug 2011 16:17:00 GMT</pubDate>
      <dc:creator><![CDATA[DanielKloyber]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/spdaniel/2011/08/09/office-365-creating-a-custom-website/</guid>
      <description><![CDATA[While being in the beta for Office 365 I was showing arround my girlfriend about how to use the...]]></description>
      <content:encoded><![CDATA[<p>While being in the beta for Office 365 I was showing arround my girlfriend about how to use the service and what the advantages for her small consulting business would be. After the service became available she was actually convinced to make the move, and as part of the deal I was supposed to make a new website for her. The scenario is simple... a site where you can read about her business, where customer can post to a contact form and where she can publish short articles / news every now and then. I guess these are the basic needs of most small businesses out there... so I decided to start this small article series about how you could implement this for your own needs.</p>
<h3>The out of the box approach</h3>
<p>When subscribing to Office 365 you will get an OOB web-site that can be customized using the online wysiwyg editor.The limitation of the oob approach are quite obvious, it will cover most basic scenarios, but if you want something more stylish you will need some custom design being done.</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/64/8233.picture1.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-64/8233.picture1.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/64/8233.picture1.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-64/8233.picture1.png" /></a></p>
<h3>Creating a static html page with Expression Web&nbsp;</h3>
<p>I made&nbsp; a habbit of starting most of my web projects by designing a static page that will cover the most common usage scenario. Basically I first create a static page that will represent the entrance point for the site.</p>
<p>There are two main tools I had&nbsp; to choose from: Expression Web or Visual Studio. Although Visual Studio is basically the jack of all trades and eventually I unded up using it for creating the final version of the site, I find ExWeb considerably more inspiring, especially when all you wanna do is a static page mockup.</p>
<p>So... fire up ExWeb, &nbsp;created a new Web Site Project and add your default folder structure and some html pages.</p>
<p>Rename the html files to .aspx. The reasoning for this is that Office 365 has some strict security settings that will not allow html pages to be rendered directly in the browser when opened from a document library.</p>
<p>Publishing the pages to Office 365 was just a little bit tricky:</p>
<p>1. Open the Office 365 site in SharePoint Designer 2010 ( free download under: <a href="https://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;id=16573">https://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;id=16573</a> )</p>
<p>2. Create a publishing connection in Expression Web 4</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/64/0160.picture3.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-64/0160.picture3.png"><img style="margin-right: auto; margin-left: auto; display: block;" border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/64/0160.picture3.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-64/0160.picture3.png" width="375" height="430" /></a></p>
<p>3.&nbsp; Publish the content to the SitePages library using Expression Web. You can create a different library that better fits your need and publish the contets there if you need to.</p>
<p>The trick here was that before publishing using Expression Web 4 I had to first open the site in SharePoint designer. You could use SharePoint Designer for creating the pages from the start, but again... ExWeb is much more inspiring and has a few features not found in SPD 2010.</p>
<p>Here are a few tricks for navigating arround the SharePoint site:</p>
<p>- when you browse the site you are redirected to the web page, you can get to the settings page of the SharePoint by browsing to <a href="https://yourname.sharepoint.com/_layouts.aspx">https://yourname.sharepoint.com/_layouts.aspx</a>&nbsp;.</p>
<p>- here you can go to Site Libraries and Lists and create custom libraries to deploy your files too.</p>
<p>- another option is to use SPD for doing this</p>
<p>&nbsp;</p>
<p>The last step I took was to set the index.aspx page from the SitePages library to be the home page for my site. This way when uses are accessing the URL they are redirected to this page and not the default page provided by Office 365. I did this using SharePoint Designer:</p>
<p><br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/64/2500.picture4.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-64/2500.picture4.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/42/64/2500.picture4.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-42-64/2500.picture4.png" /></a></p>
<p><br />Some might wonder that we mixed up the SPD and ExWeb when we could have done all this in SPD only, but what I wanted to proof was that you can use ExWeb to design the pages like any other static page and the publish them to Office 365 the same way you would publish them to any other hosting provider out there. If you already have a static page hosted somewhere, moving it to Office 365 should be easy and fast.</p>
<p>In the next post I will talk about how I integrated the sites with some simple CMS features based on SharePoint Lists and the SharePoint Client API.</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
  </channel>
</rss>