Showing posts with label Microsoft. Show all posts
Showing posts with label Microsoft. Show all posts

Thursday, February 24, 2011

Windows Update–How to stop being annoyed #TipOfTheDay

We all have been there before, whether you are in the middle of working on your laptop/desktop or logged into a Remote Desktop session, that pesky Windows Update appears.  No matter what you do, you can’t get rid of how annoying that restart box is. 

imageBeyond that, if you click postpone, it’s just going to prompt you later on.  Hey Microsoft: 4 hours isn’t long enough for me!  On top of all of that, the Restart Now button is locked an loaded.  If, and I say if meaning “When”, you click on it, you are done.  Gone goes the tabs of research, the document that wasn’t saved, the sweet blog post; the list goes on and on.  Yes, there are measures built into Win7 and Vista to stop accidental reboots, however, it’s extremely inconvenient, and on XP non-existent.  At my prior job, we used Remote Desktop Services heavily and this was a constant gripe from my users.  I tried to do updates on the weekends, but being a 1 man shop, I like having a life Smile.  Here’s my solution. STOP CLICKING POSTPONE!  That’s right, treat it like any other window you don’t have time for.  Drag that bugger off the screen and leave it there until you, YOU, yes YOU, want to restart.

image

Doing this you get rid of two major annoyances of mine.  First, there isn’t a nuke button popping up on your screen.  Second, it’s completely out of sight and out of mind.  Windows Update, I WILL REBOOT WHEN I FEEL LIKE ITHow do you like them apples?

Update:  After doing some digging, I figured these settings could be controlled via Group Policy.  If you open gpedit.msc, the settings sure enough are there:

GPO - DisableAutoReboot

Like I said before, Home versions of Windows do not have this capability, so what to do?  Regedit!  Apply these regedits and you, yes YOU, can disable the nuclear time bomb yourself.  Make sure you know what you are doing within the registry before you start editing.  I cannot assume any responsibility and will offer no help if you nuke your PC doing so.

DisableAutoReboot

 

Monday, January 10, 2011

I’ll be speaking @ SPSEMEA

Live Online SharePoint Saturday EMEA is back on January 22nd, 2011. This is the second annual SPSEMEA and promises to be a huge event with over 30 sessions, 4 simultaneous Live Meeting Channels and a public text chat room open to participants and speakers.

Registration for SPSEMEA begins on January 11 and is free to the global SharePoint Community. There are over 30 SharePoint Evangelists, including 10 SharePoint MVPs, from around the world providing content you would normally only see at a paid SharePoint Conference. Tracks are set for SharePoint End Users and Business Managers on topics for "How We Did It: Real World Case Studies", "No Code/Assembly Solutions", "SharePoint Interface Branding", and "SharePoint for Business". The sessions will be recorded and made available two weeks after the event.

32PiecesOfFlairLast year was terrific and what I learned was invaluable.  This is a *free* event, so please sign up!  Look over the list of sessions and plan your day accordingly.  Of course, if you want to attend mine, I’d be very happy!  I’ll be showing off the series of blog posts that I put together: http://bit.ly/cPlFCE.  I’ll be adding some flair, not a full 32 pieces, but hopefully enough to get some HS’s!

I have to give thanks to all of the great people putting this event together.  Without them, this simply would not happen.

SPSEMEA Organizing Team

Mark Miller (@eusp), United States
Toni Frankola (@ToniFrankola), Croatia
Isaac Stith (@MrIsaac), United States
Ayman El-Hattab (@aymanelhattab), Egypt

Thanks guys!

Friday, December 17, 2010

Create an event receiver script within your ActiveScriptEventConsumer with PowerEvents

I’ve had the pleasure of meeting Trevor Sullivan when I convinced him he should learn all about SQL Server.  Not really, but we did chat it up on Twitter and decided to both go to Cleveland for an intro on SQL Server 2008 R2.  Little did I know what he was working on.  Quite simply one of the coolest projects I’ve used from Codeplex.  Trevor has created PowerEvents!  I’ll admit, some of it is way over my head at the moment.  It’s directly related to how much I really know about WMI, but I feel that’s about to change drastically.

I posted a tweet earlier about what I’ve created with PowerEvents.  Actually, I feel as if it would be a best practice for the ActiveScriptEventConsumer.  You can be the judge of that Winking smile.  Since it’s almost impossible to see what you’ve created as an Event Consumer, I’ve simply created only one: ActiveScriptEventConsumer.  That way I don’t have to worry about what has been added under the hood to WMI.  All I have to do is tweak the script that is fired when the event occurs.  So, I’ve built a basic script that looks for the arguments you have passed to it.  Based on these arguments, you can dynamically call different scripts or functions.  Pretty slick, eh?  Here’s a basic script that will email two different people based on what the WMI query results are.

Option Explicit
Const strFrom = "example@example.com"
Const strMailserver = "smtp.example.com"
Const strSchema = "http://schemas.microsoft.com/cdo/configuration/"
Dim objArgs, objEmail
Dim strProcessName, strSubject, strBody, strTo
'Get arguments from command line
set objArgs = WScript.Arguments
strProcessName = WScript.Arguments(0)
strSubject = WScript.Arguments(1)
strBody = Wscript.Arguments(2)
'Dynamically change the email recipient
'Or even change the function to be called
'Or call a completely different script: .bat, .vbs, .ps1
'Endless possibilities
If strProcessName = "NotePad.exe" Then
	strTo = "myboss@example.com"
ElseIf strProcessName = "Outlook.exe" Then
	strTo = "me@example.com"
End If
'Call to send email, but many different functions could be within this script and
'dynamically called based on arguments
Call SendEmail(strSubject, strBody)
'Function(s)
Sub SendEmail(Subject, Body)
	Set objEmail = CreateObject("CDO.Message")
	objEmail.From = strFrom
	objEmail.To = strTo
	objEmail.Subject = Subject
	objEmail.Textbody = Body
	objEmail.Configuration.Fields.Item _
	    (strSchema & "sendusing") = 2
	objEmail.Configuration.Fields.Item _
	    (strSchema & "smtpserver") = strMailserver
	objEmail.Configuration.Fields.Item _
	    (strSchema & "smtpserverport") = 25
	objEmail.Configuration.Fields.Update
	objEmail.Send
End Sub
'Clean up vars
set strProcessName = nothing
set strSubject = nothing
set strBody = nothing


 



I hope you find this useful.  I’m brand new to creating PowerEvents, but I do feel this is the best way to handle scripting based on events.  Feel free to post a comment if I’m an idiot Rolling on the floor laughingand there is a much easier way…

Sunday, November 28, 2010

Clean up your PC this holiday season…

In the last day, I’ve had 3 PC’s dropped off to me all for the same reason: “Can you take off all of the garbage that comes with this and make it as fast as possible?”.  Laptops are horrendously crippled machines out of the box.  It all boils down to advertising.  The Bing bar does absolutely nothing for the end user other than running in the background wasting resources.  The same goes for the classic Adobe Reader auto run entry in the registry.  It’s all a bit of rubbish if you ask me.  There is absolutely no need for a netbook running Windows 7 Starter edition to have 16 .exe’s firing upon startup.  Look at it, I’m not making it up:

image

Most, if not all listed here is software that is a bunch of gunk!  I’m completely baffled as to why most software vendors feel the need to attach every bit of itself to the startup process.  It’s Windows 7 people!  If you absolutely need to have your .exe running in the background, fire it up as an Automatic Delayed Service.  Operative word: Delayed…  This will run after the computer freed up a few resources that are tied up during the login process.  It’s a no brainer these days to take advantage of that capability.  However, since this seems to be the status quo, I’ll continue to shake my head and collect my paycheck *fixing* what shouldn’t ever have been broken.  Here’s a few steps that you can take to optimize your brand new computer.

  1. Grab Revo Uninstaller – Beginner Level
  2. Grab CCleaner – Beginner level
  3. Grab Autoruns – Advanced level

Depending on how in-depth you’d like to go, I’ve marked each software with a level.  Each of these can do major damage to your brand new machine, so use caution.  If you’d rather leave it to an expert, I can always be reached.  While I never use Revo Uninstaller, I’d like to show beginners some of the options available.  I go through the list in Programs and Features picking off non-essential software.  After a while, you just get an eye for it.

What do I look for?

I rip out arguably more than I should, but that’s just me.  I OPTIMIZE Winking smile.  The usual targets are any power management softwares, widget bars, pre-loaded games, the stupid trial version of anti-virus… By the way, don’t pay for an anti-virus.  Yeah, I said it!  They all are garbage, but since you HAVE to use one, use Microsoft Security Essentials.  It’s free and less intrusive than the other free options out there.  Getting back to the list of garbage: Toolbars, preloaded screensavers, the Acrobat.com entry (To this day, I’ve never found out what that actually does.), DVD programs, Label printing software (Who uses a netbook to print labels?).  Everything I’ve listed here, Windows 7 can do out of the box; and a mighty fine job of it, if you ask me. 

Don’t Accept OOTB

It’s necessary for you to optimize your computer even though it’s brand new.  It’s a sad fact, but nonetheless, a fact.  If you use different techniques to make your PC more efficient, feel free to post a comment.  I love hearing about how other people are dealing with this.

Wednesday, November 24, 2010

SharePoint: Integrate ASP.net controls with Forms – Pt6: Bonus: Embed documents to page

Pt.1: Use an SP Datasource to push values to a drop-down menu control
Pt2: Adding a DVWP Form to the page
Pt3: Update the DVWP Form using a Drop-Down
Pt4: Trimming Drop Down List results using CAML
Part 5: Force Selection within Drop Down List
Pt6: Bonus: Embed documents to page

I’ve been thinking about a few comments I’ve received during this series.  Specifically, this comment in particular from Jeremy on EUSP: “Would adding a document view/preview window be possible? It sounds like it might fit into where you are headed with this project.”  I initially wrote that it would not be possible without some code.  That comment is still valid, but I’ve went ahead and wrote the code to display certain document types.  Initially this XSL template will handle: .pdf’s, png’s, jpg’s, gif’s, mp3’s, wmv’s and .vsd’s.  I’m sure there’s more to add, so feel free to post a comment if you’d like to see something added!

SPXSLT

I’m a big fan of this project.  Isn’t it obvious?  My avatar on Twitter was the SPXSLT logo for a week or so.  If you haven’t been to the codeplex site and used these templates, you now have no reason…

What does it do?

I’m going to go over the most complex file type.  This should give you a good understanding of how all of the other file types work.  Let’s give credit where credit is due. http://www.wssdemo.com/Pages/visio.aspx is where you can find this code:
 <OBJECT classid="CLSID:279D6C9A-652E-4833-BEFC-312CA8887857" 
codebase="http://www.microsoft.com/downloads/info.aspx?na=90&p=&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId=d88e4542-b174-4198-ae31-6884e9edd524&u=http%3a%2f%2fdownload.microsoft.com%2fdownload%2f6%2ff%2f5%2f6f569198-e7d0-49af-b162-54a11f38d301%2fvisioviewer.exe" 
id="viewer1" width="100%" height="100"> 
<param name="BackColor" value="16777120">
<param name="AlertsEnabled" value="1">
<param name="ContextMenuEnabled" value="1">
<param name="GridVisible" value="0">
<param name="HighQualityRender" value="1">
<param name="PageColor" value="16777215">
<param name="PageVisible" value="1">
<param name="PropertyDialogEnabled" value="1">
<param name="ScrollbarsVisible" value="1">
<param name="ToolbarVisible" value="1">
<param name="SRC" value="http://www.wssdemo.com/Shared%20Documents/carpark.vsd">
<param name="CurrentPageIndex" value="0">
<param name="Zoom" value="-1">
</object>



This code allows you to embed visio files within IE (Internet Explorer).  I know, I know, it doesn’t work in Chrome or any other browser for that matter, but it’s still nice if you have an audience that will be using IE only.  I’ve tried to make all of the other file types adhere to standards, so they all should work no matter what browser you use. 


Breaking It Down



To use this template, you have to call it like this:


<xsl:call-template name="EmbeddedFilePreview">
 <xsl:with-param name="FileType" select="@File_x0020_Type"/>
 <xsl:with-param name="FilePath" select="@FileRef"/>
 <xsl:with-param name="paramHeight" select="500"/>
 <xsl:with-param name="paramWidth" select="1000"/>
 <xsl:with-param name="curr_Site" select="$curr_Site" />
</xsl:call-template>


The FileType, FilePath, and curr_Site parameter are required if you are wanting to display .vsd files in your page.  For some reason, the .vsd object requires a full URL and not a relative path.  To get the current site, you’ll want to setup a Server Variable: SERVER_NAME.  You’ll see why that’s important within the .vsd file type.  All of the other file types that you would display using this template *do not* require the curr_Site variable.  There are two other variables that are optional.  They are paramHeight and paramWidth.  If these aren’t set when you call the template, the values are defaulted to 500px and 100%, respectively.


Here’s the SPXSLT code to embed a visio document:


<xsl:when test="$FileType = 'vsd'">
 <xsl:choose>
  <xsl:when test="$curr_Site = ''">
   <b>The current site parameter *must* be provided!</b>
  </xsl:when>
  <xsl:otherwise>
   <object>
    <xsl:attribute name="classid">    
     <xsl:text>CLSID:279D6C9A-652E-4833-BEFC-312CA8887857</xsl:text>
    </xsl:attribute>
    <xsl:attribute name="id">    
     <xsl:text>VSDViewer</xsl:text>
    </xsl:attribute>
    <xsl:attribute name="width">
     <xsl:value-of select="$Width" />
    </xsl:attribute> 
    <xsl:attribute name="height">
     <xsl:value-of select="$Height" />
    </xsl:attribute>
    <xsl:text disable-output-escaping="yes">
    &lt;param name=&quot;BackColor&quot; value=&quot;16777120&quot;&gt;
    &lt;param name=&quot;AlertsEnabled&quot; value=&quot;1&quot;&gt;
    &lt;param name=&quot;ContextMenuEnabled&quot; value=&quot;1&quot;&gt;
    &lt;param name=&quot;GridVisible&quot; value=&quot;0&quot;&gt;
    &lt;param name=&quot;HighQualityRender&quot; value=&quot;1&quot;&gt;
    &lt;param name=&quot;PageColor&quot; value=&quot;16777215&quot;&gt;
    &lt;param name=&quot;PageVisible&quot; value=&quot;1&quot;&gt;
    &lt;param name=&quot;PropertyDialogEnabled&quot; value=&quot;1&quot;&gt;
    &lt;param name=&quot;ScrollbarsVisible&quot; value=&quot;1&quot;&gt;
    &lt;param name=&quot;ToolbarVisible&quot; value=&quot;1&quot;&gt;
    &lt;param name=&quot;SRC&quot; value=&quot;http://</xsl:text>
    <xsl:value-of select="concat($curr_Site, $FilePath)"/><xsl:text disable-output-escaping="yes">&quot;&gt;
    &lt;param name=&quot;CurrentPageIndex&quot; value=&quot;0&quot;&gt;
    &lt;param name=&quot;Zoom&quot; value=&quot;-1&quot;&gt;</xsl:text>
    <p>It appears you don't have a Visio Viewer plugin for this browser.</p>
   </object>
  </xsl:otherwise>
 </xsl:choose>
</xsl:when>


You’ll notice the test is to see whether or not curr_Site is blank.  If the curr_Site and FilePath match a document, then it’ll embed the visio drawing into the page.  I do a little bit of magic with the concat in the middle there, so if you are trying to use this in an SSL environment, change the text to: https://.


Where’s the code?



The preview is only shown here.  I’m going to post all of the code to the SPXSLT site, so get the latest revision there.  If you have any tweaks for me or need to get this working, I’m always glad to hear from you.


Screenshots?



You know I have screenshots!  Here’s a visio drawing:


image


Here’s a .pdf:


image


Here's a .jpg:


image


Hey, why not a video? .wmv


image





Update:
The code for this template can be found here:
http://spxslt.codeplex.com/discussions/235951

Wednesday, April 14, 2010

HTML5 is changing more than the web

This is more of an observation of what I see the internet will be in the next 10 years. Think back to 2000 and how the web used to look then, compared to now. It’s almost a laughable matter. I would’ve never been able to pull of my Twitter Marriage Proposal. ^_^ HTML5 will change how software is developed, with database caching and drag and drop being the biggest catalyst.

Microsoft has dedicated itself to creating a browser that is capable to handle HTML5. Lucky for us it’s the next iteration of Internet Explorer. And yes if you opened the last link up with IE8, it doesn’t work that well unfortunately… With everything computer related, there is always a better way to do it. That’s why the HTML5 standard is so important. It’ll open so many possibilities. One major capability will be to run applications from the cloud and have direct access to everything when you aren’t connected. That’s absolutely HUGE! I see the ability to use a computer without ever installing an application natively. This could work so well, that this may never be an offering again…

How will Microsoft compete?

Currently there are licensing costs for Microsoft’s O.S. as well as SQL Server for that matter. With the transformation of the web, Microsoft will have to rethink how they license their software in order to position themselves as the web platform of choice. LAMP (Linux, Apache, MySQL, PHP) servers can be downloaded freely and setup with relatively no costs. There are compelling reasons for using these types of deployments for the web (e.g., here and here) Did I mention it’s free?; Because it’s free… That doesn’t mean there isn’t any hope in securing the top spot. Microsoft has been focusing on allowing new startups to compete for relatively no costs as well. It’s also making it very easy to deploy major applications on top of IIS.

Licensing, Licensing, Licensing!!!

One of the most compelling reasons for using a LAMP deployment is licensing. Costs can make or break companies these days. How to get off the ground with little costs is a question I’ve asked myself. Maybe you have too… There are many entry level ways (as I’ve shown above) to get up and running with Microsoft but scaling those out to handle millions of connections can become very expensive, very quickly. MySQL is so popular because it’s scalable without the hefty price tag of SQL. For licensing revenue to continue rolling in for both O.S. and SQL, they’ll have to compete in this market as it exists today.

As the web grows…

You’ll continue to hear more stories such as “Cloud Computing” and “I only watch TV online”. You’ll also see Microsoft persuade young developers more and more that it’s the platform of choice for the web. Making IT personnel more comfortable with hosting their web apps on Microsoft is only the start in my eyes. I’m sure this hasn’t been overlooked within the walls of Redmond either. Either way HTML5 is pushing this forward.

I’m excited to see what’s in store over the next 10 years and expect my life to be easier because of a server side app, not a client side app…